Closed TheOtterlord closed 4 years ago
Thanks for the help.
I've made the changes 😄
I've created a mr to fix the issues i pointed out and some code styling improvements here: https://github.com/TheOtterlord/general_programming_language/pull/1
Thanks.
I’ve merged your PR.
Great thanks for making this!
No problem.
Just wanted to quickly check something.
I was testing using the example file, and noticed that only the first of two functions were parsed. Once the first function is parsed, the rest seems to be ignored.
Here is my example.gpl code:
fn test() {}
fn main() {}
And this is the response:
Compiling gpl v0.1.0 (C:\Users\reube\source\repos\gpl)
Finished dev [unoptimized + debuginfo] target(s) in 1.96s
Running `target\debug\gpl.exe`
[Function { name: Some("test"), args: [], body: Actions { list: [] } }]
Is this something that has not been implemented yet, or a bug?
A bug.
Yesterday late in the evening i successfully added support for global consts :) but after making it i noticed all tests also passed successfully but i'm sure a lot of them should not so maybe we should also add checks for the parsed output like the parsed function name, args, variable names and types, etc..
Ok.
I will have a look at the current code and see if I can narrow down the bug.
Yeah, we need to add some validation to our tests. I will focus on the bug for now, but will have a go at adding validation.
I don't yet understand this bit of code, but on line 242
before commit a2b8ea61b335da7ffecb186821693af6cec0c22f there was a while loop that has now been removed. As far as I can see this is the only loop that could be causing the issue.
What do you think?
Continued in #8
I've implemented single line comments into our parser. I decided just to ignore them, as there is no point parsing them through.
Edit: Added multi-line support now