aboutsummaryrefslogtreecommitdiff
path: root/parser
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-03-22 00:53:56 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-03-22 00:53:56 +0100
commitce2d2a718d45acf7167776709f0a10b7b695492e (patch)
tree84dbaa10c26d402b047eb450bf38db6f428a3b94 /parser
parente0efae97b77ef3e0c3c8435b5ac44bc1dab7b94a (diff)
megacheck
Diffstat (limited to 'parser')
-rw-r--r--parser/parser_test.go9
-rw-r--r--parser/parser_tracing.go2
2 files changed, 11 insertions, 0 deletions
diff --git a/parser/parser_test.go b/parser/parser_test.go
index b451ddf..7fe5268 100644
--- a/parser/parser_test.go
+++ b/parser/parser_test.go
@@ -711,6 +711,9 @@ func TestParsingEmptyArrayLiterals(t *testing.T) {
checkParserErrors(t, p)
stmt, ok := program.Statements[0].(*ast.ExpressionStatement)
+ if !ok {
+ t.Fatalf("stmt not ast.EspressionStatement. got=%T", stmt)
+ }
array, ok := stmt.Expression.(*ast.ArrayLiteral)
if !ok {
t.Fatalf("exp not ast.ArrayLiteral. got=%T", stmt.Expression)
@@ -730,6 +733,9 @@ func TestParsingArrayLiterals(t *testing.T) {
checkParserErrors(t, p)
stmt, ok := program.Statements[0].(*ast.ExpressionStatement)
+ if !ok {
+ t.Fatalf("stmt not ast.EspressionStatement. got=%T", stmt)
+ }
array, ok := stmt.Expression.(*ast.ArrayLiteral)
if !ok {
t.Fatalf("exp not ast.ArrayLiteral. got=%T", stmt.Expression)
@@ -753,6 +759,9 @@ func TestParsingIndexExpressions(t *testing.T) {
checkParserErrors(t, p)
stmt, ok := program.Statements[0].(*ast.ExpressionStatement)
+ if !ok {
+ t.Fatalf("stmt not ast.EspressionStatement. got=%T", stmt)
+ }
indexExp, ok := stmt.Expression.(*ast.IndexExpression)
if !ok {
t.Fatalf("exp not *ast.IndexExpression. got=%T", stmt.Expression)
diff --git a/parser/parser_tracing.go b/parser/parser_tracing.go
index 5fc569b..bdffbd5 100644
--- a/parser/parser_tracing.go
+++ b/parser/parser_tracing.go
@@ -1,3 +1,5 @@
+// +build ignore
+
package parser
import (