Skip to content

Commit

Permalink
fix: don't parse the l suffix in floats
Browse files Browse the repository at this point in the history
  • Loading branch information
Eloitor authored and amaanq committed Mar 6, 2024
1 parent 22d3f87 commit e623716
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 57 deletions.
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ let package = Package(
".gitignore",
".gitattributes",
".gitmodules",
".npmignore",
],
sources: [
"src/parser.c",
Expand Down
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ module.exports = grammar({
seq(optional(digits), '.', digits, optional(exponent)),
seq(digits, exponent),
),
optional(choice(/[Ll]/, /[jJ]/)),
optional(/[jJ]/),
));
},

Expand Down
13 changes: 2 additions & 11 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 8 additions & 15 deletions src/parser.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions src/tree_sitter/alloc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 8 additions & 11 deletions src/tree_sitter/array.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions test/corpus/literals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ Floats
1_1.
1e+3_4j
.3e1_4
1_0.l
.1l

--------------------------------------------------------------------------------

Expand All @@ -82,10 +80,6 @@ Floats
(float))
(expression_statement
(float))
(expression_statement
(float))
(expression_statement
(float))
(expression_statement
(float)))

Expand Down

0 comments on commit e623716

Please sign in to comment.