Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(163)

Unified Diff: src/pkg/exp/eval/type.go

Issue 3050041: code review 3050041: go/ast: use token.Pos instead of token.Position; adjus... (Closed)
Patch Set: code review 3050041: go/ast: use token.Pos instead of token.Position; adjus... Created 14 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/exp/eval/stmt.go ('k') | src/pkg/exp/eval/typec.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/exp/eval/type.go
===================================================================
--- a/src/pkg/exp/eval/type.go
+++ b/src/pkg/exp/eval/type.go
@@ -54,7 +54,7 @@
// String returns the string representation of this type.
String() string
// The position where this type was defined, if any.
- Pos() token.Position
+ Pos() token.Pos
}
type BoundedType interface {
@@ -65,7 +65,7 @@
maxVal() *big.Rat
}
-var universePos = token.Position{"<universe>", 0, 0, 0}
+var universePos = token.NoPos
/*
* Type array maps. These are used to memoize composite types.
@@ -140,7 +140,7 @@
func (commonType) isIdeal() bool { return false }
-func (commonType) Pos() token.Position { return token.Position{} }
+func (commonType) Pos() token.Pos { return token.NoPos }
/*
* Bool
@@ -1100,8 +1100,8 @@
}
type NamedType struct {
- token.Position
- Name string
+ NamePos token.Pos
+ Name string
// Underlying type. If incomplete is true, this will be nil.
// If incomplete is false and this is still nil, then this is
// a placeholder type representing an error.
@@ -1114,7 +1114,11 @@
// TODO(austin) This is temporarily needed by the debugger's remote
// type parser. This should only be possible with block.DefineType.
func NewNamedType(name string) *NamedType {
- return &NamedType{token.Position{}, name, nil, true, make(map[string]Method)}
+ return &NamedType{token.NoPos, name, nil, true, make(map[string]Method)}
+}
+
+func (t *NamedType) Pos() token.Pos {
+ return t.NamePos
}
func (t *NamedType) Complete(def Type) {
« no previous file with comments | « src/pkg/exp/eval/stmt.go ('k') | src/pkg/exp/eval/typec.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b