feat: reset visits function #7
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new built-in function,
resetVisits, to the Arcscript interpreter and updates the testing framework to validate event emissions. The main changes include implementing theresetVisitsfunction, updating the interpreter and state management to support event callbacks, and expanding test coverage for the new functionality. There are also improvements to the ESLint configuration and dependencies.Arcscript Interpreter Enhancements:
resetVisitstoArcscriptFunctions, which resets all visit counters and emits aresetVisitsevent. (JavaScript/src/ArcscriptFunctions.js[1]JavaScript/src/ArcscriptState.js[2]grammar/ArcscriptLexer.g4[3]ArcscriptState,ArcscriptVisitor, andInterpreterclasses to accept anemit/eventHandlercallback, enabling event-driven functionality such as emitting events when visits are reset. (JavaScript/src/ArcscriptState.js[1] [2];JavaScript/src/ArcscriptVisitor.js[3];JavaScript/src/antlr4.interpreter.js[4] [5]Testing Improvements:
eventsfield in test cases and asserting that the event handler is called with the correct arguments. (JavaScript/__tests__/antlr4.interpreter.spec.js[1] [2]resetVisitstovalid.jsonto ensure correct behavior and event emission. (JavaScript/__tests__/valid.jsonJavaScript/tests/valid.jsonR390-R405)Tooling and Configuration:
@jest/globalsas a development dependency for improved Jest support. (JavaScript/package.jsonJavaScript/package.jsonR43)import/no-extraneous-dependenciesfor test files, improving code quality and dependency management. (JavaScript/package.jsonJavaScript/package.jsonL103-R114)