From e47adc94321738d725c94ea5448c75ff773dce59 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Sat, 18 Jul 2020 14:46:44 -0600 Subject: [PATCH] Don't make space a part of punct --- src/python/flowmetal/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/flowmetal/parser.py b/src/python/flowmetal/parser.py index c390a9a..ccfba1e 100644 --- a/src/python/flowmetal/parser.py +++ b/src/python/flowmetal/parser.py @@ -238,7 +238,7 @@ class Parser(SexpParser): @classmethod def ispunct(cls, ch: str): - return cls.isspace(ch) or ch in ( + return ch in ( ';' # Semicolon '()' # Parens '⟮⟯' # 'flat' parens @@ -328,7 +328,7 @@ class Parser(SexpParser): def parse_symbol(cls, f: PosTrackingBufferedReader): with ReadThroughBuffer(f) as rtb: pos = None - while rtb.peek() and not cls.ispunct(rtb.peek()): + while rtb.peek() and not cls.isspace(rtb.peek()) and not cls.ispunct(rtb.peek()): pos = pos or rtb.pos() rtb.read() buff = str(rtb)