diff options
| author | Jad Altahan <xviyy@aol.com> | 2019-05-22 16:11:45 +1000 | 
|---|---|---|
| committer | Jad Altahan <xviyy@aol.com> | 2019-05-22 16:11:45 +1000 | 
| commit | 9d9bbec07291d768be64a3ea045a4aa656d150ae (patch) | |
| tree | 65255070de3f5df6f50cb9e44452b3c8e07e3427 | |
| parent | 3018a2890c076b33159adc6655586c39e2693b22 (diff) | |
| download | scintilla-mirror-9d9bbec07291d768be64a3ea045a4aa656d150ae.tar.gz | |
Support for VB2017 bin literals & digit separators
| -rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
| -rw-r--r-- | lexers/LexVB.cxx | 6 | ||||
| -rw-r--r-- | test/examples/x.vb | 4 | ||||
| -rw-r--r-- | test/examples/x.vb.styled | 4 | 
4 files changed, 17 insertions, 1 deletions
| diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 66fcaf36b..30a99d684 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -567,6 +567,10 @@  	Lexer added for X12.  	<a href="https://sourceforge.net/p/scintilla/feature-requests/1280/">Feature #1280</a>.  	</li> + 	<li> +	VB lexer adds support for VB2017 binary literal &B and digit separators 123_456. +	<a href="https://sourceforge.net/p/scintilla/feature-requests/1288/">Feature #1288</a>. +	</li>  	<li>  	Improved performance of line folding code on large files when no folds are contracted.  	This improves the time taken to open or close large files. diff --git a/lexers/LexVB.cxx b/lexers/LexVB.cxx index 3b380c4fd..ceac8d2fe 100644 --- a/lexers/LexVB.cxx +++ b/lexers/LexVB.cxx @@ -53,7 +53,7 @@ static inline bool IsANumberChar(int ch) {  	// but probably enough in most cases.  	return (ch < 0x80) &&  	        (isdigit(ch) || toupper(ch) == 'E' || -             ch == '.' || ch == '-' || ch == '+'); +             ch == '.' || ch == '-' || ch == '+' || ch == '_');  }  static void ColouriseVBDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, @@ -199,6 +199,10 @@ static void ColouriseVBDoc(Sci_PositionU startPos, Sci_Position length, int init  				// Octal number  				sc.SetState(SCE_B_NUMBER);  				sc.Forward(); +			} else if (sc.ch == '&' && tolower(sc.chNext) == 'b') { +				// Binary number +				sc.SetState(SCE_B_NUMBER); +				sc.Forward();  			} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {  				sc.SetState(SCE_B_NUMBER);  			} else if (IsAWordStart(sc.ch) || (sc.ch == '[')) { diff --git a/test/examples/x.vb b/test/examples/x.vb index a4503704b..a672831a0 100644 --- a/test/examples/x.vb +++ b/test/examples/x.vb @@ -7,3 +7,7 @@ Dim d As String = "\\\\server\\share\\file.txt"  ""C "c"C "cc"C  ' Date  d = #5/31/1993# or # 01/01/0001 12:00:00AM # +' Number +123_456___789 +123_ +&b10101_01010 diff --git a/test/examples/x.vb.styled b/test/examples/x.vb.styled index e0c86f918..1d19c8ae8 100644 --- a/test/examples/x.vb.styled +++ b/test/examples/x.vb.styled @@ -7,3 +7,7 @@  {4}""C{0} {4}"c"C{0} {4}"cc"C{0}  {1}' Date  {7}d{0} {6}={0} {8}#5/31/1993#{0} {3}or{0} {8}# 01/01/0001 12:00:00AM #{0} +{1}' Number +{2}123_456___789{0} +{2}123_{0} +{2}&b10101_01010{0} | 
