Menu

Commit [r999]  Maximize  Restore  History

Fixed two bugs in UTaggedTextLexer unit:

* Fixed bug ID #3107982 where REML code with un-terminated tags was being accepted.
* Fixed unreported bug that was reporting "unrecognised tag" rather than "empty tag" errors for tags such as < >, </ > and < />.

delphidabbler 2010-11-13

changed /trunk/Src/UTaggedTextLexer.pas
/trunk/Src/UTaggedTextLexer.pas Diff Switch to side-by-side view
--- a/trunk/Src/UTaggedTextLexer.pas
+++ b/trunk/Src/UTaggedTextLexer.pas
@@ -683,6 +683,8 @@
     Inc(NextChPos);
   // Copy the name from the string
   Result := MidStr(TagStr, StartPos, NextChPos - StartPos);
+  if Trim(Result) = '' then
+    raise ETaggedTextTagHandler.Create(sTagEmpty);
 end;
 
 function TTaggedTextTagHandler.GetTagParams(const TagStr: string;
@@ -1187,7 +1189,7 @@
   else
   begin
     // We're at end of tagged text it's an error if we still have unclosed tags
-    if not fTagStack.Count = 0 then
+    if fTagStack.Count <> 0 then
       raise ETaggedTextLexer.Create(
         sUnexpectedEOF, TSelection.Create(Length(fTaggedText))
       );
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.