This reverts commit 5cd07648fd.
The separators construct is useful as an optimization. It turns out that
constructing a node for every chunk of whitespace in a document causes a
significant performance regression.
Conflicts:
src/compiler/build_tables/build_lex_table.cc
src/compiler/grammar.cc
src/runtime/parser.c
49 lines
819 B
Text
49 lines
819 B
Text
====================
|
|
parses numbers
|
|
===================
|
|
5
|
|
---
|
|
(number)
|
|
|
|
===================
|
|
parses variables
|
|
===================
|
|
x
|
|
---
|
|
(variable)
|
|
|
|
===================
|
|
parses products
|
|
===================
|
|
x * x
|
|
---
|
|
(product (variable) (variable))
|
|
|
|
===================
|
|
parses sums
|
|
===================
|
|
x + x
|
|
---
|
|
(sum (variable) (variable))
|
|
|
|
===============================================
|
|
binds multiplication more tightly than addition
|
|
===============================================
|
|
a * b + c * d
|
|
---
|
|
(sum
|
|
(product (variable) (variable))
|
|
(product (variable) (variable)))
|
|
|
|
============================
|
|
parses exponents
|
|
============================
|
|
x + y * z^(a + b)
|
|
---
|
|
(sum
|
|
(variable)
|
|
(product
|
|
(variable)
|
|
(exponent
|
|
(variable)
|
|
(group (sum (variable) (variable))))))
|