Commit graph

22 commits

Author SHA1 Message Date
Erin aa854a067b Restructured project (#37)
* Separation to two crates
- `ablescript`: library, language
- `ablescript_cli` - cli: repl and executor for files

* Added lints (back) to library
- unsafe_code and unwrap_used are forbidden
2021-08-10 21:32:12 +02:00
Erin b451503a27 Obeyed clippy 2021-07-29 23:22:38 +02:00
Erin e3cfaaf32c removed unused enum variant 2021-07-29 23:04:04 +02:00
Alex Bethel 50f9bfa4c6 Eliminate type errors
Hooray, we've just made a whole class of errors impossible! :D
2021-07-16 19:03:27 -05:00
Alex Bethel a225105f09 Prettier error handling 2021-07-13 13:54:27 -05:00
Alex Bethel 1e8314b1a1 Merge branch 'feature/read' 2021-06-19 17:34:19 -05:00
Alex Bethel c1cc54be75 Merge 'feature/forty-two' into master 2021-06-19 17:32:12 -05:00
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
Alex Bethel 75938f27c0 Implement functio declaration & calling 2021-06-15 09:51:00 -05:00
Alex Bethel da9ff64486 Make arithmetic errors evaluate to 42 2021-06-12 10:48:44 -05:00
Alex Bethel a0c1f93392 Remove 0..0 placeholder from unexpected_eof() 2021-06-07 20:03:26 -05:00
Erin a5a048728c Added basic parsing
- Expressions
- If, Functio
2021-06-07 00:09:45 +02:00
Erin 93065e7dc9 AST revamp
- Unified terminology of span in error.rs
2021-06-06 23:13:48 +02:00
Alex Bethel 326d0511e7 Add Brainfuck functio interpretation
BF functios can now be declared and called from AbleScript code.
Function parameters supplied from AbleScript are serialized manually
into byte sequences using the `BfWriter` trait, and are available from
BF code using the input operator, `,`.

At the moment, BF functios simply write output to stdout, and are
therefore incapable of communicating results to the rest of the
program; this might change in the future if we can get something close
to pass-by-reference working.
2021-06-02 15:29:31 -05:00
Alex Bethel 344a11084e Add some unit tests to interpret.rs
Currently `overflow_should_not_panic` and `variable_persistence` both
fail due to bugs in the interpreter.
2021-05-30 13:32:29 -05:00
Alexander Bethel ec81ead3ea Implement break and hopback statements 2021-05-25 21:22:38 -05:00
Alexander Bethel eccc00ff81 Implement basic interpreter
Added code for interpreting parsed AbleScript expressions and
statements, and hooked it up to the REPL.
2021-05-20 18:18:01 -05:00
Erin f3779deeb5 Added parsing of conditionals 2021-04-27 13:48:56 +02:00
Erin 39a8bf6a54 Redone original parser
= implemented original features
2021-04-27 11:49:07 +02:00
Erin d2160a3a4a Added testing for base55, new identifier lexing 2021-04-27 11:09:19 +02:00
Erin cc4ec803c4 Starting work on parser improvements
- Parser should parse single expressions
2021-04-26 10:44:42 +02:00
Erin 7e0c881130 Added function/variable parsing
- Added block support
- TODO: Tidy it up
2021-04-18 22:33:55 +02:00