diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-12-24 13:29:32 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-12-24 13:29:32 +0300 |
commit | ef897b418a4487196e1dbc18a97046f8f0aea2e8 (patch) | |
tree | 264b026de6ce805f1bf371d1b01371c4ba1aed0c /lib/lexers/xml.tes | |
parent | e5d1253d363a209ecd1288278808e38ac87b34d9 (diff) | |
download | sciteco-ef897b418a4487196e1dbc18a97046f8f0aea2e8.tar.gz |
introduced true block and EOL comments
* The previous convention of !* ... *! are now true block comments,
i.e. they are parsed faster, don't spam the goto table and allow
embedding of exclamation marks - only "*!" terminates the comment.
* It is therefore now forbidden to have goto labels beginning with "*".
* Also support "!!" to introduce EOL comments (like C++'s //).
This disallows empty labels, but they weren't useful anyway.
This is the shortest way to begin a comment.
* All comment labels have been converted to true comments, to ensure
that syntax highlighting works correctly.
EOL comments are used for single line commented-out code, since it's
easiest to uncomment - you don't have to jump to the line end.
This is a pure convention / coding style.
Other people might do it differently.
* It's of course still possible to abuse goto labels as comments
as TECO did for ages.
* In lexing / syntax highlighting, labels and comments are highlighted differently.
* When syntax highlighting, a single "!" will first be highlighted as a label
since it's not yet unambiguous. Once you type the second character (* or !),
the first character is retroactively styled as a comment as well.
Diffstat (limited to 'lib/lexers/xml.tes')
-rw-r--r-- | lib/lexers/xml.tes | 22 |
1 files changed, 11 insertions, 11 deletions
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 *! } |