-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config: improve duplicate property check (#560)
- Loading branch information
1 parent
92e8098
commit 0546c22
Showing
28 changed files
with
271 additions
and
255 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Test { | ||
outer = something; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[31m[CE1] Error:[0m property's value could not be parsed. | ||
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m/source.hpp:2:13[38;5;246m][0m | ||
[38;5;246m│[0m | ||
[38;5;246m2 │[0m [38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249mo[0m[38;5;249mu[0m[38;5;249mt[0m[38;5;249me[0m[38;5;249mr[0m[38;5;249m [0m[38;5;249m=[0m[38;5;249m [0m[38;5;201ms[0m[38;5;201mo[0m[38;5;201mm[0m[38;5;201me[0m[38;5;201mt[0m[38;5;201mh[0m[38;5;201mi[0m[38;5;201mn[0m[38;5;201mg[0m[38;5;249m;[0m | ||
[38;5;240m │[0m [38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m┬[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m | ||
[38;5;240m │[0m [38;5;201m╰[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m invalid value | ||
[38;5;240m │[0m | ||
[38;5;240m │[0m [38;5;115mHelp[0m: use quotes `"` around the value, or a QUOTE macro if it contains #define values | ||
[38;5;246m───╯[0m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#define QUOTE(x) #x | ||
#define PATHTO(x) \some\x | ||
#define QPATHTO(x) QUOTE(PATHTO(x)) | ||
|
||
path = PATHTO(thing); | ||
class Test { | ||
path = PATHTO(thing); | ||
}; |
23 changes: 23 additions & 0 deletions
23
libs/config/tests/errors/ce2_invalid_value_macro/stdout.ansi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[31m[CE2] Error:[0m macro's result could not be parsed | ||
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m/source.hpp:5:8[38;5;246m][0m | ||
[38;5;246m│[0m | ||
[38;5;246m5 │[0m [38;5;249mp[0m[38;5;249ma[0m[38;5;249mt[0m[38;5;249mh[0m[38;5;249m [0m[38;5;249m=[0m[38;5;249m [0m[38;5;201mP[0m[38;5;201mA[0m[38;5;201mT[0m[38;5;201mH[0m[38;5;201mT[0m[38;5;201mO[0m[38;5;249m([0m[38;5;249mt[0m[38;5;249mh[0m[38;5;249mi[0m[38;5;249mn[0m[38;5;249mg[0m[38;5;249m)[0m[38;5;249m;[0m | ||
[38;5;240m │[0m [38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m┬[0m[38;5;201m─[0m[38;5;201m─[0m | ||
[38;5;240m │[0m [38;5;201m╰[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m invalid macro result | ||
[38;5;240m │[0m | ||
[38;5;240m │[0m [38;5;115mHelp[0m: perhaps this macro has a `Q_` variant or you need `QUOTE(..)` | ||
[38;5;240m │[0m | ||
[38;5;240m │[0m [38;5;115mNote[0m: The processed output was `[38;5;201m\some\thing[0m` | ||
[38;5;246m───╯[0m | ||
|
||
[31m[CE2] Error:[0m macro's result could not be parsed | ||
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m/source.hpp:7:12[38;5;246m][0m | ||
[38;5;246m│[0m | ||
[38;5;246m7 │[0m [38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249mp[0m[38;5;249ma[0m[38;5;249mt[0m[38;5;249mh[0m[38;5;249m [0m[38;5;249m=[0m[38;5;249m [0m[38;5;201mP[0m[38;5;201mA[0m[38;5;201mT[0m[38;5;201mH[0m[38;5;201mT[0m[38;5;201mO[0m[38;5;249m([0m[38;5;249mt[0m[38;5;249mh[0m[38;5;249mi[0m[38;5;249mn[0m[38;5;249mg[0m[38;5;249m)[0m[38;5;249m;[0m | ||
[38;5;240m │[0m [38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m┬[0m[38;5;201m─[0m[38;5;201m─[0m | ||
[38;5;240m │[0m [38;5;201m╰[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m invalid macro result | ||
[38;5;240m │[0m | ||
[38;5;240m │[0m [38;5;115mHelp[0m: perhaps this macro has a `Q_` variant or you need `QUOTE(..)` | ||
[38;5;240m │[0m | ||
[38;5;240m │[0m [38;5;115mNote[0m: The processed output was `[38;5;201m\some\thing[0m` | ||
[38;5;246m───╯[0m |
8 changes: 8 additions & 0 deletions
8
libs/config/tests/errors/ce3_duplicate_property_separate/source.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class Test { | ||
class Child { | ||
inner = "something"; | ||
}; | ||
class Child { | ||
inner = "something"; | ||
}; | ||
}; |
11 changes: 11 additions & 0 deletions
11
libs/config/tests/errors/ce3_duplicate_property_separate/stdout.ansi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[31m[CE3] Error:[0m property was defined more than once | ||
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m/source.hpp:3:9[38;5;246m][0m | ||
[38;5;246m│[0m | ||
[38;5;246m3 │[0m [38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;201mi[0m[38;5;201mn[0m[38;5;201mn[0m[38;5;201me[0m[38;5;201mr[0m[38;5;249m [0m[38;5;249m=[0m[38;5;249m [0m[38;5;249m"[0m[38;5;249ms[0m[38;5;249mo[0m[38;5;249mm[0m[38;5;249me[0m[38;5;249mt[0m[38;5;249mh[0m[38;5;249mi[0m[38;5;249mn[0m[38;5;249mg[0m[38;5;249m"[0m[38;5;249m;[0m | ||
[38;5;240m │[0m [38;5;201m─[0m[38;5;201m─[0m[38;5;201m┬[0m[38;5;201m─[0m[38;5;201m─[0m | ||
[38;5;240m │[0m [38;5;201m╰[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m first defined here | ||
[38;5;240m │[0m | ||
[38;5;246m6 │[0m [38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;155mi[0m[38;5;155mn[0m[38;5;155mn[0m[38;5;155me[0m[38;5;155mr[0m[38;5;249m [0m[38;5;249m=[0m[38;5;249m [0m[38;5;249m"[0m[38;5;249ms[0m[38;5;249mo[0m[38;5;249mm[0m[38;5;249me[0m[38;5;249mt[0m[38;5;249mh[0m[38;5;249mi[0m[38;5;249mn[0m[38;5;249mg[0m[38;5;249m"[0m[38;5;249m;[0m | ||
[38;5;240m │[0m [38;5;155m─[0m[38;5;155m─[0m[38;5;155m┬[0m[38;5;155m─[0m[38;5;155m─[0m | ||
[38;5;240m │[0m [38;5;155m╰[0m[38;5;155m─[0m[38;5;155m─[0m[38;5;155m─[0m[38;5;155m─[0m also defined here | ||
[38;5;246m───╯[0m |
6 changes: 6 additions & 0 deletions
6
libs/config/tests/errors/ce3_duplicate_property_shadow_property/source.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class Test { | ||
thing = 1; | ||
class thing { | ||
value = 1; | ||
}; | ||
}; |
10 changes: 10 additions & 0 deletions
10
libs/config/tests/errors/ce3_duplicate_property_shadow_property/stdout.ansi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[31m[CE3] Error:[0m property was defined more than once | ||
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m/source.hpp:2:5[38;5;246m][0m | ||
[38;5;246m│[0m | ||
[38;5;246m2 │[0m [38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;201mt[0m[38;5;201mh[0m[38;5;201mi[0m[38;5;201mn[0m[38;5;201mg[0m[38;5;249m [0m[38;5;249m=[0m[38;5;249m [0m[38;5;249m1[0m[38;5;249m;[0m | ||
[38;5;240m │[0m [38;5;201m─[0m[38;5;201m─[0m[38;5;201m┬[0m[38;5;201m─[0m[38;5;201m─[0m | ||
[38;5;240m │[0m [38;5;201m╰[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m[38;5;201m─[0m first defined here | ||
[38;5;246m3 │[0m [38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249mc[0m[38;5;249ml[0m[38;5;249ma[0m[38;5;249ms[0m[38;5;249ms[0m[38;5;249m [0m[38;5;155mt[0m[38;5;155mh[0m[38;5;155mi[0m[38;5;155mn[0m[38;5;155mg[0m[38;5;249m [0m[38;5;249m{[0m | ||
[38;5;240m │[0m [38;5;155m─[0m[38;5;155m─[0m[38;5;155m┬[0m[38;5;155m─[0m[38;5;155m─[0m | ||
[38;5;240m │[0m [38;5;155m╰[0m[38;5;155m─[0m[38;5;155m─[0m[38;5;155m─[0m[38;5;155m─[0m also defined here | ||
[38;5;246m───╯[0m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
outer = "nosemi" | ||
class Test { | ||
inner = "nosemi" | ||
}; |
19 changes: 19 additions & 0 deletions
19
libs/config/tests/errors/ce4_missing_semicolon/stdout.ansi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[31m[CE4] Error:[0m property is missing a semicolon | ||
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m/source.hpp:1:17[38;5;246m][0m | ||
[38;5;246m│[0m | ||
[38;5;246m1 │[0m [38;5;249mo[0m[38;5;249mu[0m[38;5;249mt[0m[38;5;249me[0m[38;5;249mr[0m[38;5;249m [0m[38;5;249m=[0m[38;5;249m [0m[38;5;249m"[0m[38;5;249mn[0m[38;5;249mo[0m[38;5;249ms[0m[38;5;249me[0m[38;5;249mm[0m[38;5;249mi[0m[38;5;249m"[0m | ||
[38;5;240m │[0m [38;5;201m┬[0m | ||
[38;5;240m │[0m [38;5;201m╰[0m[38;5;201m─[0m[38;5;201m─[0m missing [38;5;201msemicolon[0m | ||
[38;5;240m │[0m | ||
[38;5;240m │[0m [38;5;115mHelp[0m: add a semicolon `[38;5;201m;[0m` to the end of the property | ||
[38;5;246m───╯[0m | ||
|
||
[31m[CE4] Error:[0m property is missing a semicolon | ||
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m/source.hpp:3:21[38;5;246m][0m | ||
[38;5;246m│[0m | ||
[38;5;246m3 │[0m [38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249m [0m[38;5;249mi[0m[38;5;249mn[0m[38;5;249mn[0m[38;5;249me[0m[38;5;249mr[0m[38;5;249m [0m[38;5;249m=[0m[38;5;249m [0m[38;5;249m"[0m[38;5;249mn[0m[38;5;249mo[0m[38;5;249ms[0m[38;5;249me[0m[38;5;249mm[0m[38;5;249mi[0m[38;5;249m"[0m | ||
[38;5;240m │[0m [38;5;201m┬[0m | ||
[38;5;240m │[0m [38;5;201m╰[0m[38;5;201m─[0m[38;5;201m─[0m missing [38;5;201msemicolon[0m | ||
[38;5;240m │[0m | ||
[38;5;240m │[0m [38;5;115mHelp[0m: add a semicolon `[38;5;201m;[0m` to the end of the property | ||
[38;5;246m───╯[0m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
array = {1,2,3}; |
Oops, something went wrong.