From ef897b418a4487196e1dbc18a97046f8f0aea2e8 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 24 Dec 2024 13:29:32 +0300 Subject: 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. --- lib/colors/solarized.tes | 28 ++++++++++++++-------------- lib/colors/terminal.tes | 10 +++++----- 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'lib/colors') 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] ]* -- cgit v1.2.3