mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-06 09:42:50 -06:00
Syntax editor: initial support for string literals
Also a bug fix when switching to editor, although this still messes up when using the letters grammar. Also updated readme with options, and some style improvements.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user