Skip to content
Snippets Groups Projects
Commit d1292b59 authored by Thomas Wood's avatar Thomas Wood
Browse files

esprima-to-ast: Fix more missed identifier translations

parent ba3c34b3
No related branches found
No related tags found
No related merge requests found
......@@ -18,8 +18,6 @@ function esprimaToAST(prog) {
stop: {line: pos.end.line, col: pos.end.column}};
};
var id = function (i) { return i; }
var toOption = function (funcTr, node) {
var option = { type: "option" };
if (node === null) {
......@@ -48,7 +46,7 @@ function esprimaToAST(prog) {
option.tag = "Coq_label_empty";
} else {
option.tag = "Coq_label_string";
option.value = label;
option.value = trIdentifier(label);
}
return option;
};
......@@ -223,7 +221,7 @@ function esprimaToAST(prog) {
r.else_branch = toOption(trStat, stat.alternate);
} else if (stat.type === "LabeledStatement") {
r.tag = "Coq_stat_label";
r.label = stat.label;
r.label = trIdentifier(stat.label);
r.stat = trStat(stat.body);
} else if (stat.type === "BreakStatement") {
r.tag = "Coq_stat_break";
......@@ -355,7 +353,7 @@ function esprimaToAST(prog) {
} else if (expr.type === "FunctionExpression") {
checkFuncExpr(expr);
r.tag = "Coq_expr_function";
r.func_name_opt = toOption(id, expr.id);
r.func_name_opt = toOption(trIdentifier, expr.id);
r.arg_names = toList(expr.params.map(trPattern));
r.body = trBlockStatAsFuncbody(expr.body);
// TODO: USE STRICT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment