-
Notifications
You must be signed in to change notification settings - Fork 5
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
make parser capable of treating AST instuctions as first-class symbols #29
Comments
Hi! This is my train of thought and some questions along the way: assumptions: in branch As I understand it, AST instructions (i.e. So a parser that treats AST instructionts as first class symbols would be a parser capable of consuming strings with two types of encodings: SIL's AST instruction language and normal SIL language. Am I interpreting this part correctly? Should the parser be able to consume a string with a mix of both encondings? Or should the parser accept just one (either SIL lang or AST instructions)? |
It feels like AST instructions would go a different way because the are already |
Ah, I didn't do a very good job at describing this. I'll edit the original description to try to make it clearer. You won't be changing what the parser is consuming. You'll just be writing new methods that consume Strings to produce |
Since you're not that familiar with Parsec, this might be a tricky issue to start with, now that I think about it. It'll probably be a lot of researching for a tiny amount of code. |
E.G. you should be able to pass AST instructions as arguments, like
app (pair zero zero) left
so right now in a .sil file, we could have a line like
test = left {0,0}
left is a keyword, and the parser always expects it to be followed by an argument.
So if I wanted to use it in a function, I'd have to do something like
test = (\f -> f {0,0}) (\x -> left x)
I want to be able to do this instead:
test = (\f -> f {0,0}) left
So we can parse
left
as a regular function, but it should also generate the same grammar as before when parsing old syntax (e.g.left {0,0}
)The text was updated successfully, but these errors were encountered: