Skip to content

Commit

Permalink
Fine tunning
Browse files Browse the repository at this point in the history
  • Loading branch information
GrayJack committed Apr 1, 2019
1 parent fae1cc6 commit 4c2a507
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions grammars/janet.cson
@@ -1,5 +1,6 @@
fileTypes: [
"janet"
"jimage"
]
foldingStartMarker: "\\("
foldingStopMarker: "\\)"
Expand Down Expand Up @@ -113,11 +114,11 @@ repository:
}
{
# match: "(?<![\\.:\\w_\\-=!@\\$%^&?|\\\\/<>*])(cond|do|set|while|each|if|if\\-let|if\\-not|let|loop|when|when\\-let|when\\-not|unless|seq|try|catch)(?<![\\.:\\w_\\-=!@\\$%^&?|\\\\/<>*])"
match: "(?<=(\\s|\\(|\\[|\\{))(cond|do|set|while|each|if|if\\-let|if\\-not|let|loop|when|when\\-let|when\\-not|unless|seq|try|catch)(?=(\\s|\\)|\\]|\\}))"
match: "(?<=(\\s|\\(|\\[|\\{))(case|cond|do|set|while|each|if|if\\-let|if\\-not|let|match|loop|generate|when|when\\-let|when\\-not|unless|seq|try)(?=(\\s|\\)|\\]|\\}))"
name: "storage.control.janet"
}
{
match: "(?<=(\\s|\\())(%|%=|\\*|\\*=|\\+|\\+\\+|\\+=|\\-|\\-\\-|\\-=|\\->|\\->>|\\-\\?>|\\-\\?>>|/|/=|<|<=|=|==|>|>=|inc|dec)(?=(\\s|\\)))"
match: "(?<=(\\s|\\())(%|%=|\\*|\\*=|\\+|\\+\\+|\\+=|\\-|\\-\\-|\\-=|/|/=|<|<=|=|==|>|>=|inc|dec)(?=(\\s|\\)))"
name: "keyword.operator.janet"
}
]
Expand All @@ -126,7 +127,7 @@ repository:
name: "constant.literal.janet"
corelib:
# match: "(?<![\\.:\\w_\\-=!@\\$%^&?|\\\\/<>*])(splice|\\*doc\\-width\\*|\\*env\\*|abstract\\?|all|all\\-bindings|allsyms|and|apply|array|array/concat|array/ensure|array/insert|array/new|array/peek|array/pop|array/push|array/remove|array/slice|array\\?|as\\->|as\\?\\->|bad\\-compile|bad\\-parse|band|blshift|bnot|boolean\\?|bor|brshift|brushift|buffer|buffer/bit|buffer/bit\\-clear|buffer/bit\\-set|buffer/bit\\-toggle|buffer/blit|buffer/clear|buffer/format|buffer/new|buffer/new\\-filled|buffer/popn|buffer/push\\-byte|buffer/push\\-string|buffer/push\\-word|buffer/slice|buffer\\?|bxor|bytes\\?|case|cfunction\\?|comment|comp|compile|complement|cond|coro|count|debug|debug/arg\\-stack|debug/break|debug/fbreak|debug/lineage|debug/stack|debug/stacktrace|debug/unbreak|debug/unfbreak|deep\\-not=|deep=|default|describe|dictionary\\?|disasm|distinct|doc|doc\\*|doc\\-format|drop\\-until|drop\\-while|empty\\?|env\\-lookup|error|eval|eval\\-string|even\\?|every\\?|extreme|false\\?|fiber/current|fiber/maxstack|fiber/new|fiber/setmaxstack|fiber/status|fiber\\?|file/close|file/flush|file/open|file/popen|file/read|file/seek|file/write|filter|find|find\\-index|first|flatten|flatten\\-into|for|frequencies|function\\?|gccollect|gcinterval|gcsetinterval|generate|gensym|get|getline|grammar\\-template|hash|idempotent\\?|identity|if\\-let|if\\-not|import|import\\*|indexed\\?|int/s64|int/u64|interleave|interpose|invert|janet/build|janet/version|juxt|juxt\\*|keep|keys|keyword|keyword\\?|kvs|last|length|let|load\\-image|loop|macex|macex1|make\\-env|make\\-image|map|mapcat|marshal|match|math/abs|math/acos|math/asin|math/atan|math/atan2|math/ceil|math/cos|math/cosh|math/e|math/exp|math/floor|math/inf|math/log|math/log10|math/pi|math/pow|math/random|math/seedrandom|math/sin|math/sinh|math/sqrt|math/tan|math/tanh|max|max\\-order|merge|merge\\-into|meta|min|min\\-order|module/\\*syspath\\*|module/cache|module/find|module/loading|module/paths|native|neg\\?|next|nil\\?|not|not=|not==|number\\?|odd\\?|one\\?|or|order<|order<=|order>|order>=|os/cd|os/clock|os/cwd|os/date|os/dir|os/execute|os/exit|os/getenv|os/link|os/mkdir|os/rm|os/rmdir|os/setenv|os/shell|os/sleep|os/stat|os/time|os/touch|os/which|pairs|parser/byte|parser/consume|parser/eof|parser/error|parser/flush|parser/has\\-more|parser/insert|parser/new|parser/produce|parser/state|parser/status|parser/where|partial|partition|peg/compile|peg/match|pos\\?|postwalk|pp|prewalk|print|process/args|product|put|range|reduce|repl|require|resume|reverse|run\\-context|scan\\-number|seq|slurp|some|sort|sorted|specials|spit|stderr|stdin|stdout|string|string/ascii\\-lower|string/ascii\\-upper|string/bytes|string/check\\-set|string/find|string/find\\-all|string/format|string/from\\-bytes|string/join|string/repeat|string/replace|string/replace\\-all|string/reverse|string/slice|string/split|string\\?|struct\\?|sum|symbol|symbol\\?|table|table/getproto|table/new|table/rawget|table/setproto|table/to\\-struct|table\\?|take\\-until|take\\-while|tarray/buffer|tarray/copy\\-bytes|tarray/length|tarray/new|tarray/properties|tarray/slice|tarray/swap\\-bytes|true\\?|tuple|tuple/brackets|tuple/slice|tuple/type|tuple\\?|type|unmarshal|update|values|walk|with\\-syms|zero\\?|zipcoll)(?![\\.:\\w_\\-=!@\\$%^&?|\\\\/<>*])"
match: "(?<=(\\s|\\(|\\[|\\{))(splice|\\*doc\\-width\\*|\\*env\\*|abstract\\?|all|all\\-bindings|allsyms|and|apply|array|array/concat|array/ensure|array/insert|array/new|array/peek|array/pop|array/push|array/remove|array/slice|array\\?|as\\->|as\\?\\->|bad\\-compile|bad\\-parse|band|blshift|bnot|boolean\\?|bor|brshift|brushift|buffer|buffer/bit|buffer/bit\\-clear|buffer/bit\\-set|buffer/bit\\-toggle|buffer/blit|buffer/clear|buffer/format|buffer/new|buffer/new\\-filled|buffer/popn|buffer/push\\-byte|buffer/push\\-string|buffer/push\\-word|buffer/slice|buffer\\?|bxor|bytes\\?|case|cfunction\\?|comment|comp|compile|complement|cond|coro|count|debug|debug/arg\\-stack|debug/break|debug/fbreak|debug/lineage|debug/stack|debug/stacktrace|debug/unbreak|debug/unfbreak|deep\\-not=|deep=|default|describe|dictionary\\?|disasm|distinct|doc|doc\\*|doc\\-format|drop\\-until|drop\\-while|empty\\?|env\\-lookup|error|eval|eval\\-string|even\\?|every\\?|extreme|false\\?|fiber/current|fiber/maxstack|fiber/new|fiber/setmaxstack|fiber/status|fiber\\?|file/close|file/flush|file/open|file/popen|file/read|file/seek|file/write|filter|find|find\\-index|first|flatten|flatten\\-into|for|frequencies|function\\?|gccollect|gcinterval|gcsetinterval|generate|gensym|get|getline|grammar\\-template|hash|idempotent\\?|identity|if\\-let|if\\-not|import|import\\*|indexed\\?|int/s64|int/u64|interleave|interpose|invert|janet/build|janet/version|juxt|juxt\\*|keep|keys|keyword|keyword\\?|kvs|last|length|let|load\\-image|macex|macex1|make\\-env|make\\-image|map|mapcat|marshal|match|math/abs|math/acos|math/asin|math/atan|math/atan2|math/ceil|math/cos|math/cosh|math/e|math/exp|math/floor|math/inf|math/log|math/log10|math/pi|math/pow|math/random|math/seedrandom|math/sin|math/sinh|math/sqrt|math/tan|math/tanh|max|max\\-order|merge|merge\\-into|meta|min|min\\-order|module/\\*syspath\\*|module/cache|module/find|module/loading|module/paths|native|neg\\?|next|nil\\?|not|not=|not==|number\\?|odd\\?|one\\?|or|order<|order<=|order>|order>=|os/cd|os/clock|os/cwd|os/date|os/dir|os/execute|os/exit|os/getenv|os/link|os/mkdir|os/rm|os/rmdir|os/setenv|os/shell|os/sleep|os/stat|os/time|os/touch|os/which|pairs|parser/byte|parser/consume|parser/eof|parser/error|parser/flush|parser/has\\-more|parser/insert|parser/new|parser/produce|parser/state|parser/status|parser/where|partial|partition|peg/compile|peg/match|pos\\?|postwalk|pp|prewalk|print|process/args|product|put|range|reduce|repl|require|resume|reverse|run\\-context|scan\\-number|seq|slurp|some|sort|sorted|specials|spit|stderr|stdin|stdout|string|string/ascii\\-lower|string/ascii\\-upper|string/bytes|string/check\\-set|string/find|string/find\\-all|string/format|string/from\\-bytes|string/join|string/repeat|string/replace|string/replace\\-all|string/reverse|string/slice|string/split|string\\?|struct\\?|sum|symbol|symbol\\?|table|table/getproto|table/new|table/rawget|table/setproto|table/to\\-struct|table\\?|take\\-until|take\\-while|tarray/buffer|tarray/copy\\-bytes|tarray/length|tarray/new|tarray/properties|tarray/slice|tarray/swap\\-bytes|true\\?|tuple|tuple/brackets|tuple/slice|tuple/type|tuple\\?|type|unmarshal|update|values|walk|with\\-syms|zero\\?|zipcoll)(?=(\\s|\\)|\\]|\\}))"
match: "(?<=(\\s|\\(|\\[|\\{))(splice|\\*doc\\-width\\*|\\*env\\*|abstract\\?|\\->|\\->>|\\-\\?>|\\-\\?>>|all|all\\-bindings|allsyms|and|apply|array|array/concat|array/ensure|array/insert|array/new|array/peek|array/pop|array/push|array/remove|array/slice|array\\?|as\\->|as\\?\\->|bad\\-compile|bad\\-parse|band|blshift|bnot|boolean\\?|bor|brshift|brushift|buffer|buffer/bit|buffer/bit\\-clear|buffer/bit\\-set|buffer/bit\\-toggle|buffer/blit|buffer/clear|buffer/format|buffer/new|buffer/new\\-filled|buffer/popn|buffer/push\\-byte|buffer/push\\-string|buffer/push\\-word|buffer/slice|buffer\\?|bxor|bytes\\?|case|cfunction\\?|comment|comp|compile|complement|cond|coro|count|debug|debug/arg\\-stack|debug/break|debug/fbreak|debug/lineage|debug/stack|debug/stacktrace|debug/unbreak|debug/unfbreak|deep\\-not=|deep=|default|describe|dictionary\\?|disasm|distinct|doc|doc\\*|doc\\-format|drop\\-until|drop\\-while|empty\\?|env\\-lookup|error|eval|eval\\-string|even\\?|every\\?|extreme|false\\?|fiber/current|fiber/maxstack|fiber/new|fiber/setmaxstack|fiber/status|fiber\\?|file/close|file/flush|file/open|file/popen|file/read|file/seek|file/write|filter|find|find\\-index|first|flatten|flatten\\-into|for|frequencies|function\\?|gccollect|gcinterval|gcsetinterval|generate|gensym|get|getline|grammar\\-template|hash|idempotent\\?|identity|if\\-let|if\\-not|import|import\\*|indexed\\?|int/s64|int/u64|interleave|interpose|invert|janet/build|janet/version|juxt|juxt\\*|keep|keys|keyword|keyword\\?|kvs|last|length|load\\-image|macex|macex1|make\\-env|make\\-image|map|mapcat|marshal|match|math/abs|math/acos|math/asin|math/atan|math/atan2|math/ceil|math/cos|math/cosh|math/e|math/exp|math/floor|math/inf|math/log|math/log10|math/pi|math/pow|math/random|math/seedrandom|math/sin|math/sinh|math/sqrt|math/tan|math/tanh|max|max\\-order|merge|merge\\-into|meta|min|min\\-order|module/\\*syspath\\*|module/cache|module/find|module/loading|module/paths|native|neg\\?|next|nil\\?|not|not=|not==|number\\?|odd\\?|one\\?|or|order<|order<=|order>|order>=|os/cd|os/clock|os/cwd|os/date|os/dir|os/execute|os/exit|os/getenv|os/link|os/mkdir|os/rm|os/rmdir|os/setenv|os/shell|os/sleep|os/stat|os/time|os/touch|os/which|pairs|parser/byte|parser/consume|parser/eof|parser/error|parser/flush|parser/has\\-more|parser/insert|parser/new|parser/produce|parser/state|parser/status|parser/where|partial|partition|peg/compile|peg/pos\\?|postwalk|pp|prewalk|print|process/args|product|put|range|reduce|repl|require|resume|reverse|run\\-context|scan\\-number|seq|slurp|some|sort|sorted|specials|spit|stderr|stdin|stdout|string|string/ascii\\-lower|string/ascii\\-upper|string/bytes|string/check\\-set|string/find|string/find\\-all|string/format|string/from\\-bytes|string/join|string/repeat|string/replace|string/replace\\-all|string/reverse|string/slice|string/split|string\\?|struct\\?|sum|symbol|symbol\\?|table|table/getproto|table/new|table/rawget|table/setproto|table/to\\-struct|table\\?|take\\-until|take\\-while|tarray/buffer|tarray/copy\\-bytes|tarray/length|tarray/new|tarray/properties|tarray/slice|tarray/swap\\-bytes|true\\?|tuple|tuple/brackets|tuple/slice|tuple/type|tuple\\?|type|unmarshal|update|values|walk|with\\-syms|zero\\?|zipcoll)(?=(\\s|\\)|\\]|\\}))"
name: "entity.name.function.core.janet"
function:
patterns: [
Expand All @@ -137,8 +138,8 @@ repository:
name: "entity.name.function.call.janet"
}
# {
# Try to tokenize function definitions
# match: "(?<=\\())(defn|defn-|fn)\\s(.+?)\\s(?<=\\[)([.+?]*)(?=\\s|\\])(?=\\s|\\))"
# # Try to tokenize function definitions
# match: "(?<=\\())(defn|defn-|fn)\\s(.+?)\\s(\\[)(.*?)(?=\\s|\\])(?=\\s|\\))"
# captures:
# "3":
# name: "entity.name.function.def.janet"
Expand Down

0 comments on commit 4c2a507

Please sign in to comment.