Skip to content

Commit d9ffc84

Browse files
committed
Attempt to reinstate Value [failed](Refs #51)[3]
* Updated compilerOptions in tsconfig.json - target: es2016 -> es2020 Reason: support for bigInt(0n) * stash.ts - Reintroduce Value to be passed to visitors in pyvisitor Updates: Failed lol, major changes that affects stdlib in src Temp solution: fallback to Value : any in /cse-machine/stash.ts for now * py_operators.ts - introduce bool for integers, string, None (evaluteUnaryExpression) * py_operator.ts refactored {evaluateBinaryExpression} - cleaner sequence Operands: String -> Complex -> Mixed Float&/Int (arithmetic -> comparisons) -> Integers only * py_visitor.ts: added visitComplexExpr
1 parent b9226ca commit d9ffc84

File tree

6 files changed

+320
-277
lines changed

6 files changed

+320
-277
lines changed

src/cse-machine/py_interpreter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CSEBreak, Representation, Result, Finished } from "../types";
33
import { StmtNS } from "../ast-types";
44
import { Value, ErrorValue } from "./stash";
55
import { PyVisitor } from "./py_visitor";
6+
import { toPythonString } from "../stdlib";
67

78
type Stmt = StmtNS.Stmt;
89

@@ -15,7 +16,7 @@ export function PyCSEResultPromise(context: Context, value: Value): Promise<Resu
1516
const representation = new Representation(errorValue.message);
1617
resolve({ status: 'finished', context, value, representation } as Finished);
1718
} else {
18-
const representation = new Representation(value);
19+
const representation = new Representation(toPythonString(value));
1920
resolve({ status: 'finished', context, value, representation } as Finished);
2021
}
2122
});

0 commit comments

Comments
 (0)