tree-sitter/spec/runtime/languages/arithmetic/main.txt
2014-10-02 11:54:00 -07:00

56 lines
949 B
Text

====================
parses numbers
===================
5
---
(number)
===================
parses variables
===================
x
---
(variable)
====================================
parses variables with greek letters
====================================
φ1
---
(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))))))