Skip to content

Commit f10d5a1

Browse files
committed
Comparisons in if statements working
1 parent ba6d510 commit f10d5a1

File tree

5 files changed

+684
-44
lines changed

5 files changed

+684
-44
lines changed

.idea/misc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/src/main/java/dev/ultreon/pythonc/AbstractContext.java

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public void push(Type type) {
2020

2121
@Override
2222
public Type pop() {
23+
if (stack.isEmpty()) throw new RuntimeException("Stack is empty");
2324
Type pop = stack.pop();
2425
if (pop.equals(Type.LONG_TYPE) || pop.equals(Type.DOUBLE_TYPE)) stack.pop();
2526
return pop;

compiler/src/main/java/dev/ultreon/pythonc/FuncCall.java

+1
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ private String argDesc(PythonCompiler compiler, Object callArgs) {
570570
case PyObjectRef objectRef -> owner(compiler).getDescriptor();
571571
case FuncCall funcCallWithArgs -> funcCallWithArgs.type(compiler).getDescriptor();
572572
case PyConstant pyConstant -> pyConstant.type.type.getDescriptor();
573+
case PyExpr expr -> expr.type(compiler).getDescriptor();
573574
case null, default -> {
574575
if (o != null) {
575576
throw new RuntimeException("argument not supported with type " + o.getClass().getSimpleName() + " for:\n" + arguments.getText());

0 commit comments

Comments
 (0)