Don't make space a part of punct
This commit is contained in:
parent
50842cb3d1
commit
e47adc9432
1 changed files with 2 additions and 2 deletions
|
@ -238,7 +238,7 @@ class Parser(SexpParser):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def ispunct(cls, ch: str):
|
def ispunct(cls, ch: str):
|
||||||
return cls.isspace(ch) or ch in (
|
return ch in (
|
||||||
';' # Semicolon
|
';' # Semicolon
|
||||||
'()' # Parens
|
'()' # Parens
|
||||||
'⟮⟯' # 'flat' parens
|
'⟮⟯' # 'flat' parens
|
||||||
|
@ -328,7 +328,7 @@ class Parser(SexpParser):
|
||||||
def parse_symbol(cls, f: PosTrackingBufferedReader):
|
def parse_symbol(cls, f: PosTrackingBufferedReader):
|
||||||
with ReadThroughBuffer(f) as rtb:
|
with ReadThroughBuffer(f) as rtb:
|
||||||
pos = None
|
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()
|
pos = pos or rtb.pos()
|
||||||
rtb.read()
|
rtb.read()
|
||||||
buff = str(rtb)
|
buff = str(rtb)
|
||||||
|
|
Loading…
Reference in a new issue