mjarkk / general_programming_language

A temporarly repo for an idea to create a programming language that can be compiled into other languages
MIT License
1 stars 0 forks source link

New test, documentation update, and code organisation #3

Closed TheOtterlord closed 4 years ago

TheOtterlord commented 4 years ago

First of all, if you know of a better way to organise this code, please let me know. Even though my last commit splits up the code into main, library and tests, it is not quite as tidy as I think it could be (I'm quite happy to undo the commit and find a better method if you wish).

I've added a new test that creates a variable that begins with a number. I don't know a single language that allows this, so therefore ours shouldn't either.

I also added some better docs for functions. As the implementation is not yet complete, I havn't been able to add everything, but this definitely helps.

As I stated above, I have made a seperate commit that splits the code up into a main file, library, and the tests. This does not seem very clean, but for now, it's the best I can do. Again, if you can improve this or know a more efficient method, I'd be happy to undo the commit.

running 14 tests
test test_empty ... ok
test test_function_empty ... ok
test test_function_with_arg ... ok
test test_function_with_arg_and_result ... FAILED
test test_function_call_with_args ... FAILED
test test_function_call ... FAILED
test test_function_with_result ... FAILED
test test_function_with_args ... ok
test test_functions_empty ... ok
test test_variable ... FAILED
test test_variable_global_let ... ok
test test_variable_starts_with_number ... ok
test test_variable_string_with_spaces ... FAILED
test test_variable_strings_with_backslashes ... FAILED
TheOtterlord commented 4 years ago

I've reverted the Organise code commit as it was causing a lot of problems. I still think we need to seperate the code, so I may give it another go in the future.

mjarkk commented 4 years ago

About organizing the code you are deferentially right and we should change it up into multiple files :).
I think we can split up the files even more further, i'll give organizing the code a go myself.

mjarkk commented 4 years ago

Awesome i've merged it