diff --git a/LANGUAGES.md b/LANGUAGES.md index 5e1855e84..36b42bd44 100644 --- a/LANGUAGES.md +++ b/LANGUAGES.md @@ -277,6 +277,7 @@ ReScript (res,resi) ReStructuredText (rst) Rich Text Format (rtf) Robot Framework (robot) +RON (ron) RPG (rpg) RPGLE (rpgle) Ruby (rb) diff --git a/examples/language/RON.ron b/examples/language/RON.ron new file mode 100644 index 000000000..c7841e1d9 --- /dev/null +++ b/examples/language/RON.ron @@ -0,0 +1,39 @@ +// testing +Config( + title: "RON examples", + + int_value: 42, + float_value: 3.1415, + is_active: true, + initial: 'a', + + colors: ["red", "green", "blue"], + + /* servers */ + servers: [ + Server( + name: "alpha", + ip: "192.168.1.1", + ), + Server( + name: "beta", + ip: "192.168.1.2", + ), + ], + + database: ( + server: "127.0.1.1", + ports: [8001, 8002, 8003], + connection_max: 5000, + enabled: true, + ), + + // nested + owner: Some(( + name: "scc", + contact: { + "address": "test", + "phone": "+xx-xxx-xxx-xxxx", + }, + )), +) diff --git a/languages.json b/languages.json index 100457f54..2a138bf4e 100644 --- a/languages.json +++ b/languages.json @@ -6631,6 +6631,43 @@ "quotes": [], "shebangs": ["Rscript"] }, + "RON": { + "complexitychecks": [], + "extensions": ["ron"], + "line_comment": ["//"], + "multi_line": [["/*", "*/"]], + "nestedmultiline": true, + "quotes": [ + { + "end": "\"", + "start": "\"" + }, + { + "end": "'", + "start": "'" + }, + { + "ignoreEscape": true, + "end": "\"", + "start": "r\"" + }, + { + "ignoreEscape": true, + "end": "\"#", + "start": "r#\"" + }, + { + "ignoreEscape": true, + "end": "\"##", + "start": "r##\"" + }, + { + "ignoreEscape": true, + "end": "\"###", + "start": "r###\"" + } + ] + }, "RPG": { "complexitychecks": ["COMP", "IF", "ELSEIF", "WHEN", "DOW", "DOU", "FOR", "IFEQ", "IFNE", "IFLT", "IFLE", "IFGT", "IFGE", "WHENEQ", "WHENNE", "WHENLT", "WHENLE", "WHENGT", "WHENGE", "DOWEQ", "DOWNE", "DOWLT", "DOWLE", "DOWGT", "DOWGE", "DOUEQ", "DOUNE", "DOULT", "DOULE", "DOUGT", "DOUGE", "CABEQ", "CABNE", "CABLT", "CABLE", "CABGT", "CABGE", "CASEQ", "CASNE", "CASLT", "CASLE", "CASGT", "CASGE"], "caseinsensitive": true, diff --git a/main_test.go b/main_test.go index 6087d31d9..248b04800 100644 --- a/main_test.go +++ b/main_test.go @@ -1015,6 +1015,7 @@ func TestSpecificLanguages(t *testing.T) { "Rebol", "Redscript", "Rich Text Format", + "RON", "Ruby", "Rust", "Scala", diff --git a/processor/constants.go b/processor/constants.go index b57b9b6e9..e8ef752fd 100644 --- a/processor/constants.go +++ b/processor/constants.go @@ -12905,6 +12905,77 @@ var languageDatabase = map[string]Language{ FileNames: []string{}, SheBangs: []string{}, }, + "RON": { + LineComment: []string{ + "//", + }, + ComplexityChecks: []string{}, + Extensions: []string{ + "ron", + }, + ExtensionFile: false, + MultiLine: [][]string{ + { + "/*", + "*/", + }, + }, + Quotes: []Quote{ + { + Start: "\"", + End: "\"", + IgnoreEscape: false, + DocString: false, + Delimited: false, + }, + { + Start: "'", + End: "'", + IgnoreEscape: false, + DocString: false, + Delimited: false, + }, + { + Start: "r\"", + End: "\"", + IgnoreEscape: true, + DocString: false, + Delimited: false, + }, + { + Start: "r#\"", + End: "\"#", + IgnoreEscape: true, + DocString: false, + Delimited: false, + }, + { + Start: "r##\"", + End: "\"##", + IgnoreEscape: true, + DocString: false, + Delimited: false, + }, + { + Start: "r###\"", + End: "\"###", + IgnoreEscape: true, + DocString: false, + Delimited: false, + }, + }, + NestedMultiLine: true, + LineSplice: false, + Escape: "", + CaseInsensitive: false, + CommentIsWord: false, + CodeTokens: []string{}, + Heredoc: false, + Keywords: []string{}, + Heuristics: []Heuristic{}, + FileNames: []string{}, + SheBangs: []string{}, + }, "RPG": { LineComment: []string{}, ComplexityChecks: []string{