[sql] Inline configuration creation, faster
This commit is contained in:
parent
2d10e91f9e
commit
1ecbe672bc
1 changed files with 12 additions and 1 deletions
|
|
@ -1457,7 +1457,18 @@ class ParserGenerator:
|
||||||
lookahead.update(context)
|
lookahead.update(context)
|
||||||
|
|
||||||
for rule in rules:
|
for rule in rules:
|
||||||
new_core = Configuration.from_rule(config_next, rule)
|
if len(rule) == 0:
|
||||||
|
next = None
|
||||||
|
else:
|
||||||
|
next = rule[0]
|
||||||
|
|
||||||
|
new_core = Configuration(
|
||||||
|
name=config_next,
|
||||||
|
symbols=rule,
|
||||||
|
position=0,
|
||||||
|
next=next,
|
||||||
|
)
|
||||||
|
|
||||||
todo.append((new_core, lookahead))
|
todo.append((new_core, lookahead))
|
||||||
|
|
||||||
return ItemSet(closure)
|
return ItemSet(closure)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue