summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
5 daysfeat: add support for range clause and iteratorsMarc Vertes
- vm: added Pull, Next and Stop instructions, to implement iterators - lang: add Range, Next and Stop tokens - parser: handle range clause. Still naive and incomplete. - comp: generate iterator instructions from range clause. Work in progress. Only initial support for slices. Many more tests and combinations needed, but the main pattern is there now.
10 daysfeat: handle slice expressionsMarc Vertes
12 daysfix: improve handling of indirectionsMarc Vertes
Added 2 VM instructions, FnewE variant of Fnew with a dereference, and FieldE, variant of Field with dereference. It's now possible to pointers in structs and literal composites.
13 daysfix: improve literal composite on nested typesMarc Vertes
2026-01-11fix: handle assign statements on map elementsMarc Vertes
A new token MapAssign is added to implement assignements involving a map, slice or array, an index key expression and a value expression.
2026-01-09feat: initial support for mapsMarc Vertes
2026-01-08fix: improve composite literal for slicesMarc Vertes
2026-01-07fix: improve handling of composite literal struct expressionsMarc Vertes
2026-01-07fix: set 'HasInit' token property in language definitionMarc Vertes
2026-01-06fix: vm testMarc Vertes
2026-01-06Merge branch 'main' of git.vertes.org:git/parscanMarc Vertes
2026-01-06fix: correct and simplify parsing of expressions.Marc Vertes
The expressions were parsed from right to left, and it was incorrect and cumbersome. Now they are processed from left to right, with a simpler and correct handling of precedence rules. The vm function call syntax has been changed to set the function before the input arguments on the stack, as to follow the declaring order in languages.
2025-12-19fix lang: attribute properties to tokens, not stringsMarc Vertes
2025-12-04chore: move symbol types and functions in its own package.Marc Vertes
2025-12-03feat: support literal struct expressions with keyed elementsMarc Vertes
2025-12-02feat: 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.
2025-11-29chore: shorter name for packages, simpilfy vm valuesMarc Vertes
2025-11-28doc: improve comments, pass lintMarc Vertes
Also improve the setup of golangci-lint.
2025-11-27fix: 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.
2025-11-27chore: mv parser/interpreter.go interpreter/Marc Vertes
2025-11-27chore: 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