working on syntax highlighting. basic prototype working

This commit is contained in:
Matt Nish-Lapidus 2024-05-23 10:57:35 -04:00
parent a3bf799e87
commit 29ee46c071
4 changed files with 38 additions and 37 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules
.DS_Store

View File

@ -250,17 +250,16 @@ reserved<term> { @specialize[@name={term}]<Word, term> }
silent<term> { @specialize<Word, term> }
Keyword { ":" Word }
Boolean { reserved<"true"> | reserved<"false"> }
Nil { silent<"nil"> }
@tokens {
Word { $[a-z] $[a-zA-Z_\-?/!]* }
space { $[ \t\r]+ }
Keyword { ":" Word }
Comment { "&" ![\n]* }
String { '"' (!["\\] | "\\" _)* '"' }
space { $[ \t\r]+ }
int { $[1-9]$[0-9]* | "0" }
float { ("0" | int ) "." $[0-9]+}
Number { "-"? (int | float) }

File diff suppressed because one or more lines are too long

View File

@ -1,18 +1,18 @@
// This file was generated by lezer-generator. You probably shouldn't edit it.
export const
Script = 1,
Boolean = 2,
Word = 3,
Nil = 6,
String = 7,
Number = 8,
Keyword = 9,
Tuple = 10,
List = 11,
Splat = 12,
Set = 13,
Dict = 14,
Struct = 15,
Comment = 1,
Script = 2,
Boolean = 3,
Word = 4,
Nil = 7,
String = 8,
Number = 9,
Keyword = 10,
Tuple = 11,
List = 12,
Splat = 13,
Set = 14,
Dict = 15,
Synthetic = 16,
Args = 17,
Placeholder = 18,
@ -22,9 +22,9 @@ export const
Pattern = 22,
List_Pattern = 23,
Splattern = 24,
Dict_Pattern = 25,
Assoc_Pattern = 26,
Struct_Pattern = 27,
Ignored = 25,
Dict_Pattern = 26,
Assoc_Pattern = 27,
Recur = 28,
Block = 29,
If = 30,
@ -34,14 +34,15 @@ export const
Else = 34,
When = 35,
When_Clause = 36,
Loop = 37,
Fn_Clauses = 38,
Repeat = 39,
Each = 40,
Do = 37,
Loop = 38,
Fn_Clauses = 39,
Repeat = 40,
Let = 41,
Ref = 42,
Fn_Named = 43,
Fn_Compound = 44,
Import = 45,
Use = 46,
Ns = 47
Ns = 47,
Test = 48