Skip to content

Commit

Permalink
Add basic syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
Edoardo Pirovano committed Jul 8, 2016
1 parent 8f4cc73 commit 9b7611d
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
56 changes: 56 additions & 0 deletions QL.sublime-syntax
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 9b7611d

Please sign in to comment.