Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions grammars/verilogPreprocLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,15 @@ mode KEYWOORDS_MODE;
// include argument processing
mode INCLUDE_MODE;
INCLUDE_MODE_STR
: STR -> type(STR),popMode
: STR -> type(STR)
;

INCLUDE_MODE_STR_CHEVRONS
: '<' ( ~('\\'|'>') )* '>' -> type(STR),popMode
: '<' ( ~('\\'|'>') )* '>' -> type(STR)
;
INCLUDE_LINE_COMMENT : LINE_COMMENT -> popMode,type(LINE_COMMENT),channel(CH_LINE_COMMENT);
INCLUDE_MODE_NEW_LINE: CRLF -> type(NEW_LINE),popMode,skip;

INCLUDE_MODE_MACRO_ENTER: '`' -> popMode,pushMode(DIRECTIVE_MODE),skip;
INCLUDE_MODE_WS : WS ->skip;

Expand Down
1 change: 0 additions & 1 deletion src/verilogPreproc/out_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ VerilogPreprocOutBuffer& VerilogPreprocOutBuffer::operator<<(

VerilogPreprocOutBuffer& VerilogPreprocOutBuffer::operator<<(
const VerilogPreprocOutBuffer &other) {
(*this) << endl;
(*static_cast<stringstream*>(this)) << other.str();
for (auto &i : other.file_line_map) {
FileLineMapItem i_new(i.line + output_line, i.file_override,
Expand Down
2 changes: 0 additions & 2 deletions tests/sv_pp/expected/debug_macro.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@





$display(">> %s, %d: %s", "sv_pp/src/debug_macro.txt", 3, "msg")
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

"good content"
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

"good content"
7 changes: 1 addition & 6 deletions tests/sv_pp/expected/include_many_dir/from_subdirectory.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@

"file2-a.txt"

"file2-a.txt"

"file2-a.txt"
"file2-a.txt""file2-a.txt""file2-a.txt"
3 changes: 3 additions & 0 deletions tests/sv_pp/expected/include_many_dir/from_subdirectory2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"file2-a.txt"
"file2-a.txt"
"file2-a.txt"
4 changes: 0 additions & 4 deletions tests/sv_pp/expected/include_many_dir/transitive.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@

"transitive-0"

"transitive-1"

"transitive-2"

"transitive-3"
1 change: 0 additions & 1 deletion tests/sv_pp/expected/include_same_dir/basic_include.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@



"a.vh"
3 changes: 0 additions & 3 deletions tests/sv_pp/expected/include_same_dir/basic_include2times.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@



"a.vh"


1 change: 1 addition & 0 deletions tests/sv_pp/src/include_many_dir/dir0-a/dir1-a/file2-b.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"file2-a.txt"
3 changes: 3 additions & 0 deletions tests/sv_pp/src/include_many_dir/from_subdirectory2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`include "dir0-a/dir1-a/file2-b.txt"
`include "./dir0-a/dir1-a/file2-b.txt"
`include "./dir0-a/../dir0-a/dir1-a/file2-b.txt"
3 changes: 3 additions & 0 deletions tests/test_verilog_preproc_include.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def test_basic_include2times(self):

def test_from_subdirectory(self):
self.run_test(["include_many_dir", "from_subdirectory.txt"], [])

def test_from_subdirectory2(self):
self.run_test(["include_many_dir", "from_subdirectory2.txt"], [])

def test_local_include_higher_priority(self):
self.run_test(
Expand Down