Skip to content

Commit

Permalink
Added two new contexts, should fix #6.
Browse files Browse the repository at this point in the history
  • Loading branch information
InternetUnexplorer committed Jan 3, 2017
1 parent 41bfdd7 commit 7708a47
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions LuaExtended.sublime-syntax
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
#
#
#
#
# 5:
# 6:
name: LuaExtended # by viluon
comment: "LuaExtended Syntax: version 0.1"
file_extensions:
Expand All @@ -13,22 +19,11 @@ variables:
number: '(?<![\d.])\b0[xX][a-fA-F\d\.]+([pP][\-\+]?\d+)?|\b\d+(\.\d+)?([eE]-?\d+)?|\.\d+([eE]-?\d+)?'
contexts:
main:
- match: '\b(function)\s+([a-zA-Z_.:]+[.:])?([a-zA-Z_]\w*)\s*(\()([^)]*)(\))'
- match: '\b(function)\s+'
scope: meta.function.lua
captures:
1: keyword.control.lua
2: entity.name.function.scope.lua
3: entity.name.function.lua
4: punctuation.definition.parameters.begin.lua
5: variable.parameter.function.lua
6: punctuation.definition.parameters.end.lua
- match: '\b(function)\s*(\()([^)]*)(\))'
scope: meta.function.lua
captures:
1: keyword.control.lua
2: punctuation.definition.parameters.begin.lua
3: variable.parameter.function.lua
4: punctuation.definition.parameters.end.lua
push: function_def_name
- match: '{{number}}'
scope: constant.numeric.lua
- match: "'"
Expand Down Expand Up @@ -74,6 +69,23 @@ contexts:
- match: '([a-zA-Z_.:]+[.:])?([a-zA-Z_]\w*)\s*(?=\(|\"|''|\[(\=*)\[|\{)'
captures:
2: variable.function.lua
function_def_name:
- match: '([a-zA-Z_.:]+[.:])?([a-zA-Z_]\w*)\s*'
captures:
1: entity.name.function.scope.lua
2: entity.name.function.lua
- match: '(\()'
captures:
1: punctuation.definition.parameters.begin.lua
push: function_def_args
function_def_args:
- match: '([^)]*)'
captures:
1: variable.parameter.function.lua
- match: '(\))'
captures:
1: punctuation.definition.parameters.end.lua
set: main
error_call:
- match: "'"
captures:
Expand Down

0 comments on commit 7708a47

Please sign in to comment.