Skip to content

Commit

Permalink
remove parse() from python_makeAbstractStub() template
Browse files Browse the repository at this point in the history
  • Loading branch information
reedeveris committed Feb 14, 2024
1 parent 1b58282 commit 3b44786
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/plcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,16 +722,6 @@ def python_makeAbstractStub(base):
class {base}({ext}): #{base}:class#
className = "{base}"
def parse(Scan scn, Trace trace):
Token t = scn.cur()
Token.Match match = t.match
match match:
{cases}
case _:
raise PLCCException(
"Parse error",
"{base} cannot begin with " + t.errString()
)
#{base}#
""".format(cls=cls,
Expand Down Expand Up @@ -868,9 +858,9 @@ def __init__(self, {params}):
lhs=lhs,
ext=ext,
ruleString=ruleString,
decls='\n\t\t'.join(decls),
decls='\n\t'.join(decls),
params=', '.join(params),
inits='\n\t\t\t'.join(inits),
inits='\n\t\t'.join(inits),
parse=parseString)
return stubString

Expand Down Expand Up @@ -1131,6 +1121,8 @@ def getCode(nxt):
else:
deathLNO('premature end of file')
lineMode = False # switch off line mode
while len(code[0]) == 0:
code.pop(0)
while len(code[-1]) == 0:
code.pop()
return code
Expand Down Expand Up @@ -1498,7 +1490,7 @@ def removeOffset(ln, offset):
def getOffset(line):
check = line.lstrip()
if len(check) == 0 or check[0] == '#':
return 0
return None
ws = 0
for c in line:
if c == ' ':
Expand Down

0 comments on commit 3b44786

Please sign in to comment.