Improve performance by not de-duping before closing

You close *after* you've determined that a successor is new, not
before.
This commit is contained in:
John Doty 2024-06-06 05:31:15 -07:00
parent 8c3b1b784c
commit bd70315935
2 changed files with 65 additions and 57 deletions

View file

@ -256,11 +256,8 @@ class FineGrammar(Grammar):
def primary_expression(self) -> Rule:
return (
self.identifier_expression
| self.literal_expression
| SELF
| NUMBER
| STRING
| TRUE
| FALSE
| seq(BANG, self.primary_expression)
| seq(MINUS, self.primary_expression)
| self.block
@ -278,6 +275,10 @@ class FineGrammar(Grammar):
def identifier_expression(self):
return IDENTIFIER
@rule("Literal")
def literal_expression(self):
return NUMBER | STRING | TRUE | FALSE
@rule("ConditionalExpression")
def conditional_expression(self) -> Rule:
return (