Showing
2 changed files
with
9 additions
and
4 deletions
... | @@ -160,9 +160,13 @@ class Translator (PyTranslator) : | ... | @@ -160,9 +160,13 @@ class Translator (PyTranslator) : |
160 | while len(nodes) > 1 : | 160 | while len(nodes) > 1 : |
161 | left = nodes.pop(0) | 161 | left = nodes.pop(0) |
162 | right = nodes.pop(0) | 162 | right = nodes.pop(0) |
163 | - nodes.insert(0, self.ST.AbcdFlowOp(lineno=left.lineno, | 163 | + theop = op() |
164 | - col_offset=left.col_offset, | 164 | + theop.st = st[1] |
165 | - left=left, op=op(), right=right)) | 165 | + flow = self.ST.AbcdFlowOp(lineno=left.lineno, |
166 | + col_offset=left.col_offset, | ||
167 | + left=left, op=theop, right=right) | ||
168 | + flow.st = st | ||
169 | + nodes.insert(0, flow) | ||
166 | return nodes[0] | 170 | return nodes[0] |
167 | def do_abcd_expr (self, st, ctx) : | 171 | def do_abcd_expr (self, st, ctx) : |
168 | """abcd_expr: abcd_choice_expr ('|' abcd_choice_expr)* | 172 | """abcd_expr: abcd_choice_expr ('|' abcd_choice_expr)* | ... | ... |
... | @@ -252,7 +252,8 @@ class ABCD2HTML (ast.NodeVisitor) : | ... | @@ -252,7 +252,8 @@ class ABCD2HTML (ast.NodeVisitor) : |
252 | t = t[0] | 252 | t = t[0] |
253 | while t[0].text == '(' : | 253 | while t[0].text == '(' : |
254 | t = t[1] | 254 | t = t[1] |
255 | - self.setspan("flow", t[1]) | 255 | + for op in t[1::2] : |
256 | + self.setspan("flow", op) | ||
256 | self.generic_visit(node) | 257 | self.generic_visit(node) |
257 | def visit_SimpleAccess (self, node) : | 258 | def visit_SimpleAccess (self, node) : |
258 | self.setspan("name", node.st[0]) | 259 | self.setspan("name", node.st[0]) | ... | ... |
-
Please register or login to post a comment