Skip to content

v0.1.2 - Shared symbols

Pre-release
Pre-release
Compare
Choose a tag to compare
@raleksandar raleksandar released this 15 Mar 22:14
· 24 commits to master since this release
v0.1.2
8b3bff8

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.