code2pg
code2pg copied to clipboard
Configuration file: define a language
With commit 0be10e3627a66cf845e4ce5215a92ebe8794fa45, the use of a configuration file is now possible.
Unfortunatly, it is missing the possibility to define how a language is parsed. This is so far done within the script:
my %LANGUAGE_COMMENTS_BEGIN = (
"java" => '\/\/', # To be completed with other languages if possible
"javascript" => "\/\/",
"jsp" => "<!--",
"plsql" => "--",
"proc" => "\/\/",
);
my %LANGUAGE_COMMENTS_END = (
"java" => '', # To be completed with other languages if possible
"javascript" => "",
"jsp" => "-->",
"plsql" => "",
"proc" => "",
);
my %REGEX_BEFORE = (
"plsql" => '', # how we identify keywords, directly as in plsql
"others" => '".*?', # or in character strings ?
);
my %REGEX_AFTER = (
"plsql" => '', # how we identify keywords, directly as in plsql
"others" => '.*?\"', # or in character strings ?
);
but should be made possible with the configuration file.