Menu

Commit [r605]  Maximize  Restore  History

Replaced use of '=' literal for equals token with constant.

delphidabbler 2010-02-08

changed /branches/delphi2010-port/Src/UTaggedTextLexer.pas
/branches/delphi2010-port/Src/UTaggedTextLexer.pas Diff Switch to side-by-side view
--- a/branches/delphi2010-port/Src/UTaggedTextLexer.pas
+++ b/branches/delphi2010-port/Src/UTaggedTextLexer.pas
@@ -56,7 +56,7 @@
   cDoubleQuote = '"';
   cWhiteSpace = [' ', TAB, LF, VTAB, FF, CR];
   cQuotes = [cSingleQuote, cDoubleQuote];
-  { TODO -oSelf -cProposal : Add a new const for '=' symbol }
+  cEquals = '=';
 
 
 type
@@ -819,7 +819,8 @@
     // We have attribute: get name
     StartPos := NextChPos;
     while (NextChPos <= Len)
-      and not IsWhiteSpace(TagStr[NextChPos]) and (TagStr[NextChPos] <> '=') do
+      and not IsWhiteSpace(TagStr[NextChPos])
+      and (TagStr[NextChPos] <> cEquals) do
       Inc(NextChPos);
     Name := MidStr(TagStr, StartPos, NextChPos - StartPos);
     // skip any white space following name
@@ -828,7 +829,7 @@
 
     // Check for value
     // if current character is '=' we have a value (else no value)
-    if TagStr[NextChPos] = '=' then
+    if TagStr[NextChPos] = cEquals then
     begin
       // skip '=' symbol
       Inc(NextChPos);
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.