Disable keyword extraction
For now bare keywords are errors, since we have not included them as valid expressions.
This commit is contained in:
parent
50c8e3c0e6
commit
0bc7e59fc7
4 changed files with 522 additions and 367 deletions
|
|
@ -17,6 +17,9 @@ const PREC = {
|
|||
module.exports = grammar({
|
||||
name: "tiger",
|
||||
|
||||
// Ensure we don't extract keywords from tokens
|
||||
word: ($) => $.identifier,
|
||||
|
||||
rules: {
|
||||
source_file: ($) => choice(
|
||||
$._expr,
|
||||
|
|
@ -40,6 +43,9 @@ module.exports = grammar({
|
|||
'"',
|
||||
),
|
||||
|
||||
// NOTE: includes reserved identifiers
|
||||
identifier: (_) => /[_a-zA-Z0-9]+/,
|
||||
|
||||
escape_sequence: (_) => token.immediate(
|
||||
seq(
|
||||
"\\",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue