Fix negative number parse. #86

This commit is contained in:
sunli 2020-05-13 08:21:38 +08:00
parent 4875c421e4
commit b15459f20f
2 changed files with 2 additions and 1 deletions

View File

@ -2,7 +2,7 @@ WHITESPACE = _{ " " | "," | "\t" | "\u{feff}" | NEWLINE }
COMMENT = _{ "#" ~ (!"\n" ~ ANY)* }
// value
int = @{ "-"? ~ "0" | ASCII_NONZERO_DIGIT ~ ASCII_DIGIT* }
int = @{ "-"? ~ ("0" | (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT*)) }
float = @{ "-"? ~ int ~ "." ~ ASCII_DIGIT+ ~ exp? }
exp = @{ ("E" | "e") ~ ("+" | "-")? ~ ASCII_DIGIT+ }

View File

@ -1,3 +1,4 @@
query {
node(id: 1)
node2(id: -1, id1: -0, id2: 0, id3: -1.23, id4: 1.23, id5: 1.23e+2, id6: 1.23e+2, id7: 0.123)
}