summaryrefslogtreecommitdiff
path: root/src/www/syntax-editor/ast.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/www/syntax-editor/ast.js')
-rw-r--r--src/www/syntax-editor/ast.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/www/syntax-editor/ast.js b/src/www/syntax-editor/ast.js
index 50c417e96..698272228 100644
--- a/src/www/syntax-editor/ast.js
+++ b/src/www/syntax-editor/ast.js
@@ -73,6 +73,7 @@ function AST(fun, cat) {
return new ASTNode({
"fun": fun,
"cat": cat,
+ "string": "", // for String literals
"deps": {}, // dependent types
"children": []
});
@@ -304,7 +305,10 @@ function AST(fun, cat) {
this.toString = function() {
var s = "";
function visit(node) {
- s += node.fun ? node.fun : "?" ;
+ if (node.cat == "String")
+ s += '"' + ((node.string) ? node.string : "") + '"';
+ else
+ s += node.fun ? node.fun : "?" ;
if (!node.hasChildren())
// if (node.children.length == 0)
return;