summaryrefslogtreecommitdiff
path: root/parser/expr.go
AgeCommit message (Collapse)Author
2024-04-02chore: add linters and some lint fixes (#8)Marc Vertes
* 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.
2024-03-22feat: add initial support for import, provide minimal fmt (#6)Marc Vertes
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.
2024-03-14feat: improve debug output of tokensMarc Vertes
2024-03-14Merge branch 'main' of github.com:mvertes/parscanMarc Vertes
2024-03-14feat: initial support of closuresMarc Vertes
Also detection and automatic execution of main function. Make sure that all debug is output to stderr.
2024-03-13Merge pull request #5 from ajnavarro/fix/small-fixesMarc Vertes
Fix: small README fixes and throw an error if expression not supported.
2024-03-12Fix: small README fixes and throw an error if expression not supported.Antonio Navarro Perez
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2024-01-15chore: import from gnolangMarc Vertes
2023-11-20parser: add pointer support (work in progress)Marc Vertes
This is incomplete because the scalar variables are not addressable right now. To be addressable they must be represented as reflect values, not interfaces.
2023-11-20parser: add support for unary operatorsMarc Vertes
2023-11-20parser: add support for slices and arrays, parse index expressionsMarc Vertes
2023-11-17parser: support selector expression to get / set struct fieldsMarc Vertes
The structures are reresented by reflect values. New instructions `Field` and `Vassign` have been added to the VM to assign reflect values and access struct fields.
2023-11-15parser: parse struct type declarationsMarc Vertes
Recursive structs and embedded structs are not supported yet.
2023-11-04fix: skip parsing empty expressionMarc Vertes
2023-11-03feat: add support for control flow operators in expressionsMarc Vertes
Logical operators `&&` (and), `||` (or) are now parsed in expressions. The control flow tokens (labels, conditional jumps) are added accordingly.