Commit graph

404 commits

Author SHA1 Message Date
Alex Bethel eee173060c Implement read semantics in interpreter
Also added a test file `iotest.able` to just read data and print
it (the `cat` of AbleScript I guess).
2021-06-18 16:05:50 -05:00
Erin 3edbca51d5 Implemented read in Parser 2021-06-18 20:28:53 +02:00
Alex Bethel 430f0c2b90 Forbid use of unwrap w/ clippy 2021-06-16 10:36:52 -05:00
Alex Bethel 4011997e60 Clippy conformance 2021-06-16 10:35:06 -05:00
Alex Bethel cdb4a22443 Add --debug option for printing AST 2021-06-16 10:29:27 -05:00
Alex Bethel 098137082e Better error messages, remove debug AST printing 2021-06-16 10:25:55 -05:00
Alex Bethel 2e5799d9e6 Remove quotes around rickroll string
They're not necessary, because the `rickroll` file is already included
as a string.
2021-06-15 11:47:39 -05:00
Alex Bethel 9965d97713 Fix ignored unit tests in interpret.rs 2021-06-15 11:46:01 -05:00
Alex Bethel d1064802ec Fix unit tests 2021-06-15 11:29:52 -05:00
Alex Bethel 8aa6fc502a rustfmt: whoops, let's put a semicolon there
maybe I should have actually looked at what rustfmt produced before I
just blindly accepted it and pushed it onto master.
2021-06-15 10:26:44 -05:00
Alex Bethel 7bf3cc6f5d rustfmt: break long line 2021-06-15 10:24:50 -05:00
Alex Bethel ae0955209c Use pass-by-reference for variables, pass-by-value for expressions 2021-06-15 09:51:00 -05:00
Alex Bethel 66d4f4f82d Implement most of pass-by-reference
We need some parser changes to make it work fully: function arguments
are now identifiers rather than expressions.
2021-06-15 09:51:00 -05:00
Alex Bethel 4b0aa1602b Lack of else statements is intentional 2021-06-15 09:51:00 -05:00
Alex Bethel d80c138735 Improve pass-by-reference test 2021-06-15 09:51:00 -05:00
Alex Bethel d59b75fdb3 Add pass-by-reference test (doesn't work yet)
Also rename the "hello_world.able" test to "hello-world.able" for
consistency.
2021-06-15 09:51:00 -05:00
Alex Bethel 75938f27c0 Implement functio declaration & calling 2021-06-15 09:51:00 -05:00
Able c2de1f6411 Merge pull request #33 from HTG-YT/master 2021-06-15 04:39:07 -05:00
HTG-YT aa72945010 comply with the move of rickroll 2021-06-14 20:53:27 +08:00
HTG-YT 26df745dee move rickroll to src/ folder 2021-06-14 20:52:38 +08:00
HTG-YT 953128887b Update rickroll 2021-06-14 09:42:38 +08:00
HTG-YT b526d5c575 move rickroll content into a file 2021-06-14 09:42:23 +08:00
HTG-YT 712e6cef67 Create rickroll 2021-06-14 09:41:20 +08:00
HTG-YT 72e48d1b86 rustfmt: add trailing comma 2021-06-14 09:40:42 +08:00
HTG-YT 327466cddc Merge branch 'AbleCorp:master' into master 2021-06-14 09:40:00 +08:00
Erin 93289e02f1 Added build staus badge 2021-06-13 18:43:09 +02:00
Erin 232595c1be Added CI config
Rust Template
2021-06-13 18:14:41 +02:00
Erin f62bab110f Update README.md 2021-06-13 18:12:21 +02:00
HTG-YT 227fa8e35b handle Token::Rickroll in parser 2021-06-13 13:24:09 +08:00
HTG-YT fa0d3968f5 Update interpret.rs 2021-06-13 13:22:30 +08:00
HTG-YT 3646c5e32e handle StmtKind::Rickroll 2021-06-13 13:22:01 +08:00
HTG-YT 286a12b28e add StmtKind::Rickroll 2021-06-13 13:11:51 +08:00
HTG-YT 855383faac add rickroll lexeme in lexer 2021-06-13 13:11:02 +08:00
Alex Bethel da9ff64486 Make arithmetic errors evaluate to 42 2021-06-12 10:48:44 -05:00
Alex Bethel 92e0a22e24 Integrate const.rs as consts 2021-06-12 10:45:25 -05:00
Alex Bethel 976518a251 Reimplement BF function declaration semantics 2021-06-12 09:26:21 -05:00
Erin ff04c34cf6 Better comment 2021-06-11 19:44:53 +02:00
Erin 183c584e96 Removed todo when unknown token 2021-06-11 18:34:34 +02:00
Erin 3d7c89634e Fixed invalid spanning of UnexpectedToken in parse_expr 2021-06-11 18:31:25 +02:00
Erin 3bcef28843 BF code is now Vec<u8> 2021-06-11 18:10:11 +02:00
Erin 711ad27e00 Basic BfFunctio support 2021-06-11 17:52:47 +02:00
Alex Bethel 41316f5696 Re-enable assignment semantics 2021-06-11 10:05:48 -05:00
Erin 6f16d2594b Added variable assignment to parser
- Fixed parse error, that `rlyeh` returned HopBack
2021-06-11 16:59:40 +02:00
Erin 851f04c653 Merge pull request #29 from HTG-YT/interpreter-fixes
add `interessant`, `nevergonnagiveyouup` and `funny` constants
2021-06-11 09:33:48 +02:00
HTG-YT dd28ff985f add nevergonnagiveyouup constant 2021-06-11 15:26:30 +08:00
HTG-YT 77749bc32b add interessant and funny constants 2021-06-11 15:19:27 +08:00
Alex Bethel 7d7c1e4a1b Fix interpreter variable persistence bug 2021-06-08 19:21:33 -05:00
Alex Bethel dc5ef63fef Better error handling in REPL
We have much better spanned expression support, so now we get to show
it off!
2021-06-07 20:08:38 -05:00
Alex Bethel a0c1f93392 Remove 0..0 placeholder from unexpected_eof() 2021-06-07 20:03:26 -05:00
Alex Bethel ce20611c07 Fix all 0..0 span placeholders in interpret.rs 2021-06-07 19:57:44 -05:00