ConceptPortal-public/rsconcept/frontend/src/components/RefsInput/parse/refsText.grammar

56 lines
666 B
Plaintext
Raw Normal View History

@precedence {
2023-09-27 23:36:51 +03:00
text @right
p1
p2
}
@top Text { textItem* }
@skip { space }
@tokens {
space { @whitespace+ }
Offset { $[-]?$[1-9]$[0-9]* }
Global { $[XCSDATFPR]$[1-9]$[0-9]* }
2023-09-27 23:36:51 +03:00
word { ![@{|} \t\n]+ }
2023-09-27 23:36:51 +03:00
gram { $[-a-zA-Z0-9]+ }
2023-09-27 23:36:51 +03:00
@precedence { word, space }
}
textItem {
!p1 ref |
2023-09-27 23:36:51 +03:00
!p2 Filler
}
Filler { word_enum }
word_enum {
word |
word !text word_enum
}
ref {
RefEntity |
RefSyntactic
}
RefEntity {
2023-09-27 23:36:51 +03:00
"@{" Global "|" Grams "}"
}
Grams { gram_enum }
gram_enum {
gram |
gram "," gram_enum
}
RefSyntactic {
"@{" Offset "|" Nominal "}"
}
2023-09-27 23:36:51 +03:00
Nominal { word+ }
@detectDelim
@external propSource highlighting from "./highlight.ts"