This function parses a string s containing Macaulay2 code and returns a list representing the corresponding concrete syntax tree. Each element of the list corresponds a statement. Except for very simple code, they will have a nested structure. The first element is a tag representing the type of node and later elements are its children.
Consider the following:
|
We see that this is a Binary node with three children: the left hand side, the operator, and the right hand side. All three are Token nodes.
The next example shows how Macaulay2 deals with the danging else problem:
|
The object parse is a compiled function.
The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/parse-doc.m2:36:0.