subscript

Fast and tiny expression evaluator with minimal syntax.

ISC License

Downloads
983
Stars
106
Committers
1
subscript - v8.0.0 Latest Release

Published by dy 8 months ago

What's Changed

  • Pluggable language features
  • Standardized common syntax
  • Added assignment operators += -= *= /= %=
  • Flatten code - no set, no wrappers
  • Generic access node handling
  • Simplified primitives wrapping [,true] vs ['',true]
  • a?.valueOf?.() context calls support
  • Misc. fixes

Full Changelog: https://github.com/dy/subscript/compare/v7.4.0...v8.0.0

subscript - 7.4

Published by dy over 1 year ago

  • Fixed nary
  • More complete tests
  • Added skip argument to nary
  • Better error display
  • Type definitions
  • Rassoc precedence is half, not full

Full Changelog: https://github.com/dy/subscript/compare/v7.4.4...v7.4.5

subscript - 7.1

Published by dy over 2 years ago

  • Add explicit parse.unary, parse.binary and parse.nary registerers
  • Add redefinable parse.id and parse.space
subscript - 7.0

Published by dy over 2 years ago

  • Reintroduces AST/calltree as intermediary layer for better optimizations, extensibility and interop.
  • Better registering fn.
  • +10% parsing performance (170ms → 150ms)
  • +20% eval performance (17ms → 13ms)
  • +30% size (1kb → 1.3kb)

Full Changelog: https://github.com/spectjs/subscript/compare/v6.4.0...v7.0.0

subscript - 6.1

Published by dy almost 3 years ago

  • Collect & expose found arguments
  • Better error messages
  • Removed tagged literal

Full Changelog: https://github.com/spectjs/subscript/compare/v6.0.0...v6.1.0

subscript - 6.0

Published by dy almost 3 years ago

What's Changed

  • Direct evals as result of parsing.
  • No lisp tree layer.
  • Tokens and comments are parsed from lookup table.
  • Single set method for defining operators or parsers.
  • Postfix unaries are now custom parsers.
  • Removed code, char functions.
  • No fancy literal wrappers or string prefixes.
  • Size -20% (2.5 → 2kb)
  • Parsing perf +20% (200 → 160ms)
  • Eval perf +50% (30 → 15ms)

Full Changelog: https://github.com/spectjs/subscript/compare/v5.5.2...v6.0.0

subscript - 5.5

Published by dy almost 3 years ago

What's Changed

  • ×3 faster eval due to flat reducer & fn type detection
  • evaluate.operator is a function on par with parse.operator
  • split core and subscript and justin configurators
  • string, literal tokens are unary operators
  • literals handling
  • word operators are externalized
  • more tests
  • strings are prefixed with @ only, no "" tokens

Full Changelog: https://github.com/spectjs/subscript/compare/v5.0.0...v5.5.2

subscript - 5.0

Published by dy almost 3 years ago

What's Changed

  • Direct lookup table instead of precedence ascend
  • Precedences match MDN
  • Added operator function to create any operators or tokens
  • Group/array are operators, not tokens
  • Performance +30% (260 → 200ms)
  • Size -10% (2.8 → 2.5kb)

Full Changelog: https://github.com/spectjs/subscript/compare/v4.0.0...v5.0.0

subscript - 4.0

Published by dy almost 3 years ago

What's changed

  • Functional parsers precedence table;
  • Fast char lookup table;
  • Improved performance by 25%;
  • Space/comments;
  • Correct ternary parser;
  • Correct errors detection;
  • Optimized expression parsing algorithm (merged prefix, postfix & binary);
  • All JSEP tests;

Full Changelog: https://github.com/spectjs/subscript/compare/v3.0.0...v4.0.0

subscript - 3.0

Published by dy almost 3 years ago

What's Changed

  • Significantly increased performance (on par with jsep or faster for major cases)
  • Extensible functional parsers instead of declarative configs
  • Operators precedence matches JS
  • Better source files layout
  • Postfix operators support
  • Smaller size
  • Node tests

Full Changelog: https://github.com/spectjs/subscript/compare/v2.0.0...v3.0.0

subscript - 2.0

Published by dy almost 3 years ago

What's Changed

  • Generalized & improved performance
  • Operator evaluators are separate from precedence dicts
  • Streamlined expression algorithm to real recursive descent
  • API is consolidated under parse.* and evaluate.* scopes
  • Reduced size

Full Changelog: https://github.com/spectjs/subscript/compare/1.0.4...v2.0.0

subscript - 1.0

Published by dy almost 3 years ago

  • Parser performance based on stripped JSEP engine
  • Frisk-compatible tree
  • 1.4kb size

Full Changelog: https://github.com/spectjs/subscript/commits/1.0.4