From 07553cbe71cab60d1a29b72dc2ffbf25f0f3619c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20d=27Herbais=20de=20Thun?= Date: Thu, 6 Jul 2023 13:51:28 +0200 Subject: Raw syntax definition loading (#1655) --- assets/files/SExpressions.sublime-syntax | 73 ++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 assets/files/SExpressions.sublime-syntax (limited to 'assets') diff --git a/assets/files/SExpressions.sublime-syntax b/assets/files/SExpressions.sublime-syntax new file mode 100644 index 00000000..a18dd913 --- /dev/null +++ b/assets/files/SExpressions.sublime-syntax @@ -0,0 +1,73 @@ +%YAML 1.2 +--- +name: S Expressions +file_extensions: ["sexp"] +scope: source.sexpr + +contexts: + main: + - match: '(;+).*$' + scope: comment.line.sexpr + captures: + 1: punctuation.definition.comment.sexpr + - match: '#;' + scope: punctuation.definition.comment.sexpr + push: comment + - match: '#\|' + scope: punctuation.definition.comment.sexpr + push: block_comment + + - match: '"' + scope: punctuation.definition.string.begin.sexpr + push: string_unquote + - match: '\d+\.\d+' + scope: constant.numeric.float.sexpr + - match: '\d+' + scope: constant.numeric.integer.sexpr + - match: '\w+' + scope: constant.other.sexpr + - match: '\(' + scope: punctuation.section.parens.begin.sexpr + push: main_rparen + - match: '\)' + scope: invalid.illegal.stray-paren-end + + string_unquote: + - meta_scope: string.quoted.double.sexpr + - match: '""' + scope: constant.character.escape.sexpr + - match: '"' + scope: punctuation.definition.string.end.sexpr + pop: true + + main_rparen: + - match: '\)' + scope: punctuation.section.parens.end.sexpr + pop: true + - include: main + + comment: + - meta_scope: comment.block.sexpr + - match: '\(' + set: comment_rparen + + comment_lparen: + - meta_scope: comment.block.sexpr + - match: '\(' + push: comment_rparen + - match: '\)' + scope: invalid.illegal.stray-paren-end + + comment_rparen: + - meta_scope: comment.block.sexpr + - match: '\)' + pop: true + - include: comment + + block_comment: + - meta_scope: comment.block.sexpr + - match: '#\|' + push: block_comment + - match: '\|#' + scope: punctuation.definition.comment.sexpr + pop: true \ No newline at end of file -- cgit v1.2.3