Skip to content

Commit

Permalink
Merge pull request #139 from afroozeh/expose_null_liteal_as_node
Browse files Browse the repository at this point in the history
Expose null_literal as a node
  • Loading branch information
fwcd authored Aug 18, 2024
2 parents 8d9d372 + e72b9d5 commit 6880d15
Show file tree
Hide file tree
Showing 9 changed files with 52,275 additions and 52,078 deletions.
4 changes: 3 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ module.exports = grammar({
$.bin_literal,
$.character_literal,
$.real_literal,
"null",
$.null_literal,
$.long_literal,
$.unsigned_literal
),
Expand Down Expand Up @@ -1207,6 +1207,8 @@ module.exports = grammar({
$._escaped_identifier
),

null_literal: $ => "null",

// ==========
// Identifiers
// ==========
Expand Down
2 changes: 1 addition & 1 deletion queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
] @number

[
"null" ; should be highlighted the same as booleans
(null_literal) ; should be highlighted the same as booleans
(boolean_literal)
] @boolean

Expand Down
8 changes: 6 additions & 2 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3802,8 +3802,8 @@
"name": "real_literal"
},
{
"type": "STRING",
"value": "null"
"type": "SYMBOL",
"name": "null_literal"
},
{
"type": "SYMBOL",
Expand Down Expand Up @@ -6173,6 +6173,10 @@
}
]
},
"null_literal": {
"type": "STRING",
"value": "null"
},
"_lexical_identifier": {
"type": "CHOICE",
"members": [
Expand Down
Loading

0 comments on commit 6880d15

Please sign in to comment.