From 4e7a3503488d9f0a378e4bbecb7f33394c4ba020 Mon Sep 17 00:00:00 2001 From: nobu-g Date: Sat, 5 Jun 2021 21:40:15 +0900 Subject: [PATCH] add sublime syntax definition for KNP format file --- assets/KNP.sublime-syntax | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 assets/KNP.sublime-syntax diff --git a/assets/KNP.sublime-syntax b/assets/KNP.sublime-syntax new file mode 100644 index 00000000..5adf4177 --- /dev/null +++ b/assets/KNP.sublime-syntax @@ -0,0 +1,73 @@ +%YAML 1.2 +--- +name: KNP +file_extensions: [knp, bertknp] +scope: source.knp + +contexts: + main: + - match: '^[^+*\#\"<> ]+' + scope: variablel + - match: '(?<=\s)[^+\#\"<> ]+' + scope: variable + - match: "<" + scope: keyword + push: feature + - match: ^\+ + scope: keyword + push: tag_bnst + - match: ^\* + scope: keyword + push: tag_bnst + - match: ^EOS$ + scope: constant + - match: \" + scope: string + push: string + - match: ^\# + scope: comment + push: comment + string: + - match: '[^\"]+' + scope: string + - match: \" + scope: string + pop: true + tag_bnst: + - match: (-1|\d+)[DP] + scope: constant.language + - match: "<" + scope: keyword + push: feature + - match: $ + pop: true + feature: + - match: \" + scope: string + push: string + - match: ">" + scope: keyword + pop: true + - match: ":" + scope: keyword + push: feature_value + - match: "=" + scope: keyword + - match: '[^ :><\"=]+' + scope: storage.type + feature_value: + - match: "[^><]+(?=>)" + scope: variable.parameter + pop: true + comment: + - match: "S-ID:" + scope: comment + push: sid + - match: \S+ + scope: comment + - match: $ + pop: true + sid: + - match: \S+ + scope: constant.numeric + pop: true