This commit is contained in:
Scott Richmond 2023-11-27 01:11:01 -05:00
parent 2bec60f608
commit 6f67fe0b40
2 changed files with 14 additions and 44 deletions

View File

@ -4,18 +4,9 @@
line { (expression | toplevel) terminator+ } line { (expression | toplevel) terminator+ }
toplevel { toplevel { Import | Use | Ns }
Import
| Use
| Ns
}
Import { Import { skw<"import"> String skw<"as"> Word }
skw<"import">
String
skw<"as">
Word
}
Use { skw<"use"> Word } Use { skw<"use"> Word }
@ -39,7 +30,7 @@ synth_root { Word | Keyword }
synth_term { Args | Keyword } synth_term { Args | Keyword }
arg_term { Placeholder | expression } arg_term { Placeholder | simple }
Args { Args {
("(" separator* ")") ("(" separator* ")")
@ -87,9 +78,7 @@ Fn_Clauses {
Fn_Compound { skw<"fn"> Word Fn_Clauses } Fn_Compound { skw<"fn"> Word Fn_Clauses }
Fn_Named { Fn_Named { skw<"fn"> Word Fn_Clause }
skw<"fn"> Word Fn_Clause
}
Fn_Lambda { skw<"fn"> Fn_Clause } Fn_Lambda { skw<"fn"> Fn_Clause }
@ -139,10 +128,7 @@ List_Pattern {
"]") "]")
} }
Assoc_Pattern { Assoc_Pattern { Word | (Keyword Pattern) }
Word
| (Keyword Pattern)
}
Dict_Pattern { Dict_Pattern {
("#{" separator* "}") ("#{" separator* "}")
@ -162,12 +148,7 @@ Struct_Pattern {
"}") "}")
} }
Let { Let { skw<"let"> Pattern "=" non_binding }
skw<"let">
Pattern
"="
non_binding
}
Else { skw<"else"> } Else { skw<"else"> }
@ -205,7 +186,7 @@ When {
If { If {
skw<"if"> simple newline* skw<"if"> simple newline*
skw<"then"> expression ~ambig newline* skw<"then"> expression newline*
skw<"else"> expression skw<"else"> expression
} }
@ -263,15 +244,9 @@ Set {
| "${" separator* "}" | "${" separator* "}"
} }
assoc_term { assoc_term { Word | (Keyword non_binding) }
Word
| (Keyword non_binding)
}
dict_term { dict_term { assoc_term | Splat }
assoc_term
| Splat
}
Dict { Dict {
("#{" ("#{"
@ -299,14 +274,9 @@ skw<term> { @specialize<Word, term> }
Keyword { ":" Word } Keyword { ":" Word }
Boolean { Boolean { kw<"true"> | kw<"false"> }
kw<"true">
| kw<"false">
}
Nil { Nil { skw<"nil"> }
skw<"nil">
}
@tokens { @tokens {
Word { $[a-z] $[a-zA-Z_\-?/!]* } Word { $[a-z] $[a-zA-Z_\-?/!]* }

File diff suppressed because one or more lines are too long