Added x86 assembly syntax highlighting (Closes SpartanJ/ecode#75).

Added PICO8 syntax highlighting.
Added PSQL syntax highlighting.
Added Haskell linter, formatter and LSP support.
Improved JSON syntax definition to CPP.
Cleaning up SyntaxDefinitionManager.
This commit is contained in:
Martín Lucas Golini
2023-03-09 02:14:14 -03:00
parent 7c1edee00d
commit c6200f4b53
19 changed files with 4169 additions and 1341 deletions

View File

@@ -3517,6 +3517,10 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
parser, "convert-lang-path",
"Convert any JSON language definition to CPP syntax definition (development helper)",
{ "convert-lang-path" }, "" );
args::ValueFlag<std::string> convertLangOutput(
parser, "convert-lang-output",
"Sets the directory output path. If not set it will be printed to stdout",
{ "convert-lang-output" }, "" );
std::vector<std::string> args;
try {
@@ -3547,7 +3551,20 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
for ( const auto& lang : adedLangs ) {
const auto& def =
SyntaxDefinitionManager::instance()->getByLanguageName( lang );
std::cout << SyntaxDefinitionManager::toCPP( def ) << "\n";
auto code = SyntaxDefinitionManager::toCPP( def );
if ( convertLangOutput && !convertLangOutput.Get().empty() &&
FileSystem::isDirectory( convertLangOutput.Get() ) ) {
std::string output( convertLangOutput.Get() );
FileSystem::dirAddSlashAtEnd( output );
FileSystem::fileWrite( output + String::toLower( def.getLanguageName() ) +
".hpp",
code.first );
FileSystem::fileWrite( output + String::toLower( def.getLanguageName() ) +
".cpp",
code.second );
} else {
std::cout << code.first << code.second << "\n";
}
}
}
}