v0.1.2 - Shared symbols
Pre-release
Pre-release
From this release, numenor makes use of the global symbol registry for the expression and token types which makes (de)serializing of the AST object much easier.
Symbol keys for the expression types have the format of numenor:expr:<name>
. For example numenor:expr:call
for the ExpressionType.Call
symbol.
Symbol keys for the token types have the format of numenor:tok:<token>
. For example numenor:tok:+
for the TokenType.Plus
symbol.
You can obtain a correct symbol value from the string value via Symbol.for('<key>')
. For example Symbol.for('numenor:expr:await') === ExpressionType.Await
.