Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sublime syntax definition for KNP format file #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions assets/KNP.sublime-syntax
Original file line number Diff line number Diff line change
@@ -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