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/bash.tes | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/lexers/bash.tes') diff --git a/lib/lexers/bash.tes b/lib/lexers/bash.tes index b93a3c4..b66d6e3 100644 --- a/lib/lexers/bash.tes +++ b/lib/lexers/bash.tes @@ -3,12 +3,12 @@ internally ! @[lexer.test.bash]{ - _#!M[sh,bash,ksh]M[lexer.checkheader]U.r - Q.r"F :EN*.shQ*U.r ' - Q.r"F :EN*.bshQ*U.r ' - Q.r"F :EN*/configureQ*U.r ' - Q.r"F :EN*.kshQ*U.r ' -Q.r} + _#!M[sh,bash,ksh]M[lexer.checkheader]"S -1 ' + :EN*.shQ*"S -1 ' + :EN*.bshQ*"S -1 ' + :EN*/configureQ*"S -1 ' + :EN*.kshQ* +} @[lexer.set.bash]{ ESSETLEXERLANGUAGEbash -- cgit v1.2.3