Browse Source

Small fix to propagate positions: remove preceding/trailing whitespace

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.12.0
Erez Sh 4 years ago
parent
commit
775f6f2b3e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      lark/parse_tree_builder.py

+ 2
- 1
lark/parse_tree_builder.py View File

@@ -28,7 +28,8 @@ def _pp_get_meta(children):
if not c.meta.empty: if not c.meta.empty:
return c.meta return c.meta
elif isinstance(c, Token): elif isinstance(c, Token):
return c
if not c.isspace(): # Don't regard whitespace-only tokens
return c


class PropagatePositions: class PropagatePositions:
def __init__(self, node_builder): def __init__(self, node_builder):


Loading…
Cancel
Save