With this update, we continue accept almost anything because of hex. and number suffixes for C/C++ dump and allows much closer
formations xBase code as nA>0.AND. ...
+ Added separate terms for ending numerics states.
Index: LexFlagship.cxx
===================================================================
--- LexFlagship.cxx (revision 1.5)
+++ LexFlagship.cxx (working copy)
@@ -86,9 +86,13 @@
}
break;
case SCE_FS_NUMBER:
+ if (!IsAWordChar(sc.ch) && !(sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_FS_DEFAULT);
+ }
+ break;
case SCE_FS_NUMBER_C:
if (!IsAWordChar(sc.ch) && sc.ch != '.') {
- sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ sc.SetState(SCE_FS_DEFAULT_C);
}
break;
case SCE_FS_CONSTANT:
Please Neil could you make the change.
Attachment file with the patch and new full LexFlagship.cxx file, TIA.
BTW, in QScintilla not incorporated the class encapsulates for this lexer. Phil?
Best regards,
--
Xavi
> With this update, we continue accept almost anything because of hex. and
> number suffixes for C/C++ dump and allows much closer formations xBase code
> as nA>0.AND. ...
It appears you want to disallow alphabetic characters in numeric
literals. However, some xBase variants allow such literals. The
wikipedia page for Harbour lists hexadecimal literals in "Number: 1,
1.1, -1, 0xFF":
http://en.wikipedia.org/wiki/Harbour_%28software%29#Built-in_data_types
Neil
> It appears you want to disallow alphabetic characters in numeric
> literals. ...
No. This only force that after the point must be a digit.
Valid .-
Local dFecha := {^2010/05/28} // These are valid date in Harbour, VFP, ...
Local nA := 0xFF, nB := -1, nC := 1.1, nD := .2 // These are valid numbers
Not valid .-
Local nNo := 2. // Syntax error "syntax error at '.'"
Local nNo := 2.F // Syntax error "syntax error at '.'"
For C/C++ dump is not affected .-
float nfNum = 2. ; // These are valid float
And it allows a correct interpretation of constants and operators.
IF nA>0.AND.nA<9
...
ENDIF
Best regards,
--
Xavi
> No. This only force that after the point must be a digit.
OK, committed.
New prerelease in CVS and available from