Skip to content

Commit

Permalink
Janet: always use var instead of def (#342)
Browse files Browse the repository at this point in the history
* Janet: always use `var` instead of `def`

* Fix ops.test.md
  • Loading branch information
dokutan authored Dec 31, 2023
1 parent 6871192 commit b501a52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/languages/janet/emit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ export default function emitProgram(program: IR.Node): TokenTree {
`Declaration cannot contain ${assignment.kind}`,
);
}
const assignKeyword =
assignment.expr.kind === "Identifier" && assignment.expr.builtin
? "def"
: "var";
const assignKeyword = "var";
return [
"(",
assignKeyword,
Expand Down
2 changes: 1 addition & 1 deletion src/programs/ops.test.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ or $x $y $z;
```

```janet nogolf
(var a 0)(var b 0)(var c 0)(def x true)(def y true)(def z true)(min a b c)(* a b c)(or x y z)
(var a 0)(var b 0)(var c 0)(var x true)(var y true)(var z true)(min a b c)(* a b c)(or x y z)
```

```js nogolf
Expand Down

0 comments on commit b501a52

Please sign in to comment.