code2pg icon indicating copy to clipboard operation
code2pg copied to clipboard

Configuration file: define a language

Open e7e6 opened this issue 7 years ago • 0 comments

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.

e7e6 avatar Mar 06 '18 13:03 e7e6