diff options
83 files changed, 297 insertions, 196 deletions
@@ -575,10 +575,6 @@ Features: Perhaps a few select local Q-Registers (-, _, ^X, ^R) should be accessible with the global reg syntax as well, so G- is equivalent to G.-? - * Real block comments (!* ... *!) that don't spam the goto tables. - TECO-64 has end of line comments beginning with !! as well. - We may want both as 0<...> cannot be used to comment out all sorts - of blocks as it necessarily drives the parser. * `-` currently inverts the number sign in teco_state_start_minus(). So --1 == 1 and --C == C. There is probably no need for this "feature" and an error diff --git a/doc/sciteco.7.template b/doc/sciteco.7.template index 053a5cb..f9cad80 100644 --- a/doc/sciteco.7.template +++ b/doc/sciteco.7.template @@ -2085,7 +2085,8 @@ Labels are symbolic and are defined with the following syntax: .br .BI ! label ! .br -Whereas \fIlabel\fP is an arbitrary string. +Whereas \fIlabel\fP is an arbitrary non-empty string. +Labels however cannot practically begin with an asterisk sign (*). String building is not performed on \fIlabel\fP, i.e. it is used verbatim. When a label is encountered, it is cached in a macro-invocation level @@ -2094,9 +2095,36 @@ Therefore every macro invocation has its own label namespace and gotos to a label have constant complexity once a label has been parsed. Terminating a macro execution (or command line) fails if a label that is jumped to has not been defined. +Labels are also historically used as comments in TECO code. +. +.SS Comments .SCITECO_TOPIC comment -Labels also have another important role in \*(ST \(em they are used -as comments. +. +In addition to labels and unlike most classic TECO dialects, +\*(ST also supports true comments. +True comments are parsed faster than labels and do not +take up memory in goto tables. +.SCITECO_TOPIC "block comment" +One form of comments is the block comment: +.br +.BI !* comment *! +.br +Single exclamation marks (!) can be embedded in the \fIcomment\fP if they are not +following asterisk signs (unlike in goto-labels). +Block comments can span multiple lines. +They are analoguous to C's +.BI /* ... */ +comments. +.LP +.SCITECO_TOPIC "EOL comment" +The second form of real comments are end-of-line comments, +which are analogous to C++'s \fB//\fP comments: +.br +.BI !! comment +.LP +The idiom \(lq0<\fIcommands\fP>\(rq +is also sometimes useful to comment out large blocks of \*(ST code. +However, all \fIcommands\fP must still be syntactically correct. . .SS Loops .SCITECO_TOPIC < > loop diff --git a/lib/color.tes b/lib/color.tes index 23c14f3..eaa0baa 100644 --- a/lib/color.tes +++ b/lib/color.tes @@ -1,10 +1,10 @@ -! <r,g,b>M[color.rgb] -> Scintilla color ! +!* <r,g,b>M[color.rgb] -> Scintilla color *! @[color.rgb]{ U.bU.gU.r (Q.r # Q.g*256 # Q.b*256*256) } -! These 8 colors should be available on every system ! +!* These 8 colors should be available on every system *! 000,000,000:M[color.rgb]U[color.black] 128,000,000:M[color.rgb]U[color.red] 000,128,000:M[color.rgb]U[color.green] @@ -14,7 +14,7 @@ 000,128,128:M[color.rgb]U[color.cyan] 192,192,192:M[color.rgb]U[color.white] -! Light color variants, might not be available on every terminal ! +!* Light color variants, might not be available on every terminal *! 064,064,064:M[color.rgb]U[color.lblack] 255,000,000:M[color.rgb]U[color.lred] 000,255,000:M[color.rgb]U[color.lgreen] @@ -24,7 +24,7 @@ 000,255,255:M[color.rgb]U[color.lcyan] 255,255,255:M[color.rgb]U[color.lwhite] -! <[[flags,]bg,]fg,style>M[color.set] ! +!* <[[flags,]bg,]fg,style>M[color.set] *! @[color.set]{ U.s U.f "~0'U.b "~0'U.h Q.f,Q.sESSTYLESETFORE @@ -33,9 +33,9 @@ Q.h&2,Q.sESSTYLESETITALIC } -! Reset all styles and setup the standard ones ! +!* Reset all styles and setup the standard ones *! @[color.init]{ - ! Default text colors ! + !* Default text colors *! :M[color.default],32M[color.set] ESSTYLECLEARALL :M[color.linenumber],33M[color.set] @@ -44,9 +44,9 @@ 1ESSETCARETLINEVISIBLE Q[color.selfore],1ESSETSELFORE Q[color.selback],1ESSETSELBACK - ! Calltips and popup windows ! + !* Calltips and popup windows *! :M[color.calltip],38M[color.set] - ! Set up brace lightning ! + !* Set up brace lightning *! :M[color.bracelight],34M[color.set] :M[color.error],35M[color.set] } diff --git a/lib/colors/solarized.tes b/lib/colors/solarized.tes index 25a256a..fd0823e 100644 --- a/lib/colors/solarized.tes +++ b/lib/colors/solarized.tes @@ -26,14 +26,14 @@ 147,161,161:M[color.rgb],14,3EJ Q[color.lcyan] U[color.base1] 238,232,213:M[color.rgb],07,3EJ Q[color.white] U[color.base2] 253,246,227:M[color.rgb],15,3EJ Q[color.lwhite] U[color.base3] - 181,137,000:M[color.rgb],03,3EJ ! yellow ! + 181,137,000:M[color.rgb],03,3EJ !* yellow *! 203,075,022:M[color.rgb],09,3EJ Q[color.lred] U[color.orange] - 220,050,047:M[color.rgb],01,3EJ ! red ! - 211,054,130:M[color.rgb],05,3EJ ! magenta ! + 220,050,047:M[color.rgb],01,3EJ !* red *! + 211,054,130:M[color.rgb],05,3EJ !* magenta *! 108,113,196:M[color.rgb],13,3EJ Q[color.lmagenta]U[color.violet] - 038,139,210:M[color.rgb],04,3EJ ! blue ! - 042,161,152:M[color.rgb],06,3EJ ! cyan ! - 133,153,000:M[color.rgb],02,3EJ ! green ! + 038,139,210:M[color.rgb],04,3EJ !* blue *! + 042,161,152:M[color.rgb],06,3EJ !* cyan *! + 133,153,000:M[color.rgb],02,3EJ !* green *! | 000,043,054:M[color.rgb]U[color.base03] 007,054,066:M[color.rgb]U[color.base02] @@ -75,15 +75,15 @@ [color.variable] 0,Q[color.base3],Q[color.blue] [color.error] 1,Q[color.base3],Q[color.red] - ! Makes only sense for Makefiles (FIXME) ! + !* Makes only sense for Makefiles (FIXME) *! [color.target] 1,Q[color.base3],Q[color.yellow] - ! Makes only sense for Patch/Diff files ! + !* Makes only sense for Patch/Diff files *! [color.deletion] 0,Q[color.base2],Q[color.red] [color.addition] 0,Q[color.base2],Q[color.green] [color.change] 0,Q[color.base2],Q[color.yellow] - ! For highlighting braces ! + !* For highlighting braces *! [color.bracelight] 0,Q[color.base00],Q[color.base3] } @@ -108,26 +108,26 @@ [color.variable] 0,Q[color.base03],Q[color.blue] [color.error] 1,Q[color.base03],Q[color.red] - ! Makes only sense for Makefiles (FIXME) ! + !* Makes only sense for Makefiles (FIXME) *! [color.target] 1,Q[color.base03],Q[color.yellow] - ! Makes only sense for Patch/Diff files ! + !* Makes only sense for Patch/Diff files *! [color.deletion] 0,Q[color.base02],Q[color.red] [color.addition] 0,Q[color.base02],Q[color.green] [color.change] 0,Q[color.base02],Q[color.yellow] - ! For highlighting braces ! + !* For highlighting braces *! [color.bracelight] 0,Q[color.base0],Q[color.base03] } Q[solarized.light]"T :M[solarized.light] | :M[solarized.dark] ' -! Style the Q-Register view ! +!* Style the Q-Register view *! [* EQ.b :M[color.init] ]* @[solarized.toggle]{ Q[solarized.light]U[solarized.light] Q[solarized.light]"T :M[solarized.light] | :M[solarized.dark] ' - ! restyle all buffers and update Q-Reg view ! + !* restyle all buffers and update Q-Reg view *! [* EJ<%.bEB M[lexer.auto]> EQ.b :M[color.init] diff --git a/lib/colors/terminal.tes b/lib/colors/terminal.tes index 43b67c7..2aa7354 100644 --- a/lib/colors/terminal.tes +++ b/lib/colors/terminal.tes @@ -1,4 +1,4 @@ -! Default terminal color scheme ! +!* Default terminal color scheme *! [color.default] 0,Q[color.black],Q[color.white] [color.linenumber] 0,Q[color.black],Q[color.white] Q[color.black]U[color.caretline] @@ -19,16 +19,16 @@ Q[color.white]U[color.selback] [color.variable] 1,Q[color.black],Q[color.lblue] [color.error] 1,Q[color.black],Q[color.lred] -! Makes only sense for Makefiles ! +!* Makes only sense for Makefiles *! [color.target] 1,Q[color.black],Q[color.lyellow] -! Makes only sense for Patch/Diff files ! +!* Makes only sense for Patch/Diff files *! [color.deletion] 0,Q[color.black],Q[color.red] [color.addition] 0,Q[color.black],Q[color.green] [color.change] 0,Q[color.black],Q[color.yellow] -! For highlighting braces ! +!* For highlighting braces *! [color.bracelight] 0,Q[color.white],Q[color.black] -! Style the Q-Register view ! +!* Style the Q-Register view *! [* EQ.b :M[color.init] ]* diff --git a/lib/lexer.tes b/lib/lexer.tes index bd742a0..2676e1b 100644 --- a/lib/lexer.tes +++ b/lib/lexer.tes @@ -1,6 +1,6 @@ -! Lexer configuration and styles (ED hook) ! +!* Lexer configuration and styles (ED hook) *! -! Match Q-Reg "_" against beginning of current doc's first line ! +!* Match Q-Reg "_" against beginning of current doc's first line *! @[lexer.checkheader]{ [: 0,(1ESPOSITIONFROMLINE:)::S ]: } @@ -16,7 +16,7 @@ [_ } -! Automatically mung all the lexers and add them to "lexer.auto" ! +!* Automatically mung all the lexers and add them to "lexer.auto" *! [* EQ.[lexers] [_ 1ENQ[$SCITECOPATH]/lexers/*.tes ]_ J diff --git a/lib/lexers/abaqus.tes b/lib/lexers/abaqus.tes index a21c847..f2b6c03 100644 --- a/lib/lexers/abaqus.tes +++ b/lib/lexers/abaqus.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.abaqus]{ :EN*.inpQ*"S -1 ' diff --git a/lib/lexers/ada.tes b/lib/lexers/ada.tes index 318a1e3..3ee5011 100644 --- a/lib/lexers/ada.tes +++ b/lib/lexers/ada.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.ada]{ :EN*.adsQ*"S -1 ' diff --git a/lib/lexers/asl.tes b/lib/lexers/asl.tes index 9a5888c..9d2ed65 100644 --- a/lib/lexers/asl.tes +++ b/lib/lexers/asl.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.asl]{ :EN*.aslQ*"S -1 ' diff --git a/lib/lexers/asm.tes b/lib/lexers/asm.tes index 816a7e2..7fe8dad 100644 --- a/lib/lexers/asm.tes +++ b/lib/lexers/asm.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.asm]{ :EN*.asmQ* diff --git a/lib/lexers/ave.tes b/lib/lexers/ave.tes index 81b72b2..def268c 100644 --- a/lib/lexers/ave.tes +++ b/lib/lexers/ave.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.ave]{ :EN*.aveQ* diff --git a/lib/lexers/avs.tes b/lib/lexers/avs.tes index 935ba90..1c3b4d3 100644 --- a/lib/lexers/avs.tes +++ b/lib/lexers/avs.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.avs]{ :EN*.avsQ*"S -1 ' diff --git a/lib/lexers/awk.tes b/lib/lexers/awk.tes index 75cf3f0..fd85d4c 100644 --- a/lib/lexers/awk.tes +++ b/lib/lexers/awk.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.awk]{ :EN*.awkQ* diff --git a/lib/lexers/baan.tes b/lib/lexers/baan.tes index 87634ca..3e827c6 100644 --- a/lib/lexers/baan.tes +++ b/lib/lexers/baan.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.baan]{ :EN*.bcQ*"S -1 ' diff --git a/lib/lexers/bash.tes b/lib/lexers/bash.tes index 33d6664..862a0c1 100644 --- a/lib/lexers/bash.tes +++ b/lib/lexers/bash.tes @@ -1,6 +1,8 @@ -! Unix Shell - It's called bash.tes only because SciTE calls it this way - internally ! +!* + * Unix Shell + * It's called bash.tes only because SciTE calls it this way + * internally + *! @[lexer.test.bash]{ _#!M[sh,bash,ksh]:M[lexer.checkheader]"S -1 ' @@ -35,8 +37,8 @@ :M[color.string],5M[color.set] :M[color.string],6M[color.set] :M[color.operator],7M[color.set] - :M[color.target],8M[color.set] ! Identifiers, e.g. FOO=... ! + :M[color.target],8M[color.set] !* Identifiers, e.g. FOO=... *! :M[color.variable],9M[color.set] :M[color.variable],10M[color.set] - :M[color.string2],11M[color.set] ! Backticks ! + :M[color.string2],11M[color.set] !* Backticks *! } diff --git a/lib/lexers/batch.tes b/lib/lexers/batch.tes index a3a2a80..dddd802 100644 --- a/lib/lexers/batch.tes +++ b/lib/lexers/batch.tes @@ -1,4 +1,4 @@ -! DOS, Windows, OS/2 Batch Files ! +!* DOS, Windows, OS/2 Batch Files *! @[lexer.test.batch]{ :EN*.batQ*"S -1 ' @@ -15,9 +15,9 @@ color copy defined else not start :M[color.comment],1M[color.set] :M[color.keyword],2M[color.set] - :M[color.target],3M[color.set] ! Labels ! - :M[color.preproc],4M[color.set] ! Hide Cmd @ ! - :M[color.preproc2],5M[color.set] ! External Cmd ! + :M[color.target],3M[color.set] !* Labels *! + :M[color.preproc],4M[color.set] !* Hide Cmd @ *! + :M[color.preproc2],5M[color.set] !* External Cmd *! :M[color.variable],6M[color.set] :M[color.operator],7M[color.set] } diff --git a/lib/lexers/blitzbasic.tes b/lib/lexers/blitzbasic.tes index fee1f96..88f99f9 100644 --- a/lib/lexers/blitzbasic.tes +++ b/lib/lexers/blitzbasic.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.blitzbasic]{ :EN*.bbQ* diff --git a/lib/lexers/c.tes b/lib/lexers/c.tes index 7ed79d2..c0acea2 100644 --- a/lib/lexers/c.tes +++ b/lib/lexers/c.tes @@ -41,7 +41,7 @@ 0ESSETKEYWORDS Q[lexer.c.basekeywords] _Alignas _Alignof _Atomic _Bool _Complex _Generic _Imaginary _Noreturn _Static_assert _Thread_local - ! Doxygen keywords ! + !* Doxygen keywords *! 2ESSETKEYWORDSQ[lexer.c.doxygenkeywords] :M[color.comment],1M[color.set] :M[color.comment],2M[color.set] diff --git a/lib/lexers/caml.tes b/lib/lexers/caml.tes index 0b681a1..3735eee 100644 --- a/lib/lexers/caml.tes +++ b/lib/lexers/caml.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.caml]{ :EN*.mlQ*"S -1 ' diff --git a/lib/lexers/ch.tes b/lib/lexers/ch.tes index b0a1f4d..ea33b2c 100644 --- a/lib/lexers/ch.tes +++ b/lib/lexers/ch.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.ch]{ :EN*.chQ*"S -1 ' diff --git a/lib/lexers/cmake.tes b/lib/lexers/cmake.tes index 3b7c5f7..198ad32 100644 --- a/lib/lexers/cmake.tes +++ b/lib/lexers/cmake.tes @@ -1,4 +1,4 @@ -! CMake Lexing ! +!* CMake Lexing *! @[lexer.test.cmake]{ :EN*/CMakeLists.txtQ*"S -1 ' @@ -8,7 +8,7 @@ @[lexer.set.cmake]{ ESSETILEXERcmake - ! Commands ! + !* Commands *! 0ESSETKEYWORDS add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory build_command @@ -25,7 +25,7 @@ site_name source_group string subdir_depends subdirs target_link_libraries try_compile try_run use_mangled_mesa utility_source variable_requires vtk_make_instantiator vtk_wrap_java vtk_wrap_python vtk_wrap_tcl while write_file - ! Special command arguments ! + !* Special command arguments *! 1ESSETKEYWORDS ABSOLUTE ABSTRACT ADDITIONAL_MAKE_CLEAN_FILES ALL AND APPEND ARGS ASCII BEFORE CACHE CACHE_VARIABLES CLEAR COMMAND COMMANDS COMMAND_NAME COMMENT COMPARE diff --git a/lib/lexers/cobol.tes b/lib/lexers/cobol.tes index 7d9b6cb..921d948 100644 --- a/lib/lexers/cobol.tes +++ b/lib/lexers/cobol.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.cobol]{ :EN*.cobQ* diff --git a/lib/lexers/cpp.tes b/lib/lexers/cpp.tes index 5c3ce4a..0f6a01a 100644 --- a/lib/lexers/cpp.tes +++ b/lib/lexers/cpp.tes @@ -12,7 +12,7 @@ :EN*.hppQ*"S -1 ' :EN*.hxxQ*"S -1 ' :EN*.ippQ*"S -1 ' - !*:EN*.mmQ*"S -1 '*! + !!:EN*.mmQ*"S -1 ' :EN*.smaQ*"S -1 ' :EN*.inoQ* } @@ -25,7 +25,7 @@ explicit export friend mutable namespace new not not_eq operator or or_eq private protected public reinterpret_cast static_cast template this throw try typeid typename using virtual xor xor_eq - ! Doxygen keywords ! + !* Doxygen keywords *! 2ESSETKEYWORDSQ[lexer.c.doxygenkeywords] :M[color.comment],1M[color.set] :M[color.comment],2M[color.set] diff --git a/lib/lexers/cs.tes b/lib/lexers/cs.tes index 592332a..1721130 100644 --- a/lib/lexers/cs.tes +++ b/lib/lexers/cs.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.cs]{ :EN*.csQ* diff --git a/lib/lexers/d.tes b/lib/lexers/d.tes index 9a00fc9..b0f310a 100644 --- a/lib/lexers/d.tes +++ b/lib/lexers/d.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.d]{ :EN*.dQ* diff --git a/lib/lexers/diff.tes b/lib/lexers/diff.tes index a254f49..db658b4 100644 --- a/lib/lexers/diff.tes +++ b/lib/lexers/diff.tes @@ -1,4 +1,4 @@ -! Patch/Diff Files ! +!* Patch/Diff Files *! @[lexer.test.diff]{ :EN*.diffQ*"S -1 ' @@ -8,9 +8,9 @@ @[lexer.set.diff]{ ESSETILEXERdiff :M[color.comment],1M[color.set] - :M[color.keyword],2M[color.set] ! Command ! - :M[color.preproc],3M[color.set] ! Source/Dest ! - :M[color.operator],4M[color.set] ! Position @@ ! + :M[color.keyword],2M[color.set] !* Command *! + :M[color.preproc],3M[color.set] !* Source/Dest *! + :M[color.operator],4M[color.set] !* Position @@ *! :M[color.deletion],5M[color.set] :M[color.addition],6M[color.set] :M[color.change],7M[color.set] diff --git a/lib/lexers/docbook.tes b/lib/lexers/docbook.tes index ea60702..e5f3687 100644 --- a/lib/lexers/docbook.tes +++ b/lib/lexers/docbook.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.docbook]{ :EN*.docbookQ* diff --git a/lib/lexers/eiffel.tes b/lib/lexers/eiffel.tes index c22f5df..a932588 100644 --- a/lib/lexers/eiffel.tes +++ b/lib/lexers/eiffel.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.eiffel]{ :EN*.eQ* diff --git a/lib/lexers/f77.tes b/lib/lexers/f77.tes index e06243c..83feb85 100644 --- a/lib/lexers/f77.tes +++ b/lib/lexers/f77.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.f77]{ :EN*.fQ*"S -1 ' diff --git a/lib/lexers/f95.tes b/lib/lexers/f95.tes index 7544375..5c9e2c3 100644 --- a/lib/lexers/f95.tes +++ b/lib/lexers/f95.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.f95]{ :EN*.f90Q*"S -1 ' diff --git a/lib/lexers/flagship.tes b/lib/lexers/flagship.tes index 485d351..66a7c92 100644 --- a/lib/lexers/flagship.tes +++ b/lib/lexers/flagship.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.flagship]{ :EN*.prgQ* diff --git a/lib/lexers/flash.tes b/lib/lexers/flash.tes index 27be2bf..6464254 100644 --- a/lib/lexers/flash.tes +++ b/lib/lexers/flash.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.flash]{ :EN*.asQ*"S -1 ' diff --git a/lib/lexers/freebasic.tes b/lib/lexers/freebasic.tes index 16b7ace..c333c55 100644 --- a/lib/lexers/freebasic.tes +++ b/lib/lexers/freebasic.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.freebasic]{ :EN*.basQ*"S -1 ' diff --git a/lib/lexers/gap.tes b/lib/lexers/gap.tes index 7a680c7..cf3081b 100644 --- a/lib/lexers/gap.tes +++ b/lib/lexers/gap.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.gap]{ :EN*.gQ*"S -1 ' diff --git a/lib/lexers/git.tes b/lib/lexers/git.tes index 567859b..d4c3aa2 100644 --- a/lib/lexers/git.tes +++ b/lib/lexers/git.tes @@ -1,4 +1,9 @@ -!* Git commit and rebase messages *! +!* + * Git commit and rebase messages + * + * NOTE: This is not a real lexer. + * It only styles the document once. + *! @[lexer.test.git]{ :EN*/COMMIT_EDITMSGQ*"S -1 ' diff --git a/lib/lexers/go.tes b/lib/lexers/go.tes index a637b5c..319af88 100644 --- a/lib/lexers/go.tes +++ b/lib/lexers/go.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.go]{ :EN*.goQ* diff --git a/lib/lexers/idl.tes b/lib/lexers/idl.tes index 9180ae0..088b72a 100644 --- a/lib/lexers/idl.tes +++ b/lib/lexers/idl.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.idl]{ :EN*.idlQ*"S -1 ' diff --git a/lib/lexers/inno.tes b/lib/lexers/inno.tes index c963b1d..1d0b7eb 100644 --- a/lib/lexers/inno.tes +++ b/lib/lexers/inno.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.inno]{ :EN*.issQ*"S -1 ' diff --git a/lib/lexers/java.tes b/lib/lexers/java.tes index a9a592a..1462a51 100644 --- a/lib/lexers/java.tes +++ b/lib/lexers/java.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.java]{ :EN*.javaQ*"S -1 ' diff --git a/lib/lexers/js.tes b/lib/lexers/js.tes index 3e8ed8e..75bb500 100644 --- a/lib/lexers/js.tes +++ b/lib/lexers/js.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.js]{ :EN*.jsQ*"S -1 ' diff --git a/lib/lexers/kix.tes b/lib/lexers/kix.tes index f63b5c5..0030c66 100644 --- a/lib/lexers/kix.tes +++ b/lib/lexers/kix.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.kix]{ :EN*.kixQ* diff --git a/lib/lexers/lisp.tes b/lib/lexers/lisp.tes index c17196a..60ce61c 100644 --- a/lib/lexers/lisp.tes +++ b/lib/lexers/lisp.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.lisp]{ :EN*.lspQ*"S -1 ' diff --git a/lib/lexers/lout.tes b/lib/lexers/lout.tes index cb161b7..baa4e71 100644 --- a/lib/lexers/lout.tes +++ b/lib/lexers/lout.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.lout]{ :EN*.ltQ* @@ -23,7 +23,7 @@ @SysPrependGraphic @Target @Null @PageLabel @Galley @ForceGalley @LInput @Split @Tag @Key @Optimize @Merge @Enclose @Begin @End @Moment @Second @Minute @Hour @Day @Month @Year @Century @WeekDay @YearDay @DaylightSaving @SetContext @GetContext - ! NOTE: carets are doubled to escape them ! + !* NOTE: carets are doubled to escape them *! 1ESSETKEYWORDS &&& && & ^^// ^^/ ^^|| ^^| ^^& // / || | 2ESSETKEYWORDS diff --git a/lib/lexers/lua.tes b/lib/lexers/lua.tes index 7ffe54a..0cf898a 100644 --- a/lib/lexers/lua.tes +++ b/lib/lexers/lua.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.lua]{ _#!Mlua:M[lexer.checkheader]"S -1 ' diff --git a/lib/lexers/make.tes b/lib/lexers/make.tes index 2e1d661..4ff519a 100644 --- a/lib/lexers/make.tes +++ b/lib/lexers/make.tes @@ -1,4 +1,4 @@ -! Makefile Lexing ! +!* Makefile Lexing *! @[lexer.test.make]{ :EN*/MakefileQ*"S -1 ' diff --git a/lib/lexers/mako.tes b/lib/lexers/mako.tes index 5cbf9fd..b38ee13 100644 --- a/lib/lexers/mako.tes +++ b/lib/lexers/mako.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.mako]{ :EN*.makQ*"S -1 ' diff --git a/lib/lexers/matlab.tes b/lib/lexers/matlab.tes index d63a6f8..c8dc44d 100644 --- a/lib/lexers/matlab.tes +++ b/lib/lexers/matlab.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.matlab]{ :EN*.m.matlabQ* diff --git a/lib/lexers/mmixal.tes b/lib/lexers/mmixal.tes index 7f7df43..e9047cb 100644 --- a/lib/lexers/mmixal.tes +++ b/lib/lexers/mmixal.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.mmixal]{ :EN*.mmsQ* diff --git a/lib/lexers/octave.tes b/lib/lexers/octave.tes index 2df769a..41c0563 100644 --- a/lib/lexers/octave.tes +++ b/lib/lexers/octave.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.octave]{ :EN*.m.octaveQ* diff --git a/lib/lexers/oscript.tes b/lib/lexers/oscript.tes index 949e564..d4f2eb8 100644 --- a/lib/lexers/oscript.tes +++ b/lib/lexers/oscript.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.oscript]{ :EN*.osxQ* diff --git a/lib/lexers/pascal.tes b/lib/lexers/pascal.tes index 66e705c..57bd3e8 100644 --- a/lib/lexers/pascal.tes +++ b/lib/lexers/pascal.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.pascal]{ :EN*.dprQ*"S -1 ' diff --git a/lib/lexers/perl.tes b/lib/lexers/perl.tes index 213dd4b..44d7148 100644 --- a/lib/lexers/perl.tes +++ b/lib/lexers/perl.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.perl]{ _#!M[perl,pl]:M[lexer.checkheader]"S -1 ' diff --git a/lib/lexers/php.tes b/lib/lexers/php.tes index e60c769..7265408 100644 --- a/lib/lexers/php.tes +++ b/lib/lexers/php.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.php]{ :EN*.php3Q*"S -1 ' diff --git a/lib/lexers/pike.tes b/lib/lexers/pike.tes index 9686fe2..c530622 100644 --- a/lib/lexers/pike.tes +++ b/lib/lexers/pike.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.pike]{ :EN*.pikeQ* diff --git a/lib/lexers/pov.tes b/lib/lexers/pov.tes index 257ce19..90fe0f8 100644 --- a/lib/lexers/pov.tes +++ b/lib/lexers/pov.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.pov]{ :EN*.povQ*"S -1 ' diff --git a/lib/lexers/powerpro.tes b/lib/lexers/powerpro.tes index e487604..fac1ef8 100644 --- a/lib/lexers/powerpro.tes +++ b/lib/lexers/powerpro.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.powerpro]{ :EN*.powerproQ* diff --git a/lib/lexers/purebasic.tes b/lib/lexers/purebasic.tes index e9e20a7..6f98975 100644 --- a/lib/lexers/purebasic.tes +++ b/lib/lexers/purebasic.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.purebasic]{ :EN*.pbQ* diff --git a/lib/lexers/r.tes b/lib/lexers/r.tes index 9fb393e..5ecaa86 100644 --- a/lib/lexers/r.tes +++ b/lib/lexers/r.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.r]{ :EN*.RQ*"S -1 ' diff --git a/lib/lexers/rc.tes b/lib/lexers/rc.tes index db2203d..132f9c9 100644 --- a/lib/lexers/rc.tes +++ b/lib/lexers/rc.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.rc]{ :EN*.rcQ*"S -1 ' diff --git a/lib/lexers/rebol.tes b/lib/lexers/rebol.tes index cef071c..1a310bb 100644 --- a/lib/lexers/rebol.tes +++ b/lib/lexers/rebol.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.rebol]{ :EN*.rQ*"S -1 ' diff --git a/lib/lexers/rust.tes b/lib/lexers/rust.tes index 4ffd9b5..06a0154 100644 --- a/lib/lexers/rust.tes +++ b/lib/lexers/rust.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.rust]{ :EN*.rsQ* diff --git a/lib/lexers/scheme.tes b/lib/lexers/scheme.tes index 31af808..3f5e8fe 100644 --- a/lib/lexers/scheme.tes +++ b/lib/lexers/scheme.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.scheme]{ :EN*.scmQ*"S -1 ' diff --git a/lib/lexers/sciteco.tes b/lib/lexers/sciteco.tes index b611875..106c12b 100644 --- a/lib/lexers/sciteco.tes +++ b/lib/lexers/sciteco.tes @@ -11,10 +11,11 @@ 1ESSETIDENTIFIER :M[color.keyword],1M[color.set] :M[color.operator],2M[color.set] - !*:M[color.variable],3M[color.set]*! + !!:M[color.variable],3M[color.set] :M[color.string],4M[color.set] :M[color.number],5M[color.set] - :M[color.comment],6M[color.set] !* labels *! + :M[color.preproc],6M[color.set] !* labels *! :M[color.comment],7M[color.set] + !* invalid commands or byte sequences *! :M[color.error],8M[color.set] } diff --git a/lib/lexers/specman.tes b/lib/lexers/specman.tes index 3d83590..0710679 100644 --- a/lib/lexers/specman.tes +++ b/lib/lexers/specman.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.specman]{ :EN*.eQ* diff --git a/lib/lexers/spice.tes b/lib/lexers/spice.tes index 5178d01..8883239 100644 --- a/lib/lexers/spice.tes +++ b/lib/lexers/spice.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.spice]{ :EN*.scpQ*"S -1 ' diff --git a/lib/lexers/swift.tes b/lib/lexers/swift.tes index 4a20509..a2466c9 100644 --- a/lib/lexers/swift.tes +++ b/lib/lexers/swift.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.swift]{ :EN*.swiftQ* diff --git a/lib/lexers/systemverilog.tes b/lib/lexers/systemverilog.tes index 3df1225..4edbde1 100644 --- a/lib/lexers/systemverilog.tes +++ b/lib/lexers/systemverilog.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.systemverilog]{ :EN*.svQ*"S -1 ' diff --git a/lib/lexers/tacl.tes b/lib/lexers/tacl.tes index a0d5bc9..faa9e3d 100644 --- a/lib/lexers/tacl.tes +++ b/lib/lexers/tacl.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.tacl]{ :EN*.taclQ* diff --git a/lib/lexers/tal.tes b/lib/lexers/tal.tes index 247c451..8dc56a4 100644 --- a/lib/lexers/tal.tes +++ b/lib/lexers/tal.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.tal]{ :EN*.talQ* diff --git a/lib/lexers/tcl.tes b/lib/lexers/tcl.tes index d5fd022..102cb11 100644 --- a/lib/lexers/tcl.tes +++ b/lib/lexers/tcl.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.tcl]{ :EN*.tclQ*"S -1 ' diff --git a/lib/lexers/test.tes b/lib/lexers/test.tes index cc719db..adac64f 100644 --- a/lib/lexers/test.tes +++ b/lib/lexers/test.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.test]{ :EN*.plnQ*"S -1 ' diff --git a/lib/lexers/troff.tes b/lib/lexers/troff.tes index a10d3e9..fe8063f 100644 --- a/lib/lexers/troff.tes +++ b/lib/lexers/troff.tes @@ -69,8 +69,10 @@ 2ESSETKEYWORDSel nop !* Requests and commands, initiating ignore blocks *! 3ESSETKEYWORDSig - !* Requests and commands with end-macros. - Mom macros alias MAC to de. *! + !* + * Requests and commands with end-macros. + * Mom macros alias MAC to de. + *! 4ESSETKEYWORDSam am1 de de1 MAC :M[color.keyword],1M[color.set] @@ -79,7 +81,7 @@ :M[color.operator],4M[color.set] :M[color.string],5M[color.set] :M[color.comment],6M[color.set] - !*:M[color.comment],7M[color.set]*! + !!:M[color.comment],7M[color.set] 7U.i 20<:M[color.variable],%.iM[color.set]> :M[color.preproc2],17M[color.set] } diff --git a/lib/lexers/vala.tes b/lib/lexers/vala.tes index 85b9ceb..d5329d2 100644 --- a/lib/lexers/vala.tes +++ b/lib/lexers/vala.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.vala]{ :EN*.valaQ* diff --git a/lib/lexers/vb.tes b/lib/lexers/vb.tes index c37752b..8bb82fb 100644 --- a/lib/lexers/vb.tes +++ b/lib/lexers/vb.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.vb]{ :EN*.vbQ*"S -1 ' diff --git a/lib/lexers/verilog.tes b/lib/lexers/verilog.tes index 23f874f..f8fea22 100644 --- a/lib/lexers/verilog.tes +++ b/lib/lexers/verilog.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.verilog]{ :EN*.vQ*"S -1 ' diff --git a/lib/lexers/vhdl.tes b/lib/lexers/vhdl.tes index 37fe9bf..a13ba71 100644 --- a/lib/lexers/vhdl.tes +++ b/lib/lexers/vhdl.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.vhdl]{ :EN*.vhdQ*"S -1 ' diff --git a/lib/lexers/vxml.tes b/lib/lexers/vxml.tes index 60dc060..c044824 100644 --- a/lib/lexers/vxml.tes +++ b/lib/lexers/vxml.tes @@ -1,4 +1,4 @@ -! AUTO-GENERATED FROM SCITE PROPERTY SET ! +!* AUTO-GENERATED FROM SCITE PROPERTY SET *! @[lexer.test.vxml]{ :EN*.vxmlQ* diff --git a/lib/lexers/xml.tes b/lib/lexers/xml.tes index 87ed9b7..081c2ec 100644 --- a/lib/lexers/xml.tes +++ b/lib/lexers/xml.tes @@ -1,4 +1,4 @@ -! Lexing for XML and its applications ! +!* Lexing for XML and its applications *! @[lexer.test.xml]{ :EN*.xmlQ*"S -1 ' @@ -16,20 +16,20 @@ @[lexer.set.xml]{ ESSETILEXERxml 0ESSETKEYWORDS - ! DTD keywords ! + !* DTD keywords *! 5ESSETKEYWORDS ELEMENT DOCTYPE ATTLIST ENTITY NOTATION - :M[color.keyword],1M[color.set] ! Tags ! - :M[color.keyword],2M[color.set] ! Tags ! - :M[color.variable],3M[color.set] ! Attributes ! - :M[color.variable],4M[color.set] ! Attributes ! + :M[color.keyword],1M[color.set] !* Tags *! + :M[color.keyword],2M[color.set] !* Tags *! + :M[color.variable],3M[color.set] !* Attributes *! + :M[color.variable],4M[color.set] !* Attributes *! :M[color.number],5M[color.set] :M[color.string],6M[color.set] :M[color.string],7M[color.set] :M[color.comment],9M[color.set] - :M[color.preproc],10M[color.set] ! Entities ! - :M[color.keyword],11M[color.set] ! Tag Ends /> ! - :M[color.preproc2],12M[color.set] ! PI ! - :M[color.preproc2],13M[color.set] ! PI ! - :M[color.string2],14M[color.set] ! CDATA ! + :M[color.preproc],10M[color.set] !* Entities *! + :M[color.keyword],11M[color.set] !* Tag Ends /> *! + :M[color.preproc2],12M[color.set] !* PI *! + :M[color.preproc2],13M[color.set] !* PI *! + :M[color.string2],14M[color.set] !* CDATA *! } diff --git a/lib/session.tes b/lib/session.tes Binary files differindex 56634a5..f3df351 100644 --- a/lib/session.tes +++ b/lib/session.tes diff --git a/lib/string.tes b/lib/string.tes index e6ec4a1..fe049a9 100644 --- a/lib/string.tes +++ b/lib/string.tes @@ -1,7 +1,9 @@ -! String utility macros ! +!* String utility macros *! -! <pos1,pos2>M[symcasecmp] - Compare symbol at pos1 with symbol at pos2 (caseless) - this case-folds to lower case so "_"<"A" which is compatible with g_ascii_strcasecmp() ! +!* + * <pos1,pos2>M[symcasecmp] - Compare symbol at pos1 with symbol at pos2 (caseless) + * this case-folds to lower case so "_"<"A" which is compatible with g_ascii_strcasecmp() + *! @[symcasecmp]{ U.2U.1 -.%.1 -.%.2 @.#lo{ @@ -13,7 +15,7 @@ Q.c } -! <i,j>M[exchange] - Exchange line at I with line at J (I < J), returning new J ! +!* <i,j>M[exchange] - Exchange line at I with line at J (I < J), returning new J *! @[exchange]{ U.jU.i Q.jJ @X.x @@ -22,7 +24,7 @@ Q.j } -! <i,j>M[qsort] - Sort lines beginning at I until J using Quicksort algorithm ! +!* <i,j>M[qsort] - Sort lines beginning at I until J using Quicksort algorithm *! @[qsort]{ U.rU.l diff --git a/sample.teco_ini b/sample.teco_ini index 2935d95..02c8bcb 100644 --- a/sample.teco_ini +++ b/sample.teco_ini @@ -1,18 +1,18 @@ -! TECO.INI ! +!* TECO.INI *! -! Set default terminal color scheme ! +!* Set default terminal color scheme *! EMQ[$SCITECOPATH]/color.tes :EMQ[$SCITECOPATH]/colors/terminal.tes -! Load lexer and buffer session libraries ! +!* Load lexer and buffer session libraries *! EMQ[$SCITECOPATH]/lexer.tes EMQ[$SCITECOPATH]/session.tes -! Automatic lexing and session management using ED hooks ! +!* Automatic lexing and session management using ED hooks *! @#ED{ Oadd,edit,close,quit !add! - ! Add code here to execute when a document is added ! + !* Add code here to execute when a document is added *! :Q*+1Oedit 32,0ED @@ -21,7 +21,7 @@ EMQ[$SCITECOPATH]/session.tes M[lexer.auto] - ! Set up margins ! + !* Set up margins *! [_:M[lexer.test.woman]]_"F 33ESTEXTWIDTH9U.w 5*Q.w,0ESSETMARGINWIDTHN @@ -29,52 +29,58 @@ EMQ[$SCITECOPATH]/session.tes ' 0,32ED - ! fall through ! + !* fall through *! !edit! - ! Add code here to execute when a document is edited ! + !* Add code here to execute when a document is edited *! ESGETCOLUMN,4EJ !close! - ! Add code here to execute when a document is closed ! + !* Add code here to execute when a document is closed *! !quit! - ! Add code here to execute when SciTECO quits ! + !* Add code here to execute when SciTECO quits *! M[session.save] } 0,32ED -! Uncomment to enable automatic case folding ! -! 0,8ED ! +!* Uncomment to enable automatic case folding *! +!!0,8ED -! Tweak the default font name and size. - The size unit is 1pt/100 ! -! [lexer.font]Monospace 1300U[lexer.font] ! +!* + * Tweak the default font name and size. + * The size unit is 1pt/100 + *! +!![lexer.font]Monospace 1300U[lexer.font] -! Enable default function key macros ! +!* Enable default function key macros *! EMQ[$SCITECOPATH]/fnkeys.tes -! Uncomment if terminal supports OSC-52 clipboards ! -! 0,256ED ! +!* Uncomment if terminal supports OSC-52 clipboards *! +!!0,256ED -! Uncomment to enable Unicode icons in the Curses UI ! -! 0,512ED ! +!* Uncomment to enable Unicode icons in the Curses UI *! +!!0,512ED -! Uncomment to tweak the memory limit ! -! 500*1000*1000,2EJ ! +!* Uncomment to tweak the memory limit *! +!!500*1000*1000,2EJ -! If files are given on the command-line, open them - and disable session saving. - Otherwise open a buffer session. ! +!* + * If files are given on the command-line, open them + * and disable session saving. + * Otherwise open a buffer session. + *! Z"= - ! Uncomment to use a separate session per VCS repository or - working copy (see session.tes): ! - ! M[session.vcs] ! + !* + * Uncomment to use a separate session per VCS repository or + * working copy (see session.tes): + *! + !!M[session.vcs] M[session.load] | - [session.path] ! disables session saving ! + [session.path] !* disables session saving *! [.f <:L;R 0X.f [* EBN.f ]* L> ].f diff --git a/src/goto-commands.c b/src/goto-commands.c index 2144fb0..2035277 100644 --- a/src/goto-commands.c +++ b/src/goto-commands.c @@ -33,6 +33,9 @@ #include "goto.h" #include "goto-commands.h" +TECO_DECLARE_STATE(teco_state_blockcomment); +TECO_DECLARE_STATE(teco_state_eolcomment); + teco_string_t teco_goto_skip_label = {NULL, 0}; static gboolean @@ -46,16 +49,18 @@ teco_state_label_initial(teco_machine_main_t *ctx, GError **error) * NOTE: The comma is theoretically not allowed in a label * (see <O> syntax), but is accepted anyway since labels * are historically used as comments. - * - * TODO: Add support for "true" comments of the form !* ... *! - * This would be almost trivial to implement, but if we don't - * want any (even temporary) overhead for comments at all, we need - * to add a new parser state. - * I'm unsure whether !-signs should be allowed within comments. + * SciTECO has true block and EOL comments, though as well. */ static teco_state_t * teco_state_label_input(teco_machine_main_t *ctx, gunichar chr, GError **error) { + if (!ctx->goto_label.len) { + switch (chr) { + case '*': return &teco_state_blockcomment; /* `!*` */ + case '!': return &teco_state_eolcomment; /* `!!` */ + } + } + if (chr == '!') { /* * NOTE: If the label already existed, its PC will be restored @@ -84,6 +89,12 @@ teco_state_label_input(teco_machine_main_t *ctx, gunichar chr, GError **error) return &teco_state_start; } + /* + * The goto label is collected in parse-only mode as well + * since we could jump into a currently dead branch later. + * + * FIXME: Theoretically, we could avoid that at least in TECO_MODE_LEXING. + */ if (ctx->parent.must_undo) undo__teco_string_truncate(&ctx->goto_label, ctx->goto_label.len); teco_string_append_wc(&ctx->goto_label, chr); @@ -171,3 +182,40 @@ gboolean teco_state_goto_process_edit_cmd(teco_machine_main_t *ctx, teco_machine TECO_DEFINE_STATE_EXPECTSTRING(teco_state_goto, .process_edit_cmd_cb = (teco_state_process_edit_cmd_cb_t)teco_state_goto_process_edit_cmd ); + +/* + * True comments: + * They don't add entries to the goto table. + * + * NOTE: This still needs some special handling in the Scintilla lexer + * (for syntax highlighting) since comments always start with `!`. + */ +#define TECO_DEFINE_STATE_COMMENT(NAME, ...) \ + TECO_DEFINE_STATE(NAME, \ + .style = SCE_SCITECO_COMMENT, \ + ##__VA_ARGS__ \ + ) + +static teco_state_t * +teco_state_blockcomment_star_input(teco_machine_main_t *ctx, gunichar chr, GError **error) +{ + return chr == '!' ? &teco_state_start : &teco_state_blockcomment; +} + +TECO_DEFINE_STATE_COMMENT(teco_state_blockcomment_star); + +static teco_state_t * +teco_state_blockcomment_input(teco_machine_main_t *ctx, gunichar chr, GError **error) +{ + return chr == '*' ? &teco_state_blockcomment_star : &teco_state_blockcomment; +} + +TECO_DEFINE_STATE_COMMENT(teco_state_blockcomment); + +static teco_state_t * +teco_state_eolcomment_input(teco_machine_main_t *ctx, gunichar chr, GError **error) +{ + return chr == '\n' ? &teco_state_start : &teco_state_eolcomment; +} + +TECO_DEFINE_STATE_COMMENT(teco_state_eolcomment); diff --git a/src/lexer.c b/src/lexer.c index ff43c1b..c0c7847 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -19,6 +19,8 @@ #include "config.h" #endif +#include <string.h> + #include <glib.h> #include "sciteco.h" @@ -39,20 +41,12 @@ teco_lexer_getstyle(teco_view_t *view, teco_machine_main_t *machine, * FIXME: What about ^* and ^/? * They are currently highlighted as commands. */ - if (machine->parent.current->keymacro_mask & TECO_KEYMACRO_MASK_START) { - switch (chr) { - case '0'...'9': + if (machine->parent.current->keymacro_mask & TECO_KEYMACRO_MASK_START && + chr <= 0xFF) { + if (g_ascii_isdigit(chr)) style = SCE_SCITECO_NUMBER; - break; - case '+': - case '-': - case '*': - case '/': - case '#': - case '&': + else if (strchr("+-*/#&", chr)) style = SCE_SCITECO_OPERATOR; - break; - } } /* @@ -64,10 +58,7 @@ teco_lexer_getstyle(teco_view_t *view, teco_machine_main_t *machine, /* * Probably a syntax error, so the erroneous symbol * is highlighted and we reset the parser's state machine. - */ - style = SCE_SCITECO_INVALID; - - /* + * * FIXME: Perhaps we should simply reset the state to teco_state_start? */ gsize macro_pc = machine->macro_pc; @@ -75,9 +66,22 @@ teco_lexer_getstyle(teco_view_t *view, teco_machine_main_t *machine, teco_machine_main_init(machine, NULL, FALSE); machine->mode = TECO_MODE_LEXING; machine->macro_pc = macro_pc; - } else if (machine->parent.current->style == SCE_SCITECO_LABEL) { - /* don't highlight the leading `!` as SCE_SCITECO_COMMAND */ - style = SCE_SCITECO_LABEL; + + return SCE_SCITECO_INVALID; + } + + /* + * Don't highlight the leading `!` in comments as SCE_SCITECO_COMMAND. + * True comments also begin with `!`, so make sure they are highlighted + * already from the second character. + * This is then extended back by one character in teco_lexer_step(). + */ + switch (machine->parent.current->style) { + case SCE_SCITECO_COMMENT: + case SCE_SCITECO_LABEL: + return machine->parent.current->style; + default: + break; } return style; @@ -100,7 +104,7 @@ teco_lexer_step(teco_view_t *view, teco_machine_main_t *machine, return; } - gsize old_pc = machine->macro_pc; + gssize old_pc = machine->macro_pc; teco_style_t style = SCE_SCITECO_DEFAULT; @@ -140,6 +144,13 @@ teco_lexer_step(teco_view_t *view, teco_machine_main_t *machine, *cur_col += machine->macro_pc - old_pc; + /* + * True comments begin with `!*` or `!!`, but only the second character gets + * the correct style by default, so we extend it backwards. + */ + if (style == SCE_SCITECO_COMMENT) + old_pc--; + teco_view_ssm(view, SCI_STARTSTYLING, start+old_pc, 0); teco_view_ssm(view, SCI_SETSTYLING, machine->macro_pc-old_pc, style); |