Commit d78d0de4 authored by Matthew Dempsky's avatar Matthew Dempsky

go/ast: fix comments misinterpreted as documentation

The comments describing blocks of Pos/End implementations for various
nodes types are being misinterpreted as documentation for BadDecl,
BadExpr, BadStmt, and ImportSpec's Pos methods.

Change-Id: I935b0bc38dbc13e9305f3efeb437dd3a6575d9a1
Reviewed-on: https://go-review.googlesource.com/24152Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
parent 26d6dc6b
...@@ -418,7 +418,7 @@ type ( ...@@ -418,7 +418,7 @@ type (
) )
// Pos and End implementations for expression/type nodes. // Pos and End implementations for expression/type nodes.
//
func (x *BadExpr) Pos() token.Pos { return x.From } func (x *BadExpr) Pos() token.Pos { return x.From }
func (x *Ident) Pos() token.Pos { return x.NamePos } func (x *Ident) Pos() token.Pos { return x.NamePos }
func (x *Ellipsis) Pos() token.Pos { return x.Ellipsis } func (x *Ellipsis) Pos() token.Pos { return x.Ellipsis }
...@@ -709,7 +709,7 @@ type ( ...@@ -709,7 +709,7 @@ type (
) )
// Pos and End implementations for statement nodes. // Pos and End implementations for statement nodes.
//
func (s *BadStmt) Pos() token.Pos { return s.From } func (s *BadStmt) Pos() token.Pos { return s.From }
func (s *DeclStmt) Pos() token.Pos { return s.Decl.Pos() } func (s *DeclStmt) Pos() token.Pos { return s.Decl.Pos() }
func (s *EmptyStmt) Pos() token.Pos { return s.Semicolon } func (s *EmptyStmt) Pos() token.Pos { return s.Semicolon }
...@@ -854,7 +854,7 @@ type ( ...@@ -854,7 +854,7 @@ type (
) )
// Pos and End implementations for spec nodes. // Pos and End implementations for spec nodes.
//
func (s *ImportSpec) Pos() token.Pos { func (s *ImportSpec) Pos() token.Pos {
if s.Name != nil { if s.Name != nil {
return s.Name.Pos() return s.Name.Pos()
...@@ -931,7 +931,7 @@ type ( ...@@ -931,7 +931,7 @@ type (
) )
// Pos and End implementations for declaration nodes. // Pos and End implementations for declaration nodes.
//
func (d *BadDecl) Pos() token.Pos { return d.From } func (d *BadDecl) Pos() token.Pos { return d.From }
func (d *GenDecl) Pos() token.Pos { return d.TokPos } func (d *GenDecl) Pos() token.Pos { return d.TokPos }
func (d *FuncDecl) Pos() token.Pos { return d.Type.Pos() } func (d *FuncDecl) Pos() token.Pos { return d.Type.Pos() }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment