Changing langs format

This commit is contained in:
Andrey 2021-07-28 13:04:21 +04:00 committed by GitHub
parent 82548835c2
commit e54519611b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 10 deletions

View file

@ -1,9 +1,14 @@
{ {
"comment": "#.+$", "lang": {
"oper": "[+\\-<>!=`\\|&\\[\\]\\(\\):]", "delim": ["[\\r\\n]",";","&&","\\|\\|","\\|"],
"cmd": "(?:^\\w+)|(?:`\\w+?`)|(?:$\\(\\w+?\\))|(?:\\|.*?\\w+)", "strdelim": "[\"']"
"var": "(?:${\\w+?})|(?:$\\w+)", },
"num": "(?:\\d+?\\.\\d+)|(?:\\d+)", "comment": "(#.+)$",
"str": "[\\'\\\"].+?[\\'\\\"]", "oper": "([+\\-<>!=`\\|&\\[\\]\\(\\):])",
"kw": "if|elif|else|fi|case|esac|set|let", "cmd": "(?:^(\\w+))|(?:`(\\w+).*`)|(?:\\$\\((\\w+)\\))",
"var": "((?:\\${\\w+?})|(?:\\$\\w+))",
"num": "((?:\\d+?\\.\\d+)|(?:\\d+))",
"str": "(['\"].*?['\"])",
"kw": "(echo|printf|read|pushd|popd|dirs|if|elif|else|fi|case|esac|set|let|eval)",
"shebang": "(#!.+$)"
} }

View file

@ -1,5 +1,10 @@
{ {
"diff-i": "^\\+.*$", "lang": {
"diff-d": "^\\-.*$", "delim": ["\\d(?:,\\d)*[acd]\\d(?:,\\d)*\\s*"]
"diff-c": "^@@ -\\d+?,\\d+? \\+\\d+?,\\d+? @@" },
"lexemes": {
"diff-i": "(>[\\s\\S]+)",
"diff-d": "(<[\\s\\S]+)",
"diff-c": "(<[\\s\\S]+?---\\s*>[\\s\\S]+)"
}
} }

10
langs/unidiff.json Normal file
View file

@ -0,0 +1,10 @@
{
"lang": {
"delim": ["\\n"]
},
"lexemes": {
"diff-i": "^(\\+.*$)",
"diff-d": "^(\\-.*$)",
"diff-c": "^(@@ -\\d+?,\\d+? \\+\\d+?,\\d+? @@)"
}
}