From e0bf13622b0922252439e3fa8b43df9877678d75 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 25 Oct 2026 02:39:11 +0100 Subject: numbers are separate parser states and there are syntactic octal and hexadecimal constants now * Instead of every digit being a stack-modifying standalone command, there is a single continuous parser state (teco_state_number) now - even though it has certain unique characteristics. They are consequently documented in the ARITHMETICS AND EXPRESSIONS chapter of sciteco(7). * A number will therefore be rubbed out entirely by CTRL+W, including a possible @-modifier. * (!) Spaces within constants are no longer ignored, but will push separate numbers to the stack instead (`1 2 3` pushes 3 numbers). The significance of the `,` operator is thus further reduced. * (!) You can no longer "append" to numbers on the stack as in `Qa001` - this was never actually used and caused more confusion. * (!) Digits outside the current radix are no longer accepted. E.g. digit 2 after `2^R`. This feature was also never used. * (!) Octal constants are supported with leading zeros as in C. This works regardless of the current radix set via `8^R` or `^O`. It remains to see whether this is actually useful or is rather annoying (since every constant beginning with 0 is automatically octal, you cannot left-pad arbitrary numbers with 0). * Hexadecimal constants are supported by at-modifying them as in `@0ff`. They must still begin with a digit 0-9 and since A-F are valid SciTECO commands, you may need additional spaces to separate hexadecimal constants from regular commands as in `@0ff D`. During syntax highlighting the number style is extended back to the at-sign. Note: Hexadecimal constants couldn't have been realized via `16^R` (or some shortcut) since that depends on runtime state, but we must know during parsing whether symbols A-F are part of the number of regular SciTECO commands. * The new hexadecimal constants are used in the color schemes now. Thanks to them, we no longer need workarounds like the "color.rgb" macro. * Since numbers don't have a dedicated terminator character, but any letter may terminate it, the number state must behave similar to a start state. Consequently, hexadecimal constants will currently be auto-case-folded if you enabled this feature. I recommend not to write hex constants in upper-case, though. Perhaps this should be worked around with a custom process_edit_cmd() callback. * Test suite updated --- lib/colors/solarized.tes | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'lib/colors/solarized.tes') diff --git a/lib/colors/solarized.tes b/lib/colors/solarized.tes index aeb9cb9..529df74 100644 --- a/lib/colors/solarized.tes +++ b/lib/colors/solarized.tes @@ -19,22 +19,22 @@ *! 0,3EJ -1,-1,7EJ !* no palette & no default colors *! -000,043,054:M[color.rgb]U[color.base03] -007,054,066:M[color.rgb]U[color.base02] -088,110,117:M[color.rgb]U[color.base01] -101,123,131:M[color.rgb]U[color.base00] -131,148,150:M[color.rgb]U[color.base0] -147,161,161:M[color.rgb]U[color.base1] -238,232,213:M[color.rgb]U[color.base2] -253,246,227:M[color.rgb]U[color.base3] -181,137,000:M[color.rgb]U[color.yellow] -203,075,022:M[color.rgb]U[color.orange] -220,050,047:M[color.rgb]U[color.red] -211,054,130:M[color.rgb]U[color.magenta] -108,113,196:M[color.rgb]U[color.violet] -038,139,210:M[color.rgb]U[color.blue] -042,161,152:M[color.rgb]U[color.cyan] -133,153,000:M[color.rgb]U[color.green] +@0362b00U[color.base03] +@0423607U[color.base02] +@0756e58U[color.base01] +@0837b65U[color.base00] +@0969483U[color.base0] +@0a1a193U[color.base1] +@0d5e8eeU[color.base2] +@0e3f6fdU[color.base3] +@00089b5U[color.yellow] +@0164bcbU[color.orange] +@02f32dcU[color.red] +@08236d3U[color.magenta] +@0c4716cU[color.violet] +@0d28b26U[color.blue] +@098a12aU[color.cyan] +@0009985U[color.green] :Q[solarized.light]"< 0U[solarized.light] ' @[solarized.light]{ -- cgit v1.2.3