Commit Graph

6 Commits

Author SHA1 Message Date
7be624e032 Cleaning repl
Cleaning repl, removing multi-statement repl, further implementation as
separated code from the rest

Signed-off-by: teo3300 <matteo.rogora@live.it>
2023-06-10 03:10:47 +02:00
ce21d3b728 Multi-expr repl improved
Signed-off-by: teo3300 <matteo.rogora@live.it>
2023-06-07 18:50:31 +02:00
54d196582f Oneline multi expression
Multiple expressions can be evaluated on a single line

Signed-off-by: teo3300 <matteo.rogora@live.it>
2023-06-07 14:41:12 +02:00
9d35d24cd4 Error handling and small editor
- Error handling to signal what is preventing evaluation instead of
  program crash
- Small editor feature (allow edit new
line of code to complete the previous ones instead of destroying the
input, if an empty line inserted return the error preventing evaluation
- Auto indentation on multiline input based on depth

Still does not parse multi-statement code
- This is a problem when dealing with macros: does not allow
  expressions like `'()` since the atomic `'` hides the list ().
  Need to chose between:
  - Replace `'...` with `(quote ... )` during tokenization (may be
    hard to implement macros later)
  - Allows multi-statement code (this also allows to execute multiple
    statements when reading a file)

Will probably delete auto-indentation since it breaks code's uniformity
too much
2023-06-07 00:50:06 +02:00
703b6888b5 Implementing new types
- nil symbols
- Bool
- Vectors
- Maps
2023-06-06 16:33:01 +02:00
13790d0864 Step 1: Create an AST
This step consists of creating the AST to represent the input
expression, the only evaluation done for now is the recognition of three
MalTypes for the nodes of the AST:
- Symbols: atomic isolated groups of characters
- Integers: Symbols that can be parsed as number and are treated as so
- Lists: recognizable by the presence of parentheses (only "()" for now,
  "[]" and "{}" later), these can contain any number of MalTypes

The second half of this step (much easier) is to reconstruct the
original syntax (with clean whitespaces) to check the correctness of the
process

Signed-off-by: teo3300 <matteo.rogora@live.it>
2023-06-05 23:04:51 +02:00