Skip to content

Commit

Permalink
fix: add float to list of constants (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsi-inco authored May 16, 2024
1 parent 1cce283 commit be2acaf
Show file tree
Hide file tree
Showing 7 changed files with 295,145 additions and 290,811 deletions.
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

0 comments on commit be2acaf

Please sign in to comment.