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 3904d6ef74 Fix couple of linting problems 2021-01-15 20:48:56 +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 c2d4273319 [Bootstrap] Fix the order and location on the traceback
In order to fix this issue I had to make many minor tweaks
including reordering the traceback and the way we pass down
nodes.
2021-01-07 19:45:07 +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 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 52fa298a07 Add PrintError function to print out the IError values 2020-11-24 18:39:18 +00:00
Sameer Rahmani ad37f02742 Restructure the source tree to get around circular dep issue 2020-11-15 22:16:48 +00:00
Sameer Rahmani 38baf577bb Move reader and printer packages to the core package 2020-11-15 19:33:16 +00:00
Renamed from bootstrap/pkg/printer/printer.go (Browse further)