diff options
-rw-r--r-- | lib/lexer.tes | 19 | ||||
-rw-r--r-- | lib/lexers/batch.tes | 4 | ||||
-rw-r--r-- | lib/lexers/cmake.tes | 4 | ||||
-rw-r--r-- | lib/lexers/cpp.tes | 4 | ||||
-rw-r--r-- | lib/lexers/make.tes | 4 | ||||
-rw-r--r-- | lib/lexers/patch.tes | 4 | ||||
-rw-r--r-- | lib/lexers/sh.tes | 9 | ||||
-rw-r--r-- | lib/lexers/xml.tes | 4 |
8 files changed, 32 insertions, 20 deletions
diff --git a/lib/lexer.tes b/lib/lexer.tes index de73d5c..01c3bf1 100644 --- a/lib/lexer.tes +++ b/lib/lexer.tes @@ -1,11 +1,22 @@ ! Lexer configuration and styles (ED hook) ! +! Match Q-Reg "_" against beginning of current doc's first line ! +@[lexer.checkheader]{ + .h + 0,0,1ESPOSITIONFROMLINE:X.h + EQ.h :SQ_ Q*EB +} + +! Match Q-Reg "_" against end of current doc's file name ! +@[lexer.checkname]{ + EQ* ZJ I H:SQ_ + Q*EB +} + @[lexer.auto]{ ! Set up brace lightning ! :M[color.bracelight],34M[color.set] :M[color.error],35M[color.set] - - Q*U.f EQ* HX.f :.f EQ.f } ! individual tests are appended by the lexers/*.tes files ! @@ -18,6 +29,4 @@ EMQ[$SCITECOPATH]/lexers/sh.tes EMQ[$SCITECOPATH]/lexers/xml.tes ! append an "end" label ! -@:[lexer.auto]{ - Q.fEB -!end!} +:[lexer.auto]!end! diff --git a/lib/lexers/batch.tes b/lib/lexers/batch.tes index 9453628..7175a6c 100644 --- a/lib/lexers/batch.tes +++ b/lib/lexers/batch.tes @@ -1,7 +1,7 @@ ! DOS, Windows, OS/2 Batch Files ! @[lexer.test.batch]{ - [_ :S.[bat,cmd,nt] ]_ + [_ _.[bat,cmd,nt]M[lexer.checkname] ]_ } @[lexer.set.batch]{ @@ -23,5 +23,5 @@ } @:[lexer.auto]{ - :M[lexer.test.batch]"S Q.fEB :M[lexer.set.batch] Oend ' + :M[lexer.test.batch]"S :M[lexer.set.batch] Oend ' } diff --git a/lib/lexers/cmake.tes b/lib/lexers/cmake.tes index 8f66750..435a357 100644 --- a/lib/lexers/cmake.tes +++ b/lib/lexers/cmake.tes @@ -1,7 +1,7 @@ ! CMake Lexing ! @[lexer.test.cmake]{ - [_ :S[CMakeLists.txt,.cmake,.ctest] ]_ + [_ _[CMakeLists.txt,.cmake,.ctest]M[lexer.checkname] ]_ } @[lexer.set.cmake]{ @@ -77,5 +77,5 @@ } @:[lexer.auto]{ - :M[lexer.test.cmake]"S Q.fEB :M[lexer.set.cmake] Oend ' + :M[lexer.test.cmake]"S :M[lexer.set.cmake] Oend ' } diff --git a/lib/lexers/cpp.tes b/lib/lexers/cpp.tes index f979153..f07555a 100644 --- a/lib/lexers/cpp.tes +++ b/lib/lexers/cpp.tes @@ -1,7 +1,7 @@ ! C/C++ Lexing ! @[lexer.test.cpp]{ - [_ :S.[c,cc,cpp,cxx,h,hh,hpp,hxx,ipp,m,mm,sma] ]_ + [_ _.[c,cc,cpp,cxx,h,hh,hpp,hxx,ipp,m,mm,sma]M[lexer.checkname] ]_ } @[lexer.set.cpp]{ @@ -39,5 +39,5 @@ } @:[lexer.auto]{ - :M[lexer.test.cpp]"S Q.fEB :M[lexer.set.cpp] Oend ' + :M[lexer.test.cpp]"S :M[lexer.set.cpp] Oend ' } diff --git a/lib/lexers/make.tes b/lib/lexers/make.tes index a841f7d..48ad886 100644 --- a/lib/lexers/make.tes +++ b/lib/lexers/make.tes @@ -1,7 +1,7 @@ ! Makefile Lexing ! @[lexer.test.make]{ - [_ :S[makefile,.mak] ]_ + [_ _[makefile,.mak]M[lexer.checkname] ]_ } @[lexer.set.make]{ @@ -15,5 +15,5 @@ } @:[lexer.auto]{ - :M[lexer.test.make]"S Q.fEB :M[lexer.set.make] Oend ' + :M[lexer.test.make]"S :M[lexer.set.make] Oend ' } diff --git a/lib/lexers/patch.tes b/lib/lexers/patch.tes index 1949712..2a7204d 100644 --- a/lib/lexers/patch.tes +++ b/lib/lexers/patch.tes @@ -1,7 +1,7 @@ ! Patch/Diff Files ! @[lexer.test.patch]{ - [_ :S.[diff,patch] ]_ + [_ _.[diff,patch]M[lexer.checkname] ]_ } @[lexer.set.patch]{ @@ -16,5 +16,5 @@ } @:[lexer.auto]{ - :M[lexer.test.patch]"S Q.fEB :M[lexer.set.patch] Oend ' + :M[lexer.test.patch]"S :M[lexer.set.patch] Oend ' } diff --git a/lib/lexers/sh.tes b/lib/lexers/sh.tes index 79bdd8e..7d4f14c 100644 --- a/lib/lexers/sh.tes +++ b/lib/lexers/sh.tes @@ -1,8 +1,11 @@ ! Unix Shell ! @[lexer.test.sh]{ [_ - :S[.sh,.bsh,configure,.ksh] - ! TODO: test hash-bang line ! + _#!M[sh,bash,ksh]M[lexer.checkheader]"S + -1 + | + _[.sh,.bsh,configure,.ksh]M[lexer.checkname] + ' ]_ } @[lexer.set.sh]{ @@ -47,5 +50,5 @@ } @:[lexer.auto]{ - :M[lexer.test.sh]"S Q.fEB :M[lexer.set.sh] Oend ' + :M[lexer.test.sh]"S :M[lexer.set.sh] Oend ' } diff --git a/lib/lexers/xml.tes b/lib/lexers/xml.tes index bf82ecb..de82542 100644 --- a/lib/lexers/xml.tes +++ b/lib/lexers/xml.tes @@ -1,7 +1,7 @@ ! Lexing for XML and its applications ! @[lexer.test.xml]{ - [_ :S.[xml,xsl,svg,xul,xsd,dtd,xslt,axl,xrc,rdf] ]_ + [_ _.[xml,xsl,svg,xul,xsd,dtd,xslt,axl,xrc,rdf]M[lexer.checkname] ]_ } @[lexer.set.xml]{ @@ -25,5 +25,5 @@ } @:[lexer.auto]{ - :M[lexer.test.xml]"S Q.fEB :M[lexer.set.xml] Oend ' + :M[lexer.test.xml]"S :M[lexer.set.xml] Oend ' } |