Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add float to list of constants #56

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions examples/expressions.fs
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
do
1 + 1
#if true
printfn "blah1"
2 + 2
printfn "blah2"
#endif
printfn "bluh"
1.
31 changes: 16 additions & 15 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ module.exports = grammar({

const: $ => choice(
$.sbyte, $.int16, $.int32, $.int64, $.byte, $.uint16, $.uint32, $.int,
$.nativeint, $.unativeint, $.decimal,
$.nativeint, $.unativeint, $.decimal, $.float,
$.uint64, $.ieee32, $.ieee64, $.bignum, $.char, $.string,
$.verbatim_string, $.triple_quoted_string, $.bytearray,
$.verbatim_bytearray, $.bytechar, $.bool, $.unit),
Expand Down Expand Up @@ -1770,20 +1770,21 @@ module.exports = grammar({
decimal: $ => seq(choice($.float, $.int), token.immediate(/[Mm]/)),

float: $ =>
alias(
choice(
seq(
$.int,
token.immediate('.'),
optional($.int)
),
seq(
$.int,
optional(seq(token.immediate('.'), $.int)),
token.immediate(/[eE][+-]?/),
$.int
),
), 'float'),
prec.right(
alias(
choice(
seq(
$.int,
token.immediate('.'),
optional($.int)
),
seq(
$.int,
optional(seq(token.immediate('.'), $.int)),
token.immediate(/[eE][+-]?/),
$.int
),
), 'float')),

//
// Constants (END)
Expand Down
158 changes: 83 additions & 75 deletions src/grammar.json

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

8 changes: 8 additions & 0 deletions src/node-types.json

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

Loading