Skip to content
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

Adding Parser trait #513

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Adding Parser trait #513

merged 1 commit into from
Nov 22, 2023

Conversation

luketpeterson
Copy link
Contributor

This PR adds a Parser trait, and changes Metta::run to accept any impl Parser instead of a SExprParser

I gathered this was a direction we want to go anyway, to allow additional syntaxes.

However my reason for needing this change right now is that the module loader needs a way to retain ownership of text before it's parsed, but keeping the text buffer along-side the parser would result in a self-referential object. So this change lets me create an OwningSExprParser that owns the text it's parsing.

This is a tiny step towards merging the module system.

@luketpeterson luketpeterson requested a review from vsbogd November 22, 2023 07:12
@vsbogd vsbogd merged commit eb8c994 into trueagi-io:main Nov 22, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants