Don't include null index in property table json
This commit is contained in:
parent
00a94ac040
commit
1129759b52
1 changed files with 5 additions and 4 deletions
|
|
@ -78,8 +78,10 @@ class CodeGenerator {
|
|||
add(transition.type);
|
||||
add("\",\"named\":");
|
||||
add(transition.named ? "true" : "false");
|
||||
add(",\"index\":");
|
||||
add(transition.index == -1 ? "null" : to_string(transition.index));
|
||||
if (transition.index != -1) {
|
||||
add(",\"index\":");
|
||||
add(to_string(transition.index));
|
||||
}
|
||||
add(",\"state_id\": ");
|
||||
add(to_string(transition.state_id));
|
||||
add("}");
|
||||
|
|
@ -97,8 +99,7 @@ class CodeGenerator {
|
|||
};
|
||||
|
||||
string property_table_json(PropertyTable table) {
|
||||
CodeGenerator g;
|
||||
return g.generate(table);
|
||||
return CodeGenerator().generate(table);
|
||||
}
|
||||
|
||||
} // namespace generate_code
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue