compiler: Add Preprocessor Support

TODO: Test that file names are properly tracked in included
files.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-05-07 23:05:47 -04:00
parent fac1cc4948
commit 754102d601
16 changed files with 471 additions and 14 deletions
+2
View File
@@ -0,0 +1,2 @@
#include <nested-split-a.p4>
#include <nested-split-b.p4>
+1
View File
@@ -0,0 +1 @@
state start {
+5
View File
@@ -0,0 +1,5 @@
transition select (false) {
true: reject;
false: reject;
};
}
+3
View File
@@ -0,0 +1,3 @@
parser main_parser() {
#include <nested-split-2.p4>
};
+1
View File
@@ -0,0 +1 @@
#include <testing-split-oneline-a.p4>#include <testing-split-oneline-b.p4>
+1
View File
@@ -0,0 +1 @@
#include <testing-split-a.p4>
+1
View File
@@ -0,0 +1 @@
#include <unfound.p4>
+1
View File
@@ -0,0 +1 @@
#include <testing.p4>
+3
View File
@@ -0,0 +1,3 @@
parser main_parser() {
state start {
#include <testing-split-b.p4>
+6
View File
@@ -0,0 +1,6 @@
transition select (false) {
true: reject;
false: reject;
};
}
};
@@ -0,0 +1,3 @@
parser main_parser() {
state start {
transition
@@ -0,0 +1,6 @@
select (false) {
true: reject;
false: reject;
};
}
};
+8
View File
@@ -0,0 +1,8 @@
parser main_parser() {
state start {
transition select (false) {
true: reject;
false: reject;
};
}
};