1.0.0-alpha.11
lahmatiy
released this
17 Dec 22:45
·
399 commits
to master
since this release
- Reworked parsing to produce AST, other parts reworked to consume AST as well
- Exposed
syntax
interface with 3 methods:parse(source, tolerantMode)
,compile(ast, suggestRanges, statMode)
andstringify(ast)
- Added slice notation like proposed for adding to JavaScript, e.g.
$str: '<foo>'; str[1:-1]
('foo'
) or$ar:[1,2,3,4,5,6]; $ar[-3::-1]
([6,5,4]
) (#11) - Added
slice(from, to)
method - Added
split(pattern)
method - Added
join(separator)
method - Added
match(pattern, matchAll)
method - Fixed method invocation on recursive mapping, i.e.
..method()
doesn't raise an error now and works as expected without surrounding parentheses (#10) - Allowed definitions to use in parentheses, e.g.
($a: 1; $a + $a)
- Added a function definition via
=>
, i.e.=> body
- Added sorting function definition with
asc
anddesc
keywords, e.g.sort(foo asc)
,$sorting: foo desc; sort($sorting)
orsort(foo desc, bar asc)
- Changed
sort()
method to use a two argument function as a regular comparator - Removed
::self
syntax, recursion with a function defined by a variable should be used instead