godoc: accept scanner.RawString too during EBNF parsing

Commit c8915a0696ddb53399e9c7ebae1cd1158f27175 changed the text/scanner
package to return a scanner.RawString (rather than a scanner.String) token
for raw string literals. This broke the EBNF parser which didn't look
for scanner.RawString.

Updated the EBNF parser code to reflect that change.

Fixes golang/go#25986

Change-Id: Ib9c133a7c357dd750a4038d2ed39be86a245995c
Reviewed-on: https://go-review.googlesource.com/120659
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/godoc/spec.go b/godoc/spec.go
index 6d6b9c2..9ec9427 100644
--- a/godoc/spec.go
+++ b/godoc/spec.go
@@ -74,7 +74,7 @@
 	case scanner.Ident:
 		p.parseIdentifier(false)
 
-	case scanner.String:
+	case scanner.String, scanner.RawString:
 		p.next()
 		const ellipsis = '…' // U+2026, the horizontal ellipsis character
 		if p.tok == ellipsis {
diff --git a/godoc/spec_test.go b/godoc/spec_test.go
new file mode 100644
index 0000000..c016516
--- /dev/null
+++ b/godoc/spec_test.go
@@ -0,0 +1,22 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package godoc
+
+import (
+	"bytes"
+	"strings"
+	"testing"
+)
+
+func TestParseEBNFString(t *testing.T) {
+	var p ebnfParser
+	var buf bytes.Buffer
+	src := []byte("octal_byte_value = `\\` octal_digit octal_digit octal_digit .")
+	p.parse(&buf, src)
+
+	if strings.Contains(buf.String(), "error") {
+		t.Error(buf.String())
+	}
+}