Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
114 lines (90 sloc) 2.82 KB
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Shen
scopeName: source.shen
fileTypes: [shen]
uuid: 4f20d927-cddd-4fd7-a7a6-9739f008439d
patterns:
- include: '#expressions'
repository:
expressions:
patterns:
- include: '#comments'
- include: '#atoms'
- include: '#parens'
- include: '#squares'
comments:
patterns:
- name: comment.line
match: (\\\\.*$)
- name: comment.block
begin: (\\\*)
end: (\*\\)
parens:
patterns:
- name: meta.group
begin: (\()
end: (\))
patterns:
- include: '#expressions'
squares:
patterns:
- name: meta.group
begin: (\[)
end: (\])
patterns:
- include: '#expressions'
atoms:
patterns:
- comment: Multiline Strings
name: string.quoted.double
begin: (\")
end: (\")
patterns:
- match: (~A|~R|~S|~%|c#\d+;)
name: constant.character.escape
- match: (c#[^;]*;)
name: invalid.illegal
- comment: Numbers
name: constant.numeric
match: (?<=^|[\s()\[\]])[+-]*\d+\.?\d*(?=$|[\s;()\[\]])
- comment: Malformed Numbers
name: invalid.illegal
match: (?<=^|[\s()\[\]])[+-]*\d+\.?\d*[^\s;()\[\]]+(?=$|[\s;()\[\]])
- comment: Special Forms
name: keyword.control
match: (?<=\()(and|or|if|do|lambda|freeze|let|cond|cases|trap-error|where|package|defun|/.|define|defmacro|defcc|defprolog|datatype)(?=$|[\s;()\[\]{}])
- comment: Special Operators
name: keyword.control
match: (?<=^|[\s()\[\]{}])(->|<-|-->|<--|==>|<==|:=|__+)(?=$|[\s;()\[\]{}])
- comment: Standard Operators
name: keyword.operator
match: (?<=^|[\s()\[\]{}])(=|==|<|>|<=|>=|\+|-|\*|/)(?=$|[\s;()\[\]{}])
- comment: Definition Names
name: entity.name.function
match: (?<=\(define\s)([^\s()\[\]{}]*)(?=$|[\s;()\[\]{}])
- comment: Macro Names
name: entity.name.function
match: (?<=\(defmacro\s)([^\s()\[\]{}]*)(?=$|[\s;()\[\]{}])
- comment: Prolog Names
name: entity.name.function
match: (?<=\(defprolog\s)([^\s()\[\]{}]*)(?=$|[\s;()\[\]{}])
- comment: Package Names
name: entity.name.section
match: (?<=\(package\s)([^\s()\[\]{}]*)(?=$|[\s;()\[\]{}])
- comment: Data Types
name: entity.name.type
match: (?<=\(datatype\s)([^\s()\[\]{}]*)(?=$|[\s;()\[\]{}])
- comment: Local Variables
name: variable.language
match: (?<=^|[\s()\[\]{}])([A-Z][^\s()\[\];{}]*)(?=$|[\s;()\[\]{}])
- comment: Yacc Rule
name: entity.name.tag
match: (?<=^|[\s()\[\]])(<[^\s()\[\]]*>)(?=$|[\s;()\[\]])
- comment: Idle Symbols
name: constant.language
match: (?<=^|[\s)\[\]{}])([^A-Z\s()\[\]:;\|{}][^\s()\[\];{}]*)(?=$|[\s;()\[\]{}])
- comment: Empty Lists
name: constant.language
match: (\(\)|\[\])
...