Skip to content

Commit

Permalink
Identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
qti3e committed Aug 3, 2019
1 parent 3e5245a commit 1d1be72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jsc/src/gen.ts
Expand Up @@ -73,6 +73,10 @@ function visit(writer: Writer, node: estree.Node): void {
}
break;

case "Identifier":
writer.write(ByteCode.Named, node.name);
break;

default:
// TODO(qti3e)
writer.write(ByteCode.TODO);
Expand Down
4 changes: 3 additions & 1 deletion jsc/src/play.ts
Expand Up @@ -3,12 +3,14 @@ import { gen } from "./gen";
import { dump } from "./dump";

function main() {
const source = "true || 'hello world is there any thing'";
const source = "a * 1";

const node = parse(source);
console.log(JSON.stringify(node, null, 4));

const ret = gen(node as any);

console.log("\n\nSource:```\n" + source + "\n```");
console.log(dump(ret));
}

Expand Down

0 comments on commit 1d1be72

Please sign in to comment.