Skip to content

Commit

Permalink
[c++] grammar in endless loop. Fixes #23850
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed May 29, 2017
1 parent fdadd0e commit ccd3c1f
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 12 deletions.
2 changes: 1 addition & 1 deletion extensions/cpp/OSSREADME.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[
{
"name": "atom/language-c",
"version": "0.51.3",
"version": "0.0.0",

This comment has been minimized.

Copy link
@jens1o

jens1o May 29, 2017

Contributor

0.0.0?

This comment has been minimized.

Copy link
@aeschli

aeschli May 29, 2017

Author Contributor

We are always on master...

"license": "MIT",
"repositoryURL": "https://github.com/atom/language-c",
"description": "The files syntaxes/c.json and syntaxes/c++.json were derived from the Atom package https://atom.io/packages/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle."
Expand Down
22 changes: 11 additions & 11 deletions extensions/cpp/syntaxes/c.json
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@
},
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -858,7 +858,7 @@
},
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -1011,7 +1011,7 @@
},
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -1048,7 +1048,7 @@
"end": "(?=^\\s*((#)\\s*(?:elif|else|endif)\\b))",
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -1108,7 +1108,7 @@
},
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -1145,7 +1145,7 @@
"end": "(?=^\\s*((#)\\s*(?:elif|else|endif)\\b))",
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -1192,7 +1192,7 @@
"end": "(?=^\\s*((#)\\s*(?:elif|else|endif)\\b))",
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -1251,7 +1251,7 @@
},
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -1353,7 +1353,7 @@
},
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -1442,7 +1442,7 @@
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down Expand Up @@ -1529,7 +1529,7 @@
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"begin": "\\G",
"begin": "\\G(?=.)",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
Expand Down
3 changes: 3 additions & 0 deletions extensions/cpp/test/colorize-fixtures/test-23630.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#ifndef _UCRT
#define _UCRT
#endif
123 changes: 123 additions & 0 deletions extensions/cpp/test/colorize-results/test-23630_cpp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
[
{
"c": "#",
"t": "source.cpp meta.preprocessor.c keyword.control.directive.conditional.c punctuation.definition.directive.c",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": "ifndef",
"t": "source.cpp meta.preprocessor.c keyword.control.directive.conditional.c",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " ",
"t": "source.cpp meta.preprocessor.c",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "meta.preprocessor: #569CD6"
}
},
{
"c": "_UCRT",
"t": "source.cpp meta.preprocessor.c entity.name.function.preprocessor.c",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": " ",
"t": "source.cpp meta.preprocessor.macro.c",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "meta.preprocessor: #569CD6"
}
},
{
"c": "#",
"t": "source.cpp meta.preprocessor.macro.c keyword.control.directive.define.c punctuation.definition.directive.c",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": "define",
"t": "source.cpp meta.preprocessor.macro.c keyword.control.directive.define.c",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " ",
"t": "source.cpp meta.preprocessor.macro.c",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "meta.preprocessor: #569CD6"
}
},
{
"c": "_UCRT",
"t": "source.cpp meta.preprocessor.macro.c entity.name.function.preprocessor.c",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": "#",
"t": "source.cpp meta.preprocessor.c keyword.control.directive.conditional.c punctuation.definition.directive.c",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": "endif",
"t": "source.cpp meta.preprocessor.c keyword.control.directive.conditional.c",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
}
]

0 comments on commit ccd3c1f

Please sign in to comment.