Skip to content

Releases: raleksandar/numenor

v0.1.6 - Lambda expression improvements

12 Jul 12:24
v0.1.6
c1b50f7
Compare
Choose a tag to compare
Pre-release

This release brings the following fixes/improvements:

  • reporting of lexer state is now correct again (was broken by changes in v0.1.5)
  • precedence and associativity of lambda expressions is now handled correctly
  • lambda expression arguments can have default values (a.k.a optional arguments)
  • lambda expression can have a variadic argument (a.k.a. rest params)

v0.1.5 - Lambda expressions

07 Jul 19:44
v0.1.5
8546958
Compare
Choose a tag to compare
Pre-release

Numenor now supports lambda expressions (e.g. (x) => x * 2, but since numenor is expression parser statement block is not supported, i.e. (x) => { doSomething(x) } is not supported).

This release also fixes the issue with parsing of >>> and >>= operators.

v0.1.4 - String escapes bugfix

03 Apr 10:22
v0.1.4
ed79cc7
Compare
Choose a tag to compare
Pre-release

This release fixes the string escape sequence parsing bug.

v0.1.3 - Improved function binding

15 Mar 22:20
v0.1.3
068e5ac
Compare
Choose a tag to compare
Pre-release

All function values in the evaluation context of a numenor expression are bound using the Function.prototype.bind.
This always creates a new function which means that any properties which might have been added to the function which is bound are lost. From this version, numenor will copy all of the enumerable properties of a function when creating its bound version.

v0.1.2 - Shared symbols

15 Mar 22:14
v0.1.2
8b3bff8
Compare
Choose a tag to compare
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.

v0.1.1 - ValueLookup API

13 Mar 07:11
v0.1.1
3d34aaa
Compare
Choose a tag to compare
Pre-release

This release introduces ValueLookup API which can be used to dynamically provide context values.
For example:

import { ValueLookup } from 'numenor/lib/Compiler/Evaluator';

evaluator.evaluate('now', { [ValueLookup]: (name) => name === 'now' ? Date.now() : undefined });

ValueLookup is also supported in { Constants: {} } compiler option.

v0.1.0 - Await expressions

11 Mar 14:02
v0.1.0
fe1474d
Compare
Choose a tag to compare
Pre-release
  • await expressions are now supported. If at least one await expression was used in a given source, the result of evaluating that expression will be an instance of Promise, which resolves once that all nested promises (i.e. await expressions) resolve.
  • default empty EvaluatorContext object is no more reused between evaluations
  • Fixed the associativity of the unary prefix operators
  • Fixed the precedence of the sequence (comma) operator
  • Lexer#addScanner has been renamed to Lexer#appendScanner, also, the Lexer#prependScanner has been added

v0.0.10 - Trailing commas

27 Feb 17:34
v0.0.10
09adc3b
Compare
Choose a tag to compare
Pre-release

This release fixes the support for the trailing commas in an array/object literals and function calls

v0.0.9 - Parser/Lexer state breaking change

27 Feb 17:32
v0.0.9
00ee8e7
Compare
Choose a tag to compare
  • Parser#state now returns the position of the last accepted token
  • Lexer#currentState now returns the position of the last consumed token

v0.0.8 - Parser/Compiler events

27 Feb 17:28
v0.0.8
71c990c
Compare
Choose a tag to compare
Pre-release
  • Parser now emits scope:enter, scope:leave and node events
  • Compiler now emits scope:enter and scope:leave events
  • All tokens now have offset and lexeme (previously only on some token types as raw) properties
  • Parsing errors now display lexeme of the token instead of its type