From 9b7611d459993e0b5dccde9affbacc7596b4f011 Mon Sep 17 00:00:00 2001 From: Edoardo Pirovano Date: Fri, 8 Jul 2016 23:07:07 +0100 Subject: [PATCH] Add basic syntax. --- QL.sublime-syntax | 56 +++++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 ++-- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 QL.sublime-syntax diff --git a/QL.sublime-syntax b/QL.sublime-syntax new file mode 100644 index 0000000..30895e6 --- /dev/null +++ b/QL.sublime-syntax @@ -0,0 +1,56 @@ +%YAML 1.2 +--- +name: QL +file_extensions: [ql,qll] +scope: source.QL +contexts: + main: + - match: \b(import)[ ] + scope: keyword.other + push: qualid + - match: \b(boolean|date|float|int|string)\b + scope: storage.type + - match: \b(@[a-z][a-zA-Z0-9_]*)\b + scope: support.type + - match: \b(or|and|not|implies|if|then|else|=|!=|<|>|<=|>=|instanceof|+|-|*|/|%)\b + scope: keyword.operator + - match: \b(false|true)\b + scope: constant.language + - match: \b(this|result)\b + scope: variable.language + - match: '"' + push: string + - match: '//' + scope: punctuation.definition.comment + push: line_comment + - match: '/\*' + scope: punctuation.definition.comment + push: block_comment + - match: '(abstract|cache|external|final|library|noopt|private|deprecated)' + scope: storage.modifier + + qualid: + - meta_scope: meta.qualid + - match: '[a-zA-Z0-9_.]' + - match: (.|\n) + pop: true + + string: + - meta_scope: string.quoted.double + - match: '\\(\\|"|n|r|t)' + scope: constant.character.escape + - match: '(\\|\n|\t|\r)' + scope: invalid.illegal + - match: '"' + pop: true + + line_comment: + - meta_scope: comment.line + - match: $ + pop: true + + block_comment: + - meta_scope: comment.block + - match: '\*/' + scope: punctuation.definition.comment + pop: true \ No newline at end of file diff --git a/README.md b/README.md index 8c9f1a8..ef48fb3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# SublimeText3-QL -Syntax plugin for QL in Sublime Text 3 +# QLSyntax +Syntax plugin for Semmle's QL in Sublime Text 3. Note this is a third party plugin not supported by Semmle. Note also it is in early development and not yet complete.