Skip to content

Commit

Permalink
[LaTeX] sublime syntax version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Nov 2, 2023
1 parent 66dccdf commit 354a639
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 97 deletions.
27 changes: 14 additions & 13 deletions LaTeX/Bibtex.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# TODO: Does not support @preamble
name: BibTeX
scope: text.bibtex
version: 2

file_extensions:
- bib
Expand All @@ -25,7 +26,7 @@ contexts:
push:
- meta_scope: comment.line.at-sign.bibtex
- match: $\n?
pop: true
pop: 1
- match: '((@)[Ss]tring)\s*(\{)\s*({{var}})'
captures:
1: keyword.other.string-constant.bibtex
Expand All @@ -36,7 +37,7 @@ contexts:
- meta_scope: meta.string-constant.braces.bibtex
- match: '\}'
scope: punctuation.section.string-constant.end.bibtex
pop: true
pop: 1
- include: string_content
- include: variables
- include: operators
Expand All @@ -50,7 +51,7 @@ contexts:
- meta_scope: meta.string-constant.parenthesis.bibtex
- match: \)
scope: punctuation.section.string-constant.end.bibtex
pop: true
pop: 1
- include: string_content
- include: variables
- include: operators
Expand All @@ -65,7 +66,7 @@ contexts:
- meta_content_scope: meta.mapping.bibtex
- match: '\}'
scope: punctuation.section.entry.end.bibtex
pop: true
pop: 1
- match: '([a-zA-Z]+)(\s*(=)\s*)'
captures:
1: meta.mapping.key.bibtex string.unquoted.key.bibtex
Expand All @@ -74,8 +75,8 @@ contexts:
push:
- clear_scopes: 1
- meta_content_scope: meta.mapping.value.bibtex
- match: "(?=[,}])"
pop: true
- match: (?=[,}])
pop: 1
- include: string_content
- include: integer
- include: variables
Expand All @@ -93,7 +94,7 @@ contexts:
- meta_content_scope: meta.mapping.bibtex
- match: \)
scope: punctuation.section.entry.end.bibtex
pop: true
pop: 1
- match: '([a-zA-Z]+)(\s*(=)\s*)'
captures:
1: meta.mapping.key.bibtex string.unquoted.key.bibtex
Expand All @@ -102,8 +103,8 @@ contexts:
push:
- clear_scopes: 1
- meta_content_scope: meta.mapping.value.bibtex
- match: "(?=[,)])"
pop: true
- match: (?=[,)])
pop: 1
- include: string_content
- include: integer
- include: variables
Expand All @@ -114,7 +115,7 @@ contexts:
push:
- meta_scope: comment.block.bibtex
- match: (?=@)
pop: true
pop: 1
integer:
- match: \d+
scope: meta.number.integer.decimal.bibtex constant.numeric.value.bibtex
Expand All @@ -130,7 +131,7 @@ contexts:
push:
- match: '\}'
scope: punctuation.definition.group.end.bibtex
pop: true
pop: 1
- include: nested_braces
string_content:
- match: '"'
Expand All @@ -139,15 +140,15 @@ contexts:
- meta_scope: string.quoted.double.bibtex
- match: '"'
scope: punctuation.definition.string.end.bibtex
pop: true
pop: 1
- include: nested_braces
- match: '\{'
scope: punctuation.definition.string.begin.bibtex
push:
- meta_scope: string.quoted.other.braces.bibtex
- match: '\}'
scope: punctuation.definition.string.end.bibtex
pop: true
pop: 1
- match: "@"
scope: invalid.illegal.at-sign.bibtex
- include: nested_braces
3 changes: 2 additions & 1 deletion LaTeX/DocStrip.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# https://www.texlive.info/CTAN/macros/latex/base/docstrip.pdf
name: TeX (DocStrip)
scope: source.tex.docstrip
version: 1
version: 2

extends: Packages/LaTeX/TeX.sublime-syntax

file_extensions:
Expand Down
1 change: 1 addition & 0 deletions LaTeX/LaTeX Log.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
---
name: LaTeX Log
scope: text.log.latex
version: 2

first_line_match: 'This is (pdf|pdfe)?TeXk?, Version '

Expand Down
Loading

0 comments on commit 354a639

Please sign in to comment.