CodeSyntacticSugar object containing token types, token mappings, and line modifiers.
CodeSyntacticSugar
The main constants object exported by the library.Import
TokenTypes
Read-only array of all token type strings.readonly string[]
Values:
| Index | Token Type | Description |
|---|---|---|
| 0 | identifier | Variable names, function names |
| 1 | keyword | JavaScript keywords (if, const, function, etc.) |
| 2 | string | String literals |
| 3 | class | Class names, numbers, and null |
| 4 | property | Object properties |
| 5 | entity | Special entities |
| 6 | jsxliterals | JSX literal values |
| 7 | sign | Operators and punctuation |
| 8 | comment | Comments |
| 9 | break | Line breaks |
| 10 | space | Whitespace |
TokenMap
Map from token type strings to their numeric indices.Map<string, number>
Mapping:
Value:
0 - Maps to identifier tokensValue:
1 - Maps to keyword tokensValue:
2 - Maps to string literal tokensValue:
3 - Maps to class names, numbers, and nullValue:
4 - Maps to object property tokensValue:
5 - Maps to special entity tokensValue:
6 - Maps to JSX literal tokensValue:
7 - Maps to operator and punctuation tokensValue:
8 - Maps to comment tokensValue:
9 - Maps to line break tokensValue:
10 - Maps to whitespace tokensLineModifiers
Read-only array of available line modifier names.readonly string[]
Values:
Modifier name for highlighting lines. Used as
"highlighted-line" in the UI.Modifier name for marking lines as added. Used as
"added-line" in the UI, typically shown with a green background.Modifier name for marking lines as removed. Used as
"removed-line" in the UI, typically shown with a red background.Internal Constants
The following constants are used internally by the library but are not exported from the mainCodeSyntacticSugar object.