16.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 2daf0f04 authored by Eckhart Arnold's avatar Eckhart Arnold
Browse files

minor corrections

parent 93c8472b
......@@ -581,7 +581,12 @@ def flatten(node):
wherever a node has child nodes, the child nodes are inserted in place
of the node. In other words, all leaves of this node and its child nodes
are collected in-order as direct children of this node.
This is meant to achieve the following structural transformation:
This is meant to achieve these kinds of structural transformation:
(1 (+ 2) (+ 3) -> (1 + 2 + 3)
(1 (+ (2 + (3)))) -> (1 + 2 + 3)
Warning: Use with care. Du tue its recursive nature, flattening can
have unexpected side-effects.
"""
if node.children:
new_result = []
......
......@@ -29,7 +29,7 @@ oneormore = "{" expression "}+"
repetition = "{" expression §"}"
chain = { link "--" }+ link # chained regular expressions
link = regexp | symbol # semantic restriction: symbol must evaluate to a regexp or chain
link = regexp | symbol | literal # semantic restriction: symbol must evaluate to a regexp or chain
symbol = /(?!\d)\w+/~ # e.g. expression, factor, parameter_list
literal = /"(?:[^"]|\\")*?"/~ # e.g. "(", '+', 'while'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment