| Age | Commit message (Collapse) | Author |
|
Also improve the setup of golangci-lint.
|
|
|
|
|
|
|
|
* fix (parser): don't panic if assign of define untyped value
In case of defining or assigning to untyped value, the type has
to be taken from the source value instead of the target value.
The vm test coverage has also been slightly improved.
* fix and simplify Token.Name()
* improve parser errors
|
|
* 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.
|
|
|
|
|
|
* chore: refactor to keep only the new parser and bytecode vm
* scanner: remove Token.value field
* scanner: remove scanner.kind field
* chore: move language specification in lang package
This avoid a cyclic dependency in scanner_test which can now use
the golang/GoSpec language specification for Go.
* clean code
* scanner: export scanner fields
Also parser now generate function calls, including externals.
* chore: fix lint issues
* parser: handle strings
* wip
* parser: implement support for 'if, else, else if' statements
Resolving labels in the compiler still in progress.
* parser: support if statements, improve compiler
* improve handling of functions
* improve support of local variables
* scanner: trim leading and trailing spaces
* fixes to make fibonacci work
* parser: improve README, fix function parameters parsing
|
|
|
|
As specified in the Go specification, adapted to the following:
- the scanner recognise blocks as tokens
- the scanner is multi-language: define keywords in scanner spec
- as a result, we define how to skip semi-colon insertion rather
than how to add it.
|
|
The scanner returns a slice of pointers to tokens instead of a
slice of tokens. The parser now pass the initial node context.
|
|
Also simplify project structure. The executable is now produced in
the root directory. Work in progress.
|
|
|
|
Refctor node kind names by concatenating category and instance, to
allow better sorting. Comments are now parsed and skipped during
generation of AST.
|
|
|
|
|
|
|
|
* scanner: handle long string delimiters
Strings now can be delimited by arbitrary sequences of characters.
It is also possible to exclude the end delimiter, as for example
required for `//` C or Go comments.
* scanner: fix handling strings within blocks
|
|
* codegen: add a bytecode generator
* cleaning scanner, parser and vm1.
|
|
The conversion to numerical values is done by the scanner so it's
only done once. This will simplify and accelerate vm0 and the code
generator.
|
|
|