Skip to content

Commit

Permalink
fix: remove None as a special rule
Browse files Browse the repository at this point in the history
Instead parse it as an identifier.
  • Loading branch information
mfelsche authored and amaanq committed Mar 17, 2023
1 parent 846ccc3 commit 1d89837
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ module.exports = grammar({
$.viewpoint_type,
$.lambda_type,
$.this,
$.none,
),

base_type: $ => prec.right(seq(
Expand Down Expand Up @@ -355,7 +354,6 @@ module.exports = grammar({
$.identifier,
$.ffi_identifier,
$.this,
$.none,
$.error,
$.compile_intrinsic,
$.compile_error,
Expand Down Expand Up @@ -758,8 +756,6 @@ module.exports = grammar({

this: _ => 'this',

none: _ => 'None',

comment: _ => token(choice(
seq('//', /(\\(.|\r?\n)|[^\\\n])*/),
seq('/*', /[^*]*\*+([^/*][^*]*\*+)*/, '/'),
Expand Down
2 changes: 1 addition & 1 deletion test/corpus/exprs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ primitive Snot
(do_block
(block
(repeat_statement
(block (none))
(block (identifier))
(binary_expression
left: (identifier)
right: (literal (boolean))
Expand Down
2 changes: 1 addition & 1 deletion test/corpus/lambda.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Lambda
(lambda_parameters)
)
(lambda_expression
(block (none))
(block (identifier))
(capability)
)
)
Expand Down
2 changes: 1 addition & 1 deletion test/corpus/statements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ primitive ContainsWith
)
)
(else_block
(block (none))
(block (identifier))
)
)
)
Expand Down
2 changes: 1 addition & 1 deletion test/corpus/types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Array[A]
)
)
)
(block (none))
(block (identifier))
)
)
)

0 comments on commit 1d89837

Please sign in to comment.