From c48c1f321c0d858bc8bcd026922aa76754cfafc3 Mon Sep 17 00:00:00 2001 From: Oscar Campbell Date: Thu, 11 Jun 2015 21:36:14 +0200 Subject: [PATCH 1/6] Fix edge cases of if/when hl. Fix generic proc hl. --- Syntaxes/Nim.YAML-tmLanguage | 46 +++++++++++++++- Syntaxes/Nim.tmLanguage | 101 ++++++++++++++++++++++++++++++++++- 2 files changed, 144 insertions(+), 3 deletions(-) diff --git a/Syntaxes/Nim.YAML-tmLanguage b/Syntaxes/Nim.YAML-tmLanguage index 85aadec..d66d375 100644 --- a/Syntaxes/Nim.YAML-tmLanguage +++ b/Syntaxes/Nim.YAML-tmLanguage @@ -60,14 +60,15 @@ patterns: - comment: A nim procedure or method declaration name: meta.proc.nim patterns: - - begin: (? begin - (?<![\w\x{80}-\x{10FFFF}])(proc|method|template|macro|iterator|converter)\s+(\`([^\s\`]+)\`|([\w\x{80}-\x{10FFFF}]+))(\*)?(\(.*\))?(\:[^={]+)? + (?<![\w\x{80}-\x{10FFFF}])(proc|method|template|macro|iterator|converter)\s+((\`[^\s\`]+\`)|([\w\x{80}-\x{10FFFF}]+))(\*)?(\[[^\]]+?\])?(\(.*\))?(\:[^={]+)? beginCaptures 1 @@ -195,6 +195,11 @@ variable.parameter.nim 7 + + name + variable.parameter.nim + + 8 name storage.type.generic.nim @@ -401,6 +406,10 @@ control.variable.parameter.nim patterns + + include + #eat_numbers + include #eat_strings @@ -460,6 +469,10 @@ control.variable.parameter.nim patterns + + include + #eat_numbers + include #eat_strings @@ -1720,6 +1733,18 @@ repository + eat_dig_literal + + patterns + + + comment + A base-2 integer literal + match + (?<![\w\x{80}-\x{10FFFF}])(0(b|B)[01][_01]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? + + + eat_double_string patterns @@ -1801,6 +1826,80 @@ + eat_float_literal + + patterns + + + comment + A float literal + match + (?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*((\.[_\d]+([eE][\+\-]?\d[_\d]*)?)|([eE][\+\-]?\d[_\d]*)))('?([fF](32|64|128))|[fFdD])? + + + + eat_hex_literal + + patterns + + + comment + A hexadecimal literal + match + (?<![\w\x{80}-\x{10FFFF}])(0[xX]\h[_\h]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? + + + + eat_int_literal + + patterns + + + comment + A base-10 integer literal + match + (?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? + + + + eat_numbers + + patterns + + + include + #eat_float_literal + + + include + #eat_hex_literal + + + include + #eat_oct_literal + + + include + #eat_dig_literal + + + include + #eat_int_literal + + + + eat_oct_literal + + patterns + + + comment + A base-8 integer literal + match + (?<![\w\x{80}-\x{10FFFF}])(0[ocC][0-7][_0-7]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? + + + eat_single_string patterns From 2c4ee09b921c66e2376e38cc1194669a86db1297 Mon Sep 17 00:00:00 2001 From: Oscar Campbell Date: Sun, 14 Jun 2015 03:13:57 +0200 Subject: [PATCH 2/6] Fix highlighting bugs, new and old. --- Syntaxes/Nim.YAML-tmLanguage | 121 +++------------- Syntaxes/Nim.tmLanguage | 272 +++-------------------------------- 2 files changed, 42 insertions(+), 351 deletions(-) diff --git a/Syntaxes/Nim.YAML-tmLanguage b/Syntaxes/Nim.YAML-tmLanguage index d66d375..b0b5876 100644 --- a/Syntaxes/Nim.YAML-tmLanguage +++ b/Syntaxes/Nim.YAML-tmLanguage @@ -60,15 +60,12 @@ patterns: - comment: A nim procedure or method declaration name: meta.proc.nim patterns: - - begin: (?\-\+\=~]) captures: - '1': { name: keyword.secondary.nim } - '4': { name: variable.primary.assign.hot.nim } - '5': { name: variable.primary.assign.hotter.nim } - '6': { name: keyword.secondary.operator.kw-public.nim } - '7': { name: storage.type.generic.nim } - '8': { name: operator.primary.assign.hottest.nim } + '1': { name: keyword.secondary } + '4': { name: variable.primary.assign.hot } + '5': { name: variable.primary.assign.hotter } + '6': { name: keyword.secondary.operator.kw-public } + '7': { name: storage.type.generic } + '8': { name: keyword.primary.assign.hottest } - comment: Other keywords. - name: keyword.other.nim + name: keyword.other.secondary.nim match: ((? begin - (?<![\w\x{80}-\x{10FFFF}])(proc|method|template|macro|iterator|converter)\s+((\`[^\s\`]+\`)|([\w\x{80}-\x{10FFFF}]+))(\*)?(\[[^\]]+?\])?(\(.*\))?(\:[^={]+)? + (?<![\w\x{80}-\x{10FFFF}])(proc|method|template|macro|iterator|converter)\s+((\`[^\s\`]+\`)|([\w\x{80}-\x{10FFFF}]+))(\*)? beginCaptures 1 @@ -189,21 +189,6 @@ name keyword.secondary.operator.kw-public.nim - 6 - - name - variable.parameter.nim - - 7 - - name - variable.parameter.nim - - 8 - - name - storage.type.generic.nim - end (\=) @@ -303,6 +288,8 @@ Pragmas end \.?\} + name + pragma patterns @@ -408,11 +395,7 @@ include - #eat_numbers - - - include - #eat_strings + source.nim @@ -430,7 +413,7 @@ comment Primary branching keyword 'case' end - ($) + (?=of) endCaptures 1 @@ -441,6 +424,13 @@ name control.variable.parameter.nim + patterns + + + include + source.nim + + begin @@ -471,11 +461,7 @@ include - #eat_numbers - - - include - #eat_strings + source.nim @@ -483,9 +469,9 @@ comment Keywords that affect program control flow or scope. match - (?<![\w\x{80}-\x{10FFFF}])(block|break|continue|do|end|except|finally|raise|return|try|while|yield)(?![\w\x{80}-\x{10FFFF}]) + (?<![\w\x{80}-\x{10FFFF}])(await|block|break|continue|do|end|except|finally|raise|return|try|while|yield)(?![\w\x{80}-\x{10FFFF}]) name - keyword.primary.control.nim + keyword.primary.control comment @@ -501,32 +487,32 @@ 1 name - keyword.secondary.nim + keyword.secondary 4 name - variable.primary.assign.hot.nim + variable.primary.assign.hot 5 name - variable.primary.assign.hotter.nim + variable.primary.assign.hotter 6 name - keyword.secondary.operator.kw-public.nim + keyword.secondary.operator.kw-public 7 name - storage.type.generic.nim + storage.type.generic 8 name - operator.primary.assign.hottest.nim + keyword.primary.assign.hottest comment @@ -534,7 +520,7 @@ match ((^|[\(\)\:\;])\s*(const|let|type|var)?\s+)([\w\x{80}-\x{10FFFF}\.\[\]\(\)\s]*?)?([\w\x{80}-\x{10FFFF}\[\]]+)([*]?)\s*(:\s*[\w\x{80}-\x{10FFFF}\.\[\]\(\)\s]*?)?(=)(?![\<\>\-\+\=~]) name - variable.primary.assign.hot.nim + variable.primary.assign.hot comment @@ -542,7 +528,7 @@ match ((?<![\w\x{80}-\x{10FFFF}])(addr|as|atomic|bind|cast|const|converter|defer|discard|distinct|div|enum|export|include|let|mixin|object|of|ptr|ref|shl|shr|static|type|var)(?![\w\x{80}-\x{10FFFF}])) name - keyword.other.nim + keyword.other.secondary.nim comment @@ -1733,218 +1719,6 @@ repository - eat_dig_literal - - patterns - - - comment - A base-2 integer literal - match - (?<![\w\x{80}-\x{10FFFF}])(0(b|B)[01][_01]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? - - - - eat_double_string - - patterns - - - begin - \" - end - \" - patterns - - - include - #eat_escaped_char - - - - - - eat_escaped_char - - patterns - - - match - \\[nN] - - - match - \\[cC]|\\[rR] - - - match - \\[lL] - - - match - \\[fF] - - - match - \\[tT] - - - match - \\[vV] - - - match - \\\" - - - match - \\' - - - match - \\[0-9]+ - - - match - \\[aA] - - - match - \\[bB] - - - match - \\[eE] - - - match - \\[xX]\h\h - - - match - \\\\ - - - - eat_float_literal - - patterns - - - comment - A float literal - match - (?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*((\.[_\d]+([eE][\+\-]?\d[_\d]*)?)|([eE][\+\-]?\d[_\d]*)))('?([fF](32|64|128))|[fFdD])? - - - - eat_hex_literal - - patterns - - - comment - A hexadecimal literal - match - (?<![\w\x{80}-\x{10FFFF}])(0[xX]\h[_\h]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? - - - - eat_int_literal - - patterns - - - comment - A base-10 integer literal - match - (?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? - - - - eat_numbers - - patterns - - - include - #eat_float_literal - - - include - #eat_hex_literal - - - include - #eat_oct_literal - - - include - #eat_dig_literal - - - include - #eat_int_literal - - - - eat_oct_literal - - patterns - - - comment - A base-8 integer literal - match - (?<![\w\x{80}-\x{10FFFF}])(0[ocC][0-7][_0-7]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? - - - - eat_single_string - - patterns - - - begin - \' - end - \' - patterns - - - match - \\n - name - invalid.illegal.character.nim - - - include - #eat_escaped_char - - - match - ([^\']{2,}?) - name - invalid.illegal.character.nim - - - - - - eat_strings - - patterns - - - include - #eat_double_string - - - include - #eat_single_string - - - escaped_char patterns From a81f744ef30dae6539bbf67c43411e52e1583196 Mon Sep 17 00:00:00 2001 From: Oscar Campbell Date: Sun, 14 Jun 2015 03:20:46 +0200 Subject: [PATCH 3/6] Add .nim suffix to some scopes missing it. --- Syntaxes/Nim.YAML-tmLanguage | 16 ++++++++-------- Syntaxes/Nim.tmLanguage | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Syntaxes/Nim.YAML-tmLanguage b/Syntaxes/Nim.YAML-tmLanguage index b0b5876..cc63b53 100644 --- a/Syntaxes/Nim.YAML-tmLanguage +++ b/Syntaxes/Nim.YAML-tmLanguage @@ -172,7 +172,7 @@ patterns: - comment: Keywords that affect program control flow or scope. - name: keyword.primary.control + name: keyword.primary.control.nim match: (?\-\+\=~]) captures: - '1': { name: keyword.secondary } - '4': { name: variable.primary.assign.hot } - '5': { name: variable.primary.assign.hotter } - '6': { name: keyword.secondary.operator.kw-public } - '7': { name: storage.type.generic } - '8': { name: keyword.primary.assign.hottest } + '1': { name: keyword.secondary.nim } + '4': { name: variable.primary.assign.hot.nim } + '5': { name: variable.primary.assign.hotter.nim } + '6': { name: keyword.secondary.operator.kw-public.nim } + '7': { name: storage.type.generic.nim } + '8': { name: keyword.primary.assign.hottest.nim } - comment: Other keywords. name: keyword.other.secondary.nim diff --git a/Syntaxes/Nim.tmLanguage b/Syntaxes/Nim.tmLanguage index 5f1890a..ffa2ad4 100644 --- a/Syntaxes/Nim.tmLanguage +++ b/Syntaxes/Nim.tmLanguage @@ -471,7 +471,7 @@ match (?<![\w\x{80}-\x{10FFFF}])(await|block|break|continue|do|end|except|finally|raise|return|try|while|yield)(?![\w\x{80}-\x{10FFFF}]) name - keyword.primary.control + keyword.primary.control.nim comment @@ -487,32 +487,32 @@ 1 name - keyword.secondary + keyword.secondary.nim 4 name - variable.primary.assign.hot + variable.primary.assign.hot.nim 5 name - variable.primary.assign.hotter + variable.primary.assign.hotter.nim 6 name - keyword.secondary.operator.kw-public + keyword.secondary.operator.kw-public.nim 7 name - storage.type.generic + storage.type.generic.nim 8 name - keyword.primary.assign.hottest + keyword.primary.assign.hottest.nim comment @@ -520,7 +520,7 @@ match ((^|[\(\)\:\;])\s*(const|let|type|var)?\s+)([\w\x{80}-\x{10FFFF}\.\[\]\(\)\s]*?)?([\w\x{80}-\x{10FFFF}\[\]]+)([*]?)\s*(:\s*[\w\x{80}-\x{10FFFF}\.\[\]\(\)\s]*?)?(=)(?![\<\>\-\+\=~]) name - variable.primary.assign.hot + variable.primary.assign.hot.nim comment From ac3046e39c5f631e7d1d95c9a51ef6318c0d023f Mon Sep 17 00:00:00 2001 From: Oscar Campbell Date: Wed, 17 Jun 2015 21:53:51 +0200 Subject: [PATCH 4/6] Remove assign specific highlight. No good. --- Syntaxes/Nim.YAML-tmLanguage | 22 +++++++++--------- Syntaxes/Nim.tmLanguage | 43 +----------------------------------- 2 files changed, 12 insertions(+), 53 deletions(-) diff --git a/Syntaxes/Nim.YAML-tmLanguage b/Syntaxes/Nim.YAML-tmLanguage index cc63b53..341321b 100644 --- a/Syntaxes/Nim.YAML-tmLanguage +++ b/Syntaxes/Nim.YAML-tmLanguage @@ -93,7 +93,7 @@ patterns: begin: \" end: \" - name: entity.other.attribute-name.pattern.nim - match: ([\w\x{80}-\x{10FFFF}]+) + match: ([\[\]\w\x{80}-\x{10FFFF}]+) - {include: source.nim} - {include: source.nim} @@ -179,16 +179,16 @@ patterns: name: keyword.operator.boolean.nim match: ((?\-\+\=~]) - captures: - '1': { name: keyword.secondary.nim } - '4': { name: variable.primary.assign.hot.nim } - '5': { name: variable.primary.assign.hotter.nim } - '6': { name: keyword.secondary.operator.kw-public.nim } - '7': { name: storage.type.generic.nim } - '8': { name: keyword.primary.assign.hottest.nim } +# - comment: Assign operator. +# name: variable.primary.assign.hot.nim +# match: ((^|[\(\)\:\;])\s*(const|let|type|var)?\s+)([\w\x{80}-\x{10FFFF}\.\[\]\(\)\s]*?)?([\w\x{80}-\x{10FFFF}\[\]]+)([*]?)\s*(:\s*[\w\x{80}-\x{10FFFF}\.\[\]\(\)\s]*?)?(=)(?![\<\>\-\+\=~]) +# captures: +# '1': { name: keyword.secondary.nim } +# '4': { name: variable.primary.assign.hot.nim } +# '5': { name: variable.primary.assign.hotter.nim } +# '6': { name: keyword.secondary.operator.kw-public.nim } +# '7': { name: storage.type.generic.nim } +# '8': { name: keyword.primary.assign.hottest.nim } - comment: Other keywords. name: keyword.other.secondary.nim diff --git a/Syntaxes/Nim.tmLanguage b/Syntaxes/Nim.tmLanguage index ffa2ad4..5b88bdf 100644 --- a/Syntaxes/Nim.tmLanguage +++ b/Syntaxes/Nim.tmLanguage @@ -261,7 +261,7 @@ match - ([\w\x{80}-\x{10FFFF}]+) + ([\[\]\w\x{80}-\x{10FFFF}]+) name entity.other.attribute-name.pattern.nim @@ -481,47 +481,6 @@ name keyword.operator.boolean.nim - - captures - - 1 - - name - keyword.secondary.nim - - 4 - - name - variable.primary.assign.hot.nim - - 5 - - name - variable.primary.assign.hotter.nim - - 6 - - name - keyword.secondary.operator.kw-public.nim - - 7 - - name - storage.type.generic.nim - - 8 - - name - keyword.primary.assign.hottest.nim - - - comment - Assign operator. - match - ((^|[\(\)\:\;])\s*(const|let|type|var)?\s+)([\w\x{80}-\x{10FFFF}\.\[\]\(\)\s]*?)?([\w\x{80}-\x{10FFFF}\[\]]+)([*]?)\s*(:\s*[\w\x{80}-\x{10FFFF}\.\[\]\(\)\s]*?)?(=)(?![\<\>\-\+\=~]) - name - variable.primary.assign.hot.nim - comment Other keywords. From c17f9a82a0fb73006cb311e6bbbd2236c262054c Mon Sep 17 00:00:00 2001 From: Oscar Campbell Date: Wed, 24 Jun 2015 14:49:32 +0200 Subject: [PATCH 5/6] Reduction: Only fixes + prim/secondary kw-classing --- Syntaxes/Nim.YAML-tmLanguage | 144 ++++++++++++++++------------------- Syntaxes/Nim.tmLanguage | 128 +++++++++++++++---------------- 2 files changed, 126 insertions(+), 146 deletions(-) diff --git a/Syntaxes/Nim.YAML-tmLanguage b/Syntaxes/Nim.YAML-tmLanguage index 341321b..9f8d716 100644 --- a/Syntaxes/Nim.YAML-tmLanguage +++ b/Syntaxes/Nim.YAML-tmLanguage @@ -31,12 +31,12 @@ patterns: - begin: \{\.(emit:) ?(\"\"\") end: (\"\"\")\.? captures: - '1': {name: keyword.secondary.other.nim} + '1': {name: keyword.other.nim} '2': {name: comment.syntax.nim} endCaptures: '1': {name: comment.syntax.nim} patterns: - - name: keyword.secondary.operator.nim + - name: keyword.operator.nim begin: \` end: \` - {include: source.c} @@ -47,12 +47,12 @@ patterns: - begin: (asm )(\"\"\") end: \"\"\" captures: - '1': {name: keyword.secondary.other.nim} + '1': {name: keyword.other.nim} '2': {name: comment.syntax.nim} endCaptures: '0': {name: comment.syntax.nim} patterns: - - name: keyword.secondary.operator.nim + - name: keyword.operator.nim begin: \` end: \` - {include: source.asm} @@ -65,10 +65,10 @@ patterns: beginCaptures: '1': {name: storage.type.proc.nim} '2': {name: entity.name.function.nim} - '5': {name: keyword.secondary.operator.kw-public.nim} + '5': {name: keyword.operator.secondary.kw-public.nim} endCaptures: - '1': {name: keyword.secondary.operator.nim} + '1': {name: keyword.operator.nim} patterns: - comment: Generic match: \[[\w\x{80}-\x{10FFFF}]+\] @@ -137,34 +137,31 @@ patterns: name: constant.language.nim match: (?\-\+\=~]) -# captures: -# '1': { name: keyword.secondary.nim } -# '4': { name: variable.primary.assign.hot.nim } -# '5': { name: variable.primary.assign.hotter.nim } -# '6': { name: keyword.secondary.operator.kw-public.nim } -# '7': { name: storage.type.generic.nim } -# '8': { name: keyword.primary.assign.hottest.nim } - - comment: Other keywords. - name: keyword.other.secondary.nim + name: keyword.other.nim match: ((?1 name - keyword.secondary.other.nim + keyword.other.nim 2 @@ -101,7 +101,7 @@ end \` name - keyword.secondary.operator.nim + keyword.operator.nim include @@ -126,7 +126,7 @@ 1 name - keyword.secondary.other.nim + keyword.other.nim 2 @@ -152,7 +152,7 @@ end \` name - keyword.secondary.operator.nim + keyword.operator.nim include @@ -187,7 +187,7 @@ 5 name - keyword.secondary.operator.kw-public.nim + keyword.operator.secondary.kw-public.nim end @@ -197,7 +197,7 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim patterns @@ -368,13 +368,13 @@ begin - \s+(when|if)\b + (?:^|\s+|=)(when|if)\b captures 1 name - keyword.primary.control.nim + keyword.control.primary.nim comment @@ -389,8 +389,6 @@ control.variable.parameter.nim - name - control.variable.parameter.nim patterns @@ -401,19 +399,19 @@ begin - \s+(case)\b + (?:^|\s+|=)(case)\b captures 1 name - keyword.primary.control.nim + keyword.control.primary.nim comment Primary branching keyword 'case' end - (?=of) + (?=\bof\b) endCaptures 1 @@ -422,8 +420,6 @@ control.variable.parameter.nim - name - control.variable.parameter.nim patterns @@ -434,13 +430,13 @@ begin - \s+(of|else|elif)\b + (?:^|\s+)(of|else|elif)\b captures 1 name - keyword.secondary.control.nim + keyword.control.secondary.nim comment @@ -455,8 +451,6 @@ control.variable.parameter.nim - name - control.variable.parameter.nim patterns @@ -471,7 +465,7 @@ match (?<![\w\x{80}-\x{10FFFF}])(await|block|break|continue|do|end|except|finally|raise|return|try|while|yield)(?![\w\x{80}-\x{10FFFF}]) name - keyword.primary.control.nim + keyword.control.nim comment @@ -487,7 +481,7 @@ match ((?<![\w\x{80}-\x{10FFFF}])(addr|as|atomic|bind|cast|const|converter|defer|discard|distinct|div|enum|export|include|let|mixin|object|of|ptr|ref|shl|shr|static|type|var)(?![\w\x{80}-\x{10FFFF}])) name - keyword.other.secondary.nim + keyword.other.nim comment @@ -505,7 +499,7 @@ 1 name - keyword.primary.control.nim + keyword.control.nim comment @@ -522,7 +516,7 @@ 1 name - keyword.primary.control.nim + keyword.control.nim match @@ -540,7 +534,7 @@ 2 name - keyword.secondary.control.nim + keyword.control.nim comment @@ -554,7 +548,7 @@ 1 name - keyword.secondary.control.nim + keyword.control.nim match @@ -820,7 +814,7 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -841,12 +835,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -867,12 +861,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.primary.control.nim + keyword.control.nim end @@ -897,7 +891,7 @@ match (?<!\$)(\$[a-zA-Z0-9_]+) name - keyword.secondary.operator.nim + keyword.operator.nim include @@ -948,7 +942,7 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -969,12 +963,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -995,12 +989,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.control.nim + keyword.control.nim end @@ -1025,7 +1019,7 @@ match (?<!\$)(\$[a-zA-Z0-9_]+) name - keyword.secondary.operator.nim + keyword.operator.nim include @@ -1076,7 +1070,7 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1097,12 +1091,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1123,12 +1117,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.control.nim + keyword.control.nim end @@ -1153,7 +1147,7 @@ match (?<!\$)(\$[a-zA-Z0-9_]+) name - keyword.secondary.operator.nim + keyword.operator.nim include @@ -1204,7 +1198,7 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1225,12 +1219,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1251,12 +1245,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.control.nim + keyword.control.nim end @@ -1281,7 +1275,7 @@ match (?<!\$)(\$[a-zA-Z0-9_]+) name - keyword.secondary.operator.nim + keyword.operator.nim include @@ -1332,7 +1326,7 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1353,12 +1347,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1379,12 +1373,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.control.nim + keyword.control.nim end @@ -1409,7 +1403,7 @@ match (?<!\$)(\$[a-zA-Z0-9_]+) name - keyword.secondary.operator.nim + keyword.operator.nim include @@ -1460,7 +1454,7 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1481,12 +1475,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1507,12 +1501,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.control.nim + keyword.control.nim end @@ -1537,7 +1531,7 @@ match (?<!\$)(\$[a-zA-Z0-9_]+) name - keyword.secondary.operator.nim + keyword.operator.nim include @@ -1588,7 +1582,7 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1609,12 +1603,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.operator.nim + keyword.operator.nim end @@ -1635,12 +1629,12 @@ 1 name - keyword.secondary.operator.nim + keyword.operator.nim 2 name - keyword.secondary.control.nim + keyword.control.nim end @@ -1665,7 +1659,7 @@ match (?<!\$)(\$[a-zA-Z0-9_]+) name - keyword.secondary.operator.nim + keyword.operator.nim include From e343e965fd642bd182947803a9674e5932b2d9e1 Mon Sep 17 00:00:00 2001 From: Oscar Campbell Date: Wed, 24 Jun 2015 22:31:18 +0200 Subject: [PATCH 6/6] Make num type suffix match lenient to safen diffs --- Syntaxes/Nim.YAML-tmLanguage | 10 +++++----- Syntaxes/Nim.tmLanguage | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Syntaxes/Nim.YAML-tmLanguage b/Syntaxes/Nim.YAML-tmLanguage index 9f8d716..7c37484 100644 --- a/Syntaxes/Nim.YAML-tmLanguage +++ b/Syntaxes/Nim.YAML-tmLanguage @@ -115,23 +115,23 @@ patterns: - comment: A float literal name: constant.numeric.float.decimal.nim - match: (?comment A float literal match - (?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*((\.[_\d]+([eE][\+\-]?\d[_\d]*)?)|([eE][\+\-]?\d[_\d]*)))('?([fF](32|64|128))|[fFdD])? + (\d[_\d]*((\.[_\d]+([eE][\+\-]?\d[_\d]*)?)|([eE][\+\-]?\d[_\d]*)))('?([fF]\d)|[fFdD])? name constant.numeric.float.decimal.nim @@ -330,7 +330,7 @@ comment A hexadecimal literal match - (?<![\w\x{80}-\x{10FFFF}])(0[xX]\h[_\h]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? + (0[xX]\h[_\h]*)('?(([iIuUfF]\d)|[uUfFdD]))? name constant.numeric.integer.hexadecimal.nim @@ -338,7 +338,7 @@ comment A base-8 integer literal match - (?<![\w\x{80}-\x{10FFFF}])(0[ocC][0-7][_0-7]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? + (0[ocC][0-7][_0-7]*)('?(([iIuUfF]\d)|[uUfFdD]))? name constant.numeric.integer.octal.nim @@ -346,7 +346,7 @@ comment A base-2 integer literal match - (?<![\w\x{80}-\x{10FFFF}])(0(b|B)[01][_01]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? + (0(b|B)[01][_01]*)('?(([iIuUfF]\d)|[uUfFdD]))? name constant.numeric.integer.binary.nim @@ -354,7 +354,7 @@ comment A base-10 integer literal match - (?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? + (\d[_\d]*)('?(([iIuUfF]\d)|[uUfFdD]))? name constant.numeric.integer.decimal.nim @@ -378,7 +378,7 @@ comment - Primary branching keywords and their conditions + Primary branching keywords end (:) endCaptures