Nesting
JSON Nesting
DCC can nest JSON in a certain way, so syntax highlighting needs to support JSON syntax. When JSON is embedded, there will be indentation relative to the previous and next lines. The specific amount of indentation is not strictly specified, such as:
Previous statement
{
"name": "Tom"
}
Next statementNested JSON code needs to be highlighted using JSON syntax
C++ Nesting
You can wrap C++ code using +++, these three characters occupy a separate line and no comments are allowed
Previous statement
+++
#include<iostream>
int main(){
std::cout<<"hello word";
}
+++
Next statementC++ code can be defined anywhere in the file and called globally