Closed chengluyu closed 1 year ago
Cool, thanks, but why on Earth would you update Parser and MLParser with that change? These are legacy parsers, and in particular we should get rid of Parser ASAP.
I have modified TupleType
, so tests using the old parsers will also fail. So, I updated them as well.
Why not mark the PR as "ready for review"?
Sorry, I forgot this time.
Thanks!
Changes
Syntax
Tuple indices in selection should matches regular expression
0|[1-9][0-9]
. Records and record types now accept non-negative integers as field names (e.g.,{ 1: "Hello" }
).Parser
: Allow selecting tuple indices (e.g.,x.0
) and using non-negative integer fields in records.MLParser
: Same asParser
. Also allow non-negative integer fields in record types (e.g.,{ 1: int }
).NewLexer
: AllowSELECT
'sname
to be tuple indices.NewParser
: Same asParser
.Typing
TyperDatatypes
: UpdateTupleType
'stoRecord
methods.TypeSimplifier
: Update the code that simplify tuple types.Typer
: Update the code which treatsArray
as a supertype of tuple types.Typer
: Fields that are integers or start with an underscore are not used as name hints.JavaScript Code Generation
Tests
._n
to.(n-1)
.