Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ST3 GAUSS syntax highlight
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions:
- gss, prg, arc
scope: source.GAUSS
contexts:
main:
# Strings begin and end with quotes, and use backslashes as an escape
# character
- match: '"'
scope: punctuation.definition.string.begin.GAUSS
push: double_quoted_string
# Comments begin with a '/*' and finish at the end of the line
- match: '\/\*'
scope: punctuation.definition.comment.GAUSS
push: line_comment
# Comments begin with a '@' and finish at the end of the line
- match: '@.*@'
scope: punctuation.definition.comment.GAUSS
push: line_comment
# Block comments begin with a '@'
- match: '@.*\n'
scope: punctuation.definition.comment.begin.GAUSS
push: begin_block_comment
# # Block comments end with a '@'
# - match: '^@$'
# scope: punctuation.definition.comment.end.GAUSS
# push: end_block_comment
# Keywords are if, else for and while.
# Note that blackslashes don't need to be escaped within single quoted
# strings in YAML. When using single quoted strings, only single quotes
# need to be escaped: this is done by using two single quotes next to each
# other.
- match: '\b(if|if not|else|elseif|for|while|do until|endif|endo|proc|retp|endp)\b'
scope: keyword.control.GAUSS
# Numbers
- match: '\b(-)?[0-9.]+\b'
scope: constant.numeric.GAUSS
# Brackets
- match: \(
push: brackets
- match: \)
scope: invalid.illegal.stray-bracket-end
double_quoted_string:
- meta_scope: string.quoted.double.GAUSS
- match: '\\.'
scope: constant.character.escape.GAUSS
- match: '"'
scope: punctuation.definition.string.end.GAUSS
pop: true
line_comment:
- meta_scope: comment.line.GAUSS
- match: $
pop: true
begin_block_comment:
- meta_scope: comment.begin.GAUSS
- match: $
pop: true
# end_block_comment:
# - meta_scope: comment.end.GAUSS
# - match: $
# pop: true
brackets:
- match: \)
pop: true
- include: main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment