summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
7 dayschore: move symbol types and functions in its own package.HEADmainMarc Vertes
7 daysfeat: support literal struct expressions with keyed elementsMarc Vertes
8 daysfeat: support of struct literal compositeMarc Vertes
Added missing vm instructions to allocate a typed value on the stack and to set a structure field. It's possible now to generate struct literal composites for non keyed struct fields.
11 dayschore: shorter name for packages, simpilfy vm valuesMarc Vertes
12 daysdoc: improve comments, pass lintMarc Vertes
Also improve the setup of golangci-lint.
14 daysfix: improve parser, compiler and interpreter APIsMarc Vertes
Pass a language spec as an argument when create a new parser, compiler or interpreter. Also move the REPL code in interpreter package.
14 dayschore: mv parser/interpreter.go interpreter/Marc Vertes
14 dayschore: move compiler and interpreter in their own packagesMarc Vertes
2025-11-26Chore: improve tracing of code emitsMarc Vertes
2025-11-16fix lintMarc Vertes
2025-11-15chore: update ci lintMarc Vertes
2025-11-14fix: refactor VM instruction typeMarc Vertes
Use custom types for VM instructions. More idiomatic code for tracing.
2025-11-13chore: include more packages in test coverageMarc Vertes
2025-11-10chore: fix lintMarc Vertes
2025-03-03chore: fix lintMarc Vertes
2025-03-03fix: improve structparscan-structMarc Vertes
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.
2024-07-18fix (parser): don't panic if assign of define untyped value (#10)Marc Vertes
* 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
2024-06-10chore: use latest golangci-lintMarc Vertes
2024-06-10chore: github action add test coverMarc Vertes
2024-06-10chore: add golangci-lint to github actionsMarc Vertes
2024-06-05Create go.ymlMarc Vertes
2024-04-23feat: initial and partial support of composite expressions (#9)Marc Vertes
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.
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-21Merge pull request #7 from ajnavarro/feature/simple-memory-dumpMarc Vertes
feat: Add simple Dump creation and recovery.
2024-03-21Add extra GoDoc to explain why Dump is on the Compiler.Antonio Navarro Perez
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2024-03-20feat: Add simple Dump creation and recovery.Antonio Navarro Perez
Memory Dump functionality that can restore the previous VM state. It dumps *global* variables, the only ones defining the program state. The dump depends on the program itself, and on the index system, which right now is defined by the variable order. Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
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-13Update vm/README.mdAntonio Navarro Perez
Co-authored-by: Marc Vertes <mvertes@free.fr>
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-03-12Merge pull request #4 from mvertes/fix-no-return-funcMarc Vertes
fix: force a return at end of function
2024-03-12fixupMarc Vertes
2024-03-12fix: force adding a return at end of functionMarc Vertes
This will avoid infinite loops, and is necessary for functions with no returned values. This doesn't remove the need to better check the consistency of return statements in general.
2024-03-11fix callX, update readmeMarc Vertes
2024-03-11Merge pull request #2 from mvertes/vm-typeMarc Vertes
feat: add type representation in vm package
2024-03-08feat: add type representation in vm packageMarc Vertes
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.
2024-01-23Merge pull request #1 from ajnavarro/proposal/vm-state-managementMarc Vertes
Add PIPs prpoposal and state management proposal
2024-01-18Remove vm state managementAntonio Navarro Perez
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2024-01-15chore: import from gnolangMarc Vertes
2024-01-15Add PIPs prpoposal and state management proposalAntonio Navarro Perez
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2023-11-24parser: fix allocation of local variablesMarc Vertes
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.
2023-11-24vm: use only reflect.Values (WIP)Marc 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.