Skip to content

Commit c680c59

Browse files
committed
fix AssertIsList in multiple targets. Go doesn't pass test and has no AssertIsList so I'm dropping that test from the Go test suite.
How did a comment to the C++ runnerFor my future reference as to how to build things from the command line. Signed-off-by: Terence Parr <[email protected]>
1 parent c77c7d1 commit c680c59

File tree

8 files changed

+29
-5
lines changed

8 files changed

+29
-5
lines changed

runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ListLabelForClosureContext.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ expression
3333
[input]
3434
a
3535

36+
[skip]
37+
Go

runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ListLabelsOnRuleRefStartOfAlt.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ expression
2828

2929
[input]
3030
a and b
31+
32+
[skip]
33+
Go

runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/CSharp.test.stg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ AppendStr(a,b) ::= <%<Append(a,b)>%>
1818

1919
Concat(a,b) ::= "<a><b>"
2020

21-
AssertIsList(v) ::= "System.Collections.IList __ttt__ = <v>;" // just use static type system
21+
AssertIsList(v) ::= "System.Collections.IList __ttt__ = (System.Collections.IList)<v>;" // just use static type system
2222

2323
AssignLocal(s,v) ::= "<s> = <v>;"
2424

runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Go.test.stg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ AppendStr(a,b) ::= "<a> + <b>"
1818

1919
Concat(a,b) ::= "<a><b>"
2020

21-
AssertIsList(v) ::= ""
21+
AssertIsList(v) ::= "TODO!!"
2222

2323
AssignLocal(s, v) ::= "<s> = <v>;"
2424

runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/JavaScript.test.stg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ AppendStr(a,b) ::= <%<Append(a,b)>%>
1818

1919
Concat(a,b) ::= "<a><b>"
2020

21-
AssertIsList(v) ::= <<if ( !(v instanceof Array) ) {throw "value is not an array";}>>
21+
AssertIsList(v) ::= <<if ( !(<v> instanceof Array) ) {throw "value is not an array";}>>
2222

2323
AssignLocal(s,v) ::= "<s> = <v>;"
2424

runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Python2.test.stg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ AppendStr(a,b) ::= "<a> + <b>"
1818

1919
Concat(a,b) ::= "<a><b>"
2020

21-
AssertIsList(v) ::= "assert isinstance(v, (list, tuple))"
21+
AssertIsList(v) ::= "assert isinstance(<v>, (list, tuple))"
2222

2323
AssignLocal(s,v) ::= "<s> = <v>"
2424

runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Python3.test.stg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ AppendStr(a,b) ::= "<a> + <b>"
1818

1919
Concat(a,b) ::= "<a><b>"
2020

21-
AssertIsList(v) ::= "assert isinstance(v, (list, tuple))"
21+
AssertIsList(v) ::= "assert isinstance(<v>, (list, tuple))"
2222

2323
AssignLocal(s,v) ::= "<s> = <v>"
2424

runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/CppRunner.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@
2121
import static org.antlr.v4.test.runtime.RuntimeTestUtils.getOS;
2222
import static org.antlr.v4.test.runtime.RuntimeTestUtils.isWindows;
2323

24+
/**
25+
* For my own information on I'm recording what I needed to do to get a unit test to compile and run in C++ on the Mac.
26+
* I got a segmentation violation and couldn't figure out how to get information about it, so I turned on debugging
27+
* and then figured out lldb enough to create this issue: https://github.com/antlr/antlr4/issues/3845 on a bug.
28+
*
29+
* cd ~/antlr/code/antlr4/runtime/Cpp
30+
* cmake . -D CMAKE_OSX_ARCHITECTURES="arm64; x86_64" -DCMAKE_BUILD_TYPE=Debug
31+
* make -j 8
32+
*
33+
* In test dir with generated test code:
34+
*
35+
* clang++ -g -std=c++17 -I /Users/parrt/antlr/code/antlr4/runtime/Cpp/runtime/src -L. -lantlr4-runtime *.cpp
36+
* ./a.out input
37+
*
38+
* $ lldb ./a.out input
39+
* (lldb) run
40+
* ... crash ...
41+
* (lldb) thread backtrace
42+
*/
2443
public class CppRunner extends RuntimeRunner {
2544
@Override
2645
public String getLanguage() {

0 commit comments

Comments
 (0)