Skip to content

Conversation

@vuvoth
Copy link
Owner

@vuvoth vuvoth commented Feb 2, 2025

Context

Use Insta for test circom syntax parse. Flow:

  • Build a printer for a syntax tree.
  • Use a snapshot to save the format of a syntax tree.
  • Build a macro to make the test process simple.

Signed-off-by: Vu Vo <vu.voth@gmail.com>
Signed-off-by: Vu Vo <vu.voth@gmail.com>
@vuvoth vuvoth requested a review from NTTVy03 February 2, 2025 15:06
Signed-off-by: Vu Vo <vu.voth@gmail.com>
@NTTVy03 NTTVy03 merged commit 1a767d6 into master Feb 3, 2025
1 check passed
NTTVy03 added a commit that referenced this pull request Feb 3, 2025
NTTVy03 added a commit that referenced this pull request Feb 3, 2025
NTTVy03 added a commit that referenced this pull request Feb 3, 2025
NTTVy03 added a commit that referenced this pull request Feb 3, 2025
vuvoth pushed a commit that referenced this pull request Feb 6, 2025
* skip trivial first tokens in parsing

* remove comment in input test

* manage out-of-bound case, update input test

* update input test

* update input test

* make test programs private

* remove comments in syntax tests

* format

* make Pragma optional, remove ROOT

* rename close() params, use advance() in eat(), fix typo scope

* parse params using list_identity

* return Option in token_value() and position_of()

* do not allow <--, <== in var declaration

* make public signal optional in main component

* fix format before merge

* remove empty test

* replace expect by eat in block

* add scope parsing test

* fix space in scope parsing test

* update snapshot test for syntax

* refactor syntax test

* update input tests with snapshot

* change param type in find signal into str

* add snapshot guild

* add some combine arithmetic operators

* error report in expect and expect_any

* update snapshot for combine operators

* update snapshot test

* fix wrap trivial tokens before open a tree

* update template happy test

* add operators into token kinds

* add operators test

* re-priority token kinds

* fix clippy check

* fix clippy check

* rebase add-token-kinds

* fix clippy check

* fix clippy

* remove duplicate declaration in grammar tests

* add missing signal assign tokens

* fix grammar of for statement

* add statements test

* fix declaration, support matrix

* fix format

* refactor declaration

* use list identity parser in tuple

* fix right curly count in block

* extract function params

* add declaration test

* remove duplicate else in comment

* replace eat by expect for curly in block

* comment statement in declaration test

* fix format

* merge master after PR #68

* add snapshot for goto_definition test

* allow \r in EndLine token

* add ExpressionAtom token

* group identifer in var, signal, component declaration

* format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants