| Age | Commit message (Collapse) | Author |
|
|
|
Use 'unsafe' to modify private struct fields, allowing to keep
unmodified field names: before they were prefixed with a capital.
Parse package statement. Provide a also a default package name for
REPL and tests. The support of packages is still incomplete.
|
|
A new `Composite` token is created. Literal composite expressions
are recognized and partially handled by the parser but not yet
by the code generator.
Other cosmetic changes are present.
|
|
* chore: add linters and some lint fixes
Configure some golangci-lint linters to get the code quality right.
Apply the first fixes.
Next step will be to add github actions to run lint and tests in
github CI.
* chore: more lint, fixed comments and variable names. no semantic change.
* chore: add Makefile
This makefile is intended to be used as a local substitute to github
actions.
|
|
The `import` statement is now parsed. It only provides minimal
support for the `fmt` package (only `Println` symbol is defined).
This should be sufficient to pass a few tests.
Full support of package namespaces, source and binary imports will be
supported later, based on this work.
|
|
Type and Value types in vm package are now used in place of reflect.Type
and reflect.Value. It allows to remove the dependency on reflect for
parser and compiler packages.
The main purpose of Type is to provide a solution to implement recursive
structs, named types, interfaces and methods, despite the limitations of
Go reflect. The goal is to provide the thinnest layer around reflect.
|
|
|
|
A 'New' instruction is added in VM to manage initialisation
of typed variables in the stack. The instantiated type symbols
are now added to global data. Accessing and setting values by
address is now working.
|
|
Recursive structs and embedded structs are not supported yet.
|
|
Only symbols are produced, no bytecode is emitted. The constant
expressions are evaluated at compile time using the stdlib package
go/constant. The parser handles implicit repetition of the last
non-empty expression list. The iota symbol is reset to 0 and
incremented for each line of a const block.
To be done in a next commit: type conversions.
|
|
The parsing logic for type declarations is there. Note that no
tokens are produced, only symbols. The different type kinds will
be added next.
|
|
The full Go syntax is supported, blocks or line,
mutiple comma separated variables, assignments.
In local and global frame.
|