Constant propogation and evaluation
MovingtoMars opened this issue · comments
Liam commented
Go constants are complex. They remain untyped until given a type (although they may have a kind, ie. integer/float/string).
https://github.com/golang/go/blob/master/src/go/constant/value.go
Liam commented
Constant evaluation should probably be its own module. Should it be a submodule of the parser submodule? Or maybe a more semantically-related module?
Yohaï-Eliel Berreby commented
It should definitely be separate. Each pass should be as small and self-contained as possible. Constant propagation is not part of parsing.
PS: I have to go now; thanks for the flat TokenKind PR!