Skip to content

Get rid of janky attempt at performance #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions kiuatan/named_rule.pony
Original file line number Diff line number Diff line change
Expand Up @@ -101,30 +101,7 @@ class NamedRule[S, D: Any #share = None, V: Any #share = None]

match _body
| let body': RuleNode[S, D, V] val =>
let self = this

if not left_recursive then
body'.parse(
parser,
depth,
loc,
{(body_result: Result[S, D, V]) =>
let rule_result =
match body_result
| let success: Success[S, D, V] =>
Success[S, D, V](self, success.start, success.next, [success])
| let failure: Failure[S, D, V] =>
Failure[S, D, V](
self,
loc,
ErrorMsg.rule_expected(self.name, loc.string()),
failure)
end
outer(rule_result)
})
else
parser._parse_named_rule(depth, self, body', loc, outer)
end
parser._parse_named_rule(depth, this, body', loc, outer)
else
let result =
Failure[S, D, V](this, loc, ErrorMsg.rule_empty(name))
Expand Down