aboutsummaryrefslogtreecommitdiff
path: root/test/nul1.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2016-06-06 17:59:05 -0700
committerMatthew Dempsky <mdempsky@google.com>2016-08-19 01:10:21 +0000
commit70544c91ffac19f5ffa66c59e3097f3f1fe900f8 (patch)
treec08092c66c598727d7ee4354196e64b34ba34cdb /test/nul1.go
parent2ff463948c92e71651a31c621826281035a7071a (diff)
downloadgo-70544c91ffac19f5ffa66c59e3097f3f1fe900f8.tar.gz
go-70544c91ffac19f5ffa66c59e3097f3f1fe900f8.zip
cmd/compile/internal/syntax: match old parser errors and line numbers
This makes a bunch of changes to package syntax to tweak line numbers for AST nodes. For example, short variable declaration statements are now associated with the location of the ":=" token, and function calls are associated with the location of the final ")" token. These help satisfy many unit tests that assume the old parser's behavior. Because many of these changes are questionable, they're guarded behind a new "gcCompat" const to make them easy to identify and revisit in the future. A handful of remaining tests are too difficult to make behave identically. These have been updated to execute with -newparser=0 and comments explaining why they need to be fixed. all.bash now passes with both the old and new parsers. Change-Id: Iab834b71ca8698d39269f261eb5c92a0d55a3bf4 Reviewed-on: https://go-review.googlesource.com/27199 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'test/nul1.go')
-rw-r--r--test/nul1.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/nul1.go b/test/nul1.go
index 20426b4fa0..624101b621 100644
--- a/test/nul1.go
+++ b/test/nul1.go
@@ -1,4 +1,4 @@
-// errorcheckoutput
+// errorcheckoutput -newparser=0
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
@@ -6,6 +6,10 @@
// Test source files and strings containing NUL and invalid UTF-8.
+// TODO(mdempsky): Update error expectations for -newparser=1. The new
+// lexer skips over NUL and invalid UTF-8 sequences, so they don't emit
+// "illegal character" or "invalid identifier character" errors.
+
package main
import (
@@ -53,4 +57,3 @@ var z` + "\xc1\x81" + ` int // ERROR "UTF-8" "invalid identifier character"
`)
}
-