cleanup
This commit is contained in:
+2
-8
@@ -36,14 +36,6 @@ inline void newline(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void stringify(
|
|
||||||
const Value& value,
|
|
||||||
std::stringstream& ss,
|
|
||||||
int indent,
|
|
||||||
const std::string& indentstr,
|
|
||||||
bool nice
|
|
||||||
);
|
|
||||||
|
|
||||||
void stringifyObj(
|
void stringifyObj(
|
||||||
const Map* obj,
|
const Map* obj,
|
||||||
std::stringstream& ss,
|
std::stringstream& ss,
|
||||||
@@ -91,6 +83,8 @@ void stringifyValue(
|
|||||||
ss << *num;
|
ss << *num;
|
||||||
} else if (auto str = std::get_if<std::string>(&value)) {
|
} else if (auto str = std::get_if<std::string>(&value)) {
|
||||||
ss << util::escape(*str);
|
ss << util::escape(*str);
|
||||||
|
} else {
|
||||||
|
ss << "null";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,11 +47,9 @@ public:
|
|||||||
|
|
||||||
ArgType parseType() {
|
ArgType parseType() {
|
||||||
if (peek() == '[') {
|
if (peek() == '[') {
|
||||||
std::cout << "type.name: enum" << std::endl;
|
|
||||||
return ArgType::enumvalue;
|
return ArgType::enumvalue;
|
||||||
}
|
}
|
||||||
std::string name = parseIdentifier(false);
|
std::string name = parseIdentifier(false);
|
||||||
std::cout << "type.name: " << name << std::endl;
|
|
||||||
auto found = types.find(name);
|
auto found = types.find(name);
|
||||||
if (found != types.end()) {
|
if (found != types.end()) {
|
||||||
return found->second;
|
return found->second;
|
||||||
@@ -107,12 +105,10 @@ public:
|
|||||||
Argument parseArgument() {
|
Argument parseArgument() {
|
||||||
std::string name = parseIdentifier(false);
|
std::string name = parseIdentifier(false);
|
||||||
expect(':');
|
expect(':');
|
||||||
std::cout << "arg.name: " << name << std::endl;
|
|
||||||
ArgType type = parseType();
|
ArgType type = parseType();
|
||||||
std::string enumname = "";
|
std::string enumname = "";
|
||||||
if (type == ArgType::enumvalue) {
|
if (type == ArgType::enumvalue) {
|
||||||
enumname = parseEnum();
|
enumname = parseEnum();
|
||||||
std::cout << "enum: " << enumname << std::endl;
|
|
||||||
}
|
}
|
||||||
bool optional = false;
|
bool optional = false;
|
||||||
dynamic::Value def {};
|
dynamic::Value def {};
|
||||||
@@ -142,8 +138,6 @@ public:
|
|||||||
std::string name = parseIdentifier(true);
|
std::string name = parseIdentifier(true);
|
||||||
std::vector<Argument> args;
|
std::vector<Argument> args;
|
||||||
std::unordered_map<std::string, Argument> kwargs;
|
std::unordered_map<std::string, Argument> kwargs;
|
||||||
|
|
||||||
std::cout << "command.name: " << name << std::endl;
|
|
||||||
while (hasNext()) {
|
while (hasNext()) {
|
||||||
if (peek() == '{') {
|
if (peek() == '{') {
|
||||||
nextChar();
|
nextChar();
|
||||||
@@ -329,7 +323,6 @@ public:
|
|||||||
if (relative) {
|
if (relative) {
|
||||||
value = applyRelative(arg, value, fetchOrigin(interpreter, arg));
|
value = applyRelative(arg, value, fetchOrigin(interpreter, arg));
|
||||||
}
|
}
|
||||||
std::cout << "argument value: " << value << std::endl;
|
|
||||||
args->put(value);
|
args->put(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user