programlibs/Parsing/demos/pieces.xtl

Taking a notation apart safely: the pieces of an equation's right side, each parser using all of its text; what a macro library does with Parsing before it writes code. Run with "just demo Parsing pieces".

source · imports pa: libs/Parsing/src/Parsing.xtl

call : Char

value · line 7
call ← "(sum j:=0..M-1 | W[i,j] * x[j]) + b[i]"

term : Char

value · line 12
term ← d̲isclose f̲irst "+" ᵖᵃs̲plit call