source-academy / js-slang

Implementations of sublanguages of JavaScript, TypeScript, Scheme and Python
https://source-academy.github.io/source/
Apache License 2.0
66 stars 104 forks source link

Implement statement sequence for the CSE machine #1575

Closed NhatMinh0208 closed 6 months ago

NhatMinh0208 commented 6 months ago

Description

This PR implements statement sequences for the CSE machine, as described in #1580. It introduces a new node type, StatementSequence, an AST transformer that converts BlockStatements and Programs without declarations into StatementSequences and adds logic to the CSE machine interpreter to handle the new node type.

Changes

coveralls commented 6 months ago

Pull Request Test Coverage Report for Build 8344121055

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/errors/moduleErrors.ts 1 2 50.0%
src/modules/errors.ts 1 2 50.0%
src/name-extractor/index.ts 2 3 66.67%
src/stdlib/parser.ts 1 2 50.0%
src/typeChecker/internalTypeErrors.ts 0 1 0.0%
src/errors/errors.ts 7 10 70.0%
src/cse-machine/utils.ts 25 30 83.33%
src/errors/typeErrors.ts 0 6 0.0%
src/utils/statementSeqTransform.ts 18 145 12.41%
<!-- Total: 152 298 51.01% -->
Files with Coverage Reduction New Missed Lines %
src/utils/astCreator.ts 1 82.52%
src/cse-machine/utils.ts 1 86.19%
<!-- Total: 2 -->
Totals Coverage Status
Change from base Build 8337328960: -0.7%
Covered Lines: 10402
Relevant Lines: 12398

💛 - Coveralls
NhatMinh0208 commented 6 months ago

wow that somehow caused zero regression

NhatMinh0208 commented 6 months ago

Barring any bugs that are not covered by tests, the CSE machine integration of StatementSequence is now complete.