Skip to content
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Format [Keep A ChangeLog](https://keepachangelog.com/en/1.0.0/)
### Changed
- https://github.com/evinism/mistql/pull/150 Modified JS implementation `#index` and `#split` functions to match the expected unicode behavior as established above.

### Fixed
- https://github.com/evinism/mistql/pull/152 Allowed numbers to end in bare decimal points

## [0.4.9] 2022-05-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion js/src/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const vaccumsWhitespace = (token: string, direction: "l" | "r") => {
const refStarter = /[a-zA-Z_]/;
const refContinuer = /[a-zA-Z_0-9]/;
const numStarter = /[0-9]/;
const numIsValid = /^(0|([1-9][0-9]*))(\.[0-9]+)?([eE][+-]?[0-9]+)?/;
const numIsValid = /^(0|([1-9][0-9]*))(\.[0-9]*)?([eE][+-]?[0-9]+)?/;
const whitespace = /\s/;

export function lex(raw: string): LexToken[] {
Expand Down
6 changes: 5 additions & 1 deletion shared/testdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@
},
{
"it": "parses numbers which end with a decimal point",
"skip": ["js"],
"assertions": [
{
"query": "0.",
Expand All @@ -202,6 +201,11 @@
"query": "(5.)",
"data": null,
"expected": 5
},
{
"query": "-9.e2",
"data": null,
"expected": -900
}
]
},
Expand Down