From 6efa2ebd0e44b758740120374d63874beda7ba6a Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 17 Feb 2016 13:11:58 +0100 Subject: simplified "lexer.test..." macros using the $$ return command * this is slightly more efficient than using repeated conditionals * the last :EN does not require a conditional, as its return value can simply be forwarded. * even without $$, this could have been done easier using a once-only loop and breaking out of the loop if :EN fails using :;. The last :EN result is still stored in QReg "_". * :EN could also be used to match header lines if lexer.tes would leave the first line (header line) in some Q-Reg, like the local .[header]. However, repeated :ENs would be necessary as globbing currently does not support {...,...} expansions. Since sooner or later, the header line must be evaluated for some lexer.set macro, this is probably more efficient than the current solution using SciTECO patterns and [lexer.checkheader] could be removed as well. --- lib/lexers/xml.tes | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/lexers/xml.tes') diff --git a/lib/lexers/xml.tes b/lib/lexers/xml.tes index d56e7d6..3b6ae41 100644 --- a/lib/lexers/xml.tes +++ b/lib/lexers/xml.tes @@ -1,17 +1,17 @@ ! Lexing for XML and its applications ! @[lexer.test.xml]{ - :EN*.xmlQ*U.r - Q.r"F :EN*.xslQ*U.r ' - Q.r"F :EN*.svgQ*U.r ' - Q.r"F :EN*.xulQ*U.r ' - Q.r"F :EN*.xsdQ*U.r ' - Q.r"F :EN*.dtdQ*U.r ' - Q.r"F :EN*.xsltQ*U.r ' - Q.r"F :EN*.axlQ*U.r ' - Q.r"F :EN*.xrcQ*U.r ' - Q.r"F :EN*.rdfQ*U.r ' -Q.r} + :EN*.xmlQ*"S -1 ' + :EN*.xslQ*"S -1 ' + :EN*.svgQ*"S -1 ' + :EN*.xulQ*"S -1 ' + :EN*.xsdQ*"S -1 ' + :EN*.dtdQ*"S -1 ' + :EN*.xsltQ*"S -1 ' + :EN*.axlQ*"S -1 ' + :EN*.xrcQ*"S -1 ' + :EN*.rdfQ* +} @[lexer.set.xml]{ ESSETLEXERLANGUAGExml -- cgit v1.2.3