Commit Graph

14 Commits

Author SHA1 Message Date
Sameer Rahmani 3f554445d8 Fix some the linters problems reported by the golang-cli 2021-01-22 20:37:44 +00:00
Sameer Rahmani f2241cc31f [Bootstrap] Add E0003 and the MakeRuntimeError to cover for MakeError 2021-01-10 18:30:48 +00:00
Sameer Rahmani c30c93442b [Bootstrap] Update the printer functions to enhace the traceback visuals 2021-01-10 17:03:52 +00:00
Sameer Rahmani e4001e3802 [Bootstrap] Add a basic PrintError function to print error messages with the traceback 2021-01-03 23:42:49 +00:00
Sameer Rahmani 9be27c124a [Bootstrap] Use Serene itself to load and run the main function
This commit consist a series of fixes to make the reach the main
goal of the commit:

* Fix the 'MakeNodeFromExprs' behavior so it returns a pointer
  to a node and if the number of input exprs is zero then nil.

* Fix all the eval loop to return immediately in case of any error
  duh!

* Add a `errtype` field to `Error` with an `ErrType` enum type
  that indicates the type of the error, the type being syntax,
  semantic and runtime error at the moment.

* Rename some of the Error functions to match the error type. For
  Exapmle `MakeSyntaxError` and `MakeSemanticError`
2021-01-02 21:04:35 +00:00
Sameer Rahmani e895377811 [Bootstrap] Update the call stack to container the caller and add a line index to the parser 2021-01-01 19:13:49 +00:00
Sameer Rahmani 9d106d4278 Record the caller details in the stack frame 2020-12-30 17:50:00 +00:00
Sameer Rahmani 699483e249 Add support for printable strings and 'pr', 'prn' functionalities.
Add 'pr' and 'prn' functions to print out the representation of an
string and 'print' and 'println' to print out the string.
2020-12-24 16:28:12 +00:00
Sameer Rahmani 578a771fa3 Improve the documentation of the bootstrap 2020-12-16 18:57:54 +00:00
Sameer Rahmani 572899318f Add 'SetNode' support to IError interface 2020-12-12 20:28:32 +00:00
amirrezaask 2143938705 add wrapped error 2020-12-05 14:43:49 +03:30
amirrezaask b37afd25d4 add .Error method to error struct 2020-12-05 13:37:04 +03:30
Sameer Rahmani 688d169286 Add the `let` special form alongside with locatable errors
Add the `let` sform not in the triditional way. In our case
the let scope is available to the bindings. Similar to clojure's let
and let* in triditional sense.

Also add the function `MakeErrorFor` which gets an extra arg, an
`IExpr` and returns an error with the location of that expression.
2020-11-25 19:19:48 +00:00
Sameer Rahmani eea65489c8 Add True/False values 2020-11-24 18:27:59 +00:00