tokay-lang / tokay

Tokay is a programming language designed for ad-hoc parsing, inspired by awk.
https://tokay.dev
MIT License
239 stars 7 forks source link

bug: Assign of consumable to variable should call (like an expression) #115

Open phorward opened 1 year ago

phorward commented 1 year ago

Given tokay -- hello1234

Tokay 0.6.4
>>> x = Int
>>> x
1234
>>> X : @{ x = Int x }
Line 1, column 1: Cannot assign to constant 'X', because it must be consumable. Use an identifier starting in lower-case, e.g. 'x'
>>> 

Inside of the parselet definition, the assignment of Int to x should call Int. It can be worked around by X : @{ x = {Int} x }.