]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: move parser.go remnants into noder.go
authorMatthew Dempsky <mdempsky@google.com>
Mon, 31 Oct 2016 23:42:30 +0000 (16:42 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 31 Oct 2016 23:53:50 +0000 (23:53 +0000)
Change-Id: I54f8788a4703283b9aa3904e2e610097ac3e3586
Reviewed-on: https://go-review.googlesource.com/32471
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/noder.go
src/cmd/compile/internal/gc/parser.go [deleted file]

index 5e3206d6e678dfa8ae0e5c81ed1167b14696d34b..4f1c883b5a15e8ffa2327e62202cf8ec4b4ccd93 100644 (file)
@@ -1150,3 +1150,18 @@ func (p *noder) pragma(pos, line int, text string) syntax.Pragma {
 
        return 0
 }
+
+func mkname(sym *Sym) *Node {
+       n := oldname(sym)
+       if n.Name != nil && n.Name.Pack != nil {
+               n.Name.Pack.Used = true
+       }
+       return n
+}
+
+func unparen(x *Node) *Node {
+       for x.Op == OPAREN {
+               x = x.Left
+       }
+       return x
+}
diff --git a/src/cmd/compile/internal/gc/parser.go b/src/cmd/compile/internal/gc/parser.go
deleted file mode 100644 (file)
index 8f63018..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015 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 gc
-
-// The recursive-descent parser is built around a slighty modified grammar
-// of Go to accommodate for the constraints imposed by strict one token look-
-// ahead, and for better error handling. Subsequent checks of the constructed
-// syntax tree restrict the language accepted by the compiler to proper Go.
-//
-// Semicolons are inserted by the lexer. The parser uses one-token look-ahead
-// to handle optional commas and semicolons before a closing ) or } .
-
-func mkname(sym *Sym) *Node {
-       n := oldname(sym)
-       if n.Name != nil && n.Name.Pack != nil {
-               n.Name.Pack.Used = true
-       }
-       return n
-}
-
-func unparen(x *Node) *Node {
-       for x.Op == OPAREN {
-               x = x.Left
-       }
-       return x
-}