Skip to content

Instantly share code, notes, and snippets.

@jwt625

jwt625/jdf.sublime-syntax

Last active Jul 16, 2020
Embed
What would you like to do?
%YAML 1.2
---
# JEOL jdf & sdf file syntax highlight for sublime
# WTJ, 20180316
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions:
- jdf
- sdf
scope: source.example-c
contexts:
# The prototype context is prepended to all contexts but those setting
# meta_include_prototype: false.
prototype:
- include: comments
main:
# The main context is the initial starting point of our syntax.
# Include other contexts from here (or specify them directly).
- include: keywords
- include: variables
- include: commands
- include: numbers
- include: strings
variables:
- match: '\b(A|C|M|M\d|P|Q|R|S|MOD\d\d\d|OFF|ON|V\d)\b'
scope: entity.name.context.sublime-syntax
commands:
- match: '\b(CHIPAL|SHOT|RESIST|OFFSET|CHMDET|CHMDET|JDF|
|EOS|ASSIGN|GLMDET|HSWITCH|ARRAY|PATH|LAYER|GLMP|GLMPOS|CHMPOS|CHMARK|SRTPRM|RESTYP|OBJAPT|STDCUR)\b'
scope: storage.type.scope-name.sublime-syntax
keywords:
# 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(PATH|END|AEND|PEND)\b'
scope: keyword.control.example-c
numbers:
- match: '\b(-)?[0-9.]+\b'
scope: constant.numeric.example-c
strings:
# Strings begin and end with quotes, and use backslashes as an escape
# character.
- match: ''''
scope: punctuation.definition.string.begin.example-c
push: inside_string
inside_string:
- meta_include_prototype: false
- meta_scope: string.quoted.double.example-c
- match: '\.'
scope: constant.character.escape.example-c
- match: ''''
scope: punctuation.definition.string.end.example-c
pop: true
comments:
# Comments begin with a ';' and finish at the end of the line.
- match: ';'
scope: punctuation.definition.comment.example-c
push:
# This is an anonymous context push for brevity.
- meta_scope: comment.line.double-slash.example-c
- match: $\n?
pop: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment