mirror of https://gitlab.com/basile.b/dexed.git
symlist, use iz mem utils to format function names.
This commit is contained in:
parent
fa5d8861e8
commit
e1453c0ebf
|
@ -4,9 +4,9 @@ import
|
||||||
std.stdio, std.array, std.traits, std.conv, std.json, std.format,
|
std.stdio, std.array, std.traits, std.conv, std.json, std.format,
|
||||||
std.algorithm;
|
std.algorithm;
|
||||||
import
|
import
|
||||||
iz.memory;
|
iz.memory, iz.containers;
|
||||||
import
|
import
|
||||||
dparse.lexer, dparse.ast, dparse.parser;
|
dparse.lexer, dparse.ast, dparse.parser, dparse.formatter : Formatter;
|
||||||
import
|
import
|
||||||
common;
|
common;
|
||||||
|
|
||||||
|
@ -74,6 +74,8 @@ class SymbolListBuilder(ListFmt Fmt): ASTVisitor
|
||||||
static JSONValue* jarray;
|
static JSONValue* jarray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Array!(char) funcNameApp;
|
||||||
|
static Formatter!(typeof(&funcNameApp)) fmtVisitor;
|
||||||
static uint utc;
|
static uint utc;
|
||||||
|
|
||||||
this(bool deep)
|
this(bool deep)
|
||||||
|
@ -94,6 +96,7 @@ class SymbolListBuilder(ListFmt Fmt): ASTVisitor
|
||||||
json = parseJSON("[]");
|
json = parseJSON("[]");
|
||||||
jarray = &json;
|
jarray = &json;
|
||||||
}
|
}
|
||||||
|
fmtVisitor = construct!(typeof(fmtVisitor))(&funcNameApp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void addAstErrors(AstErrors errors)
|
static void addAstErrors(AstErrors errors)
|
||||||
|
@ -156,10 +159,9 @@ class SymbolListBuilder(ListFmt Fmt): ASTVisitor
|
||||||
if (dt.parameters && dt.parameters.parameters &&
|
if (dt.parameters && dt.parameters.parameters &&
|
||||||
dt.parameters.parameters.length)
|
dt.parameters.parameters.length)
|
||||||
{
|
{
|
||||||
import dparse.formatter : fmtNode = format;
|
funcNameApp.length = 0;
|
||||||
Appender!string app;
|
fmtVisitor.format(dt.parameters);
|
||||||
fmtNode(&app, dt.parameters);
|
pasStream.put(format("name='%s%s'\r", dt.name.text, funcNameApp[]));
|
||||||
pasStream.put(format("name='%s%s'\r", dt.name.text, app.data));
|
|
||||||
}
|
}
|
||||||
else pasStream.put(format("name='%s'\r", dt.name.text));
|
else pasStream.put(format("name='%s'\r", dt.name.text));
|
||||||
}
|
}
|
||||||
|
@ -187,9 +189,9 @@ class SymbolListBuilder(ListFmt Fmt): ASTVisitor
|
||||||
dt.parameters.parameters.length)
|
dt.parameters.parameters.length)
|
||||||
{
|
{
|
||||||
import dparse.formatter : fmtNode = format;
|
import dparse.formatter : fmtNode = format;
|
||||||
Appender!string app;
|
funcNameApp.length = 0;
|
||||||
fmtNode(&app, dt.parameters);
|
fmtVisitor.format(dt.parameters);
|
||||||
item["name"] = JSONValue(dt.name.text ~ app.data);
|
item["name"] = JSONValue(dt.name.text ~ app.funcNameApp[]);
|
||||||
}
|
}
|
||||||
else item["name"] = JSONValue(dt.name.text);
|
else item["name"] = JSONValue(dt.name.text);
|
||||||
}
|
}
|
||||||
|
|
2
etc/iz
2
etc/iz
|
@ -1 +1 @@
|
||||||
Subproject commit f5143575b7984001e71e8c1d88db9478167c410b
|
Subproject commit fbf5056f7b59da4ac60df8722ee0ce42a6bc2e1c
|
|
@ -1 +1 @@
|
||||||
Subproject commit 7887ba3665a05a54e511850d009f8f999f89d97d
|
Subproject commit a2b492d8c7a84881657de85939d9c6b14f867d5b
|
Loading…
Reference in New Issue