[JEDI.NET-commits] main/run Jedi.Math.Evaluation.Tokenization.pas,1.3,1.4
Status: Pre-Alpha
Brought to you by:
jedi_mbe
From: Marcel B. <jed...@us...> - 2005-12-31 11:44:26
|
Update of /cvsroot/jedidotnet/main/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2766/main/run Modified Files: Jedi.Math.Evaluation.Tokenization.pas Log Message: Symbol names must start with a letter or an underscore Index: Jedi.Math.Evaluation.Tokenization.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.Math.Evaluation.Tokenization.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Jedi.Math.Evaluation.Tokenization.pas 27 Sep 2005 18:29:35 -0000 1.3 --- Jedi.Math.Evaluation.Tokenization.pas 31 Dec 2005 11:44:07 -0000 1.4 *************** *** 53,56 **** --- 53,59 ---- strict private FCulture: CultureInfo; + strict protected + const + ExpressionRelatedChars = '+-*/<>=!&|^?:,'; {$ENDREGION} {$REGION 'Individual tokenization methods'} *************** *** 165,171 **** begin // When this method is entered, we already know it's because it hasn't recognized anything to do with an expression ! // Therefore, it must be an identifier. We consider everything up to the next whitespace or expression related ! // character part of the identifier. ! Result := Input.Sequence.Length > 0; if Result then begin --- 168,174 ---- begin // When this method is entered, we already know it's because it hasn't recognized anything to do with an expression ! // Therefore, if it starts with a letter or an underscore, it must be an identifier. We consider everything up to the ! // next whitespace or expression related character part of the identifier. ! Result := (Input.Sequence.Length > 0) and (System.Char.IsLetter(Input.Sequence, 0) or (Input.Sequence.Chars[0] = '_')); if Result then begin *************** *** 175,179 **** repeat sb.Append(Input.Sequence); ! until not Input.Next or ('+-*/<>=!&|^?:,'.IndexOf(Input.Sequence.Chars[0]) > -1); Result := sb.Length > 0; token := IdentifierToken.Create(Context, startLine, startColumn, sb.ToString); --- 178,182 ---- repeat sb.Append(Input.Sequence); ! until not Input.Next or (ExpressionRelatedChars.IndexOf(Input.Sequence.Chars[0]) > -1); Result := sb.Length > 0; token := IdentifierToken.Create(Context, startLine, startColumn, sb.ToString); |