aboutsummaryrefslogtreecommitdiff
path: root/syntax/scan_test.go
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2017-10-10 15:46:17 -0400
committerAlan Donovan <adonovan@google.com>2017-10-10 15:46:17 -0400
commitae06384bfb5755fb94e9fc095f9f7de044f4808c (patch)
tree764b0ce50ce60e8ac97450b8b6730bd6b1f32214 /syntax/scan_test.go
parent78b3c34942a39834fff8d4dd6a48bc34bd8ae115 (diff)
downloadstarlark-go-ae06384bfb5755fb94e9fc095f9f7de044f4808c.tar.gz
syntax: allow newline after expression
Change-Id: I3087d84e4be9f85a68ec088ea5935a7d18fd0407
Diffstat (limited to 'syntax/scan_test.go')
-rw-r--r--syntax/scan_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/syntax/scan_test.go b/syntax/scan_test.go
index b5dd738..2f33c68 100644
--- a/syntax/scan_test.go
+++ b/syntax/scan_test.go
@@ -61,6 +61,7 @@ func TestScanner(t *testing.T) {
{`123 "foo" hello x.y`, `123 "foo" hello x . y EOF`},
{`print(x)`, "print ( x ) EOF"},
{`print(x); print(y)`, "print ( x ) ; print ( y ) EOF"},
+ {"\nprint(\n1\n)\n", "print ( 1 ) newline EOF"}, // final \n is at toplevel on non-blank line => token
{`/ // /= //= ///=`, "/ // /= //= // /= EOF"},
{`# hello
print(x)`, "print ( x ) EOF"},