Skip to content

Instantly share code, notes, and snippets.

@louisremi
Created January 7, 2014 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save louisremi/8301424 to your computer and use it in GitHub Desktop.
Save louisremi/8301424 to your computer and use it in GitHub Desktop.
Prototypo Glyph Formula Highlighting
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Prototypo Glyph Formula
scopeName: source.prototypo_glyph_formula
fileTypes: [pgf, pcf]
uuid: e87ec56d-d1cc-417c-98df-6507c710898f
patterns:
- include: '#line-comment'
- name: meta.segment.pgf
begin: ^(r?[A-Za-z])\b
beginCaptures:
'1': { name: support.constant.pgf }
end: $
patterns:
- include: '#template'
- include: '#number'
- name: meta.component.pgf
begin: ^(add|replace)
beginCaptures:
'1': { name: support.function.pgf }
end: $
patterns:
- include: '#template'
- include: '#self'
- include: '#number'
- name: keyword.other.pgf
match: inverted
repository:
template:
patterns:
- name: meta.template.values.pgf
begin: \{\{
beginCaptures:
'0': { name: keyword.operator.pgf }
end: (?=\|)|\}\}
endCaptures:
'0': { name: keyword.operator.pgf }
patterns:
- include: source.js
- include: '#self'
- name: meta.template.filters.pgf
begin: (?=\|)
end: \}\}
endCaptures:
'0': { name: keyword.operator.pgf }
patterns:
- match: (\|)\s*([^:\s]*)
captures:
'1': { name: keyword.operator.pgf }
'2': { name: entity.name.function.pgf }
- include: source.js
- include: '#self'
self:
name: variable.language.pgf
match: self
number:
name: constant.numeric.pgf
match: \d+(?:\.\d+)?|\.\d+
line-comment:
name: comment.line.double-slash
match: //.*?$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment