compiler: Reworked Preprocessor To Support Better Error Messages
Can now support showing the trail of includes in an error message. Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
state start {
|
||||
Testing ts;
|
||||
ts.yesno = true;
|
||||
ts.count = 5;
|
||||
transition select (ts.yesno == "testing") {
|
||||
true: accept;
|
||||
false: reject;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
parser main_parser() {
|
||||
#include <file-loc-error-parser-state.p4>
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
struct Testing {
|
||||
bool yesno;
|
||||
int count;
|
||||
};
|
||||
#include <file-loc-error-parser.p4>
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: In file-loc-error-parser-state.p4 included at position 23 in file-loc-error-parser.p4 included at position 51 in file-loc-error.p4, there was an error:
|
||||
...ect (ts.yesno == "testing") {...
|
||||
Could not parse transition select expression selector expression: Types of values used with binary expression are not the same
|
||||
Reference in New Issue
Block a user