From ee5a2c0f618c5ace63c14323643aa56e8b890769 Mon Sep 17 00:00:00 2001 From: Pavel Sountsov Date: Wed, 7 Jun 2017 21:15:46 -0700 Subject: Bug [#1919]. Rust - Update integer suffixes. --- doc/ScintillaHistory.html | 4 ++++ lexers/LexRust.cxx | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 6c608bdfc..ea6ac5575 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -536,6 +536,10 @@ Support dropped for GTK+ versions before 2.24.
  • + The Rust lexer recognizes 'usize' numeric literal suffixes. + Bug #1919. +
  • +
  • On Qt, mouse tracking is reenabled when the window is reshown. Bug #1948.
  • diff --git a/lexers/LexRust.cxx b/lexers/LexRust.cxx index 1f2b847d6..4f2c6617a 100644 --- a/lexers/LexRust.cxx +++ b/lexers/LexRust.cxx @@ -271,7 +271,7 @@ static void ScanNumber(Accessor& styler, Sci_Position& pos) { pos++; c = styler.SafeGetCharAt(pos, '\0'); n = styler.SafeGetCharAt(pos + 1, '\0'); - if (c == '8' || c == 's') { + if (c == '8') { pos++; } else if (c == '1' && n == '6') { pos += 2; @@ -279,6 +279,8 @@ static void ScanNumber(Accessor& styler, Sci_Position& pos) { pos += 2; } else if (c == '6' && n == '4') { pos += 2; + } else if (styler.Match(pos, "size")) { + pos += 4; } else { error = true; } -- cgit v1.2.3