%YAML 1.2 --- # http://www.sublimetext.com/docs/3/syntax.html name: gnuplot file_extensions: - gp - gpl - gnuplot - gnu - plot - plt scope: source.gnuplot contexts: main: - include: number - include: string_single - include: string_double - match: '\b(for)\b\s*(\[)' comment: | gnuplot iteration statement. There are two forms: numeric [n = 1:2{:inc}] string based [str in "x y z"] but both can also iterate over lists etc, so this is kept loose. captures: 1: keyword.other.iteration.gnuplot 2: punctuation.definition.range.begin.gnuplot push: - meta_scope: meta.structure.iteration.gnuplot - match: '\]' captures: 0: punctuation.definition.range.end.gnuplot pop: true - include: number - include: operator - include: string_double - include: string_single - match: ":" scope: punctuation.separator.range.gnuplot - match: '\b([a-zA-Z]\w*)\b\s*(=|in)' scope: variable-assignment.range.gnuplot - match: '(?i:[^\s(pi|e)\]])' scope: invalid.illegal.expected-range-separator.gnuplot - match: '\[' comment: "gnuplot range statement [a:b]. Lots of things are legal, still more make no sense!" captures: 0: punctuation.definition.range.begin.gnuplot push: - meta_scope: meta.structure.range.gnuplot - match: '\]' captures: 0: punctuation.definition.range.end.gnuplot pop: true - include: number - include: operator - match: ":" scope: punctuation.separator.range.gnuplot - match: '(?i:[^\s(pi|e)\]])' scope: invalid.illegal.expected-range-separator.gnuplot - match: \\. scope: constant.character.escape.gnuplot - match: '(?|>=|<|<=|&|&&|:|\||\|\||\+|-|\*|\.\*|/|\./|\\|\.\\|\^|\.\^)\s* comment: Operator symbols scope: keyword.operator.symbols.matlab string_double: - match: '"' captures: 0: punctuation.definition.string.begin.gnuplot push: - meta_scope: string.quoted.double.gnuplot - match: '"' captures: 0: punctuation.definition.string.end.gnuplot pop: true - match: '\\[\$`"\\\n]' scope: constant.character.escape.gnuplot string_single: - match: "'" captures: 0: punctuation.definition.string.begin.gnuplot push: - meta_scope: string.quoted.single.gnuplot - match: "'" captures: 0: punctuation.definition.string.end.gnuplot pop: true