Skip to content

Commit

Permalink
remove some features from python
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalMarsalek committed Mar 11, 2024
1 parent bf45d20 commit 4e56b69
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/languages/python/emit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ export class PythonEmitter extends PrecedenceVisitorEmitter {
return prop === "object"
? Infinity
: prop === "collection" &&
(kind === "IndexCall" || kind === "RangeIndexCall")
? Infinity
: kind === "ConditionalOp"
? this.prec(parent) + (prop === "alternate" ? 0 : 1)
: kind === "Infix"
? prop === "left"
? this.prec(parent) + (parent.name === "**" ? 1 : 0)
: this.prec(parent) + (parent.name === "**" ? 0 : 1)
: kind === "Prefix" || kind === "Postfix"
? this.prec(parent)
: -Infinity;
(kind === "IndexCall" || kind === "RangeIndexCall")
? Infinity
: kind === "ConditionalOp"
? this.prec(parent) + (prop === "alternate" ? 0 : 1)
: kind === "Infix"
? prop === "left"
? this.prec(parent) + (parent.name === "**" ? 1 : 0)
: this.prec(parent) + (parent.name === "**" ? 0 : 1)
: kind === "Prefix" || kind === "Postfix"
? this.prec(parent)
: -Infinity;
}

visitNoParens(n: Node, spine: Spine, context: CompilationContext) {
Expand All @@ -137,7 +137,7 @@ export class PythonEmitter extends PrecedenceVisitorEmitter {
spine.isRoot || containsMultiNode(n.children) ? "\n" : ";",
);
case "Import":
return [n.name, joinTrees(",", n.modules)];
throw new Error();
case "While":
return [`while`, $.condition, ":", multiNode($.body)];
case "ForEach":
Expand Down

0 comments on commit 4e56b69

Please sign in to comment.