@@ -222,7 +222,7 @@ instance---must have access to the `FileSet`.
222222
223223Second, the program parses the input string.
224224More realistic packages contain several source files, so the parsing
225- step must be repeated for each one, or better still , done in parallel.
225+ step must be repeated for each one, or better, done in parallel.
226226Third, it creates a ` Config ` that specifies type-checking options.
227227Since the _ hello, world_ program uses imports, we must indicate
228228how to locate the imported packages.
@@ -304,11 +304,11 @@ object-oriented programming.)
304304
305305
306306
307- Objects are represented by the ` Object ` interface, shown below :
307+ Objects are represented by the ` Object ` interface:
308308
309309
310310 type Object interface {
311- Name() string // package local object name
311+ Name() string // package- local object name
312312 Exported() bool // reports whether the name starts with a capital letter
313313 Type() Type // object type
314314 Pos() token.Pos // position of object identifier in declaration
@@ -338,7 +338,7 @@ individual fields for the file name, line number, column, and byte
338338offset, though usually we just call its ` String ` method:
339339
340340
341- fmt.Fprintln (fset.Position(obj.Pos())) // "hello.go:10:6"
341+ fmt.Println (fset.Position(obj.Pos())) // "hello.go:10:6"
342342
343343
344344Not all objects carry position information.
@@ -349,7 +349,7 @@ imported from such a file returns zero, also known as
349349
350350
351351
352- There are eight kinds of objects in the Go type checker.
352+ There are eight kinds of object in the Go type checker.
353353Most familiar are the kinds that can be declared at package level:
354354constants, variables, functions, and types.
355355Less familiar are statement labels, imported package names
@@ -388,6 +388,7 @@ which the object was declared; we'll come back to this in
388388[ Scopes] ( #scopes ) .
389389Fields and methods are not found in the lexical environment, so
390390their objects have no ` Parent ` .
391+ <!-- TODO check this -->
391392
392393
393394
@@ -702,8 +703,8 @@ The structure of the lexical environment thus forms a tree, with the
702703universe block at the root, the package blocks beneath it, the file
703704blocks beneath them, and then any number of local blocks beneath the
704705files.
705- The following methods of ` Scope ` make this tree structure
706- accessible and navigable :
706+ We can access and navigate this tree structure with the following
707+ methods of ` Scope ` :
707708
708709
709710 func (s *Scope) Parent() *Scope
@@ -768,7 +769,7 @@ before or after that point.
768769
769770
770771` Pos ` and ` End ` report the ` Scope ` 's start and end
771- position which, for explicit blocks, are coincident with its curly
772+ position which, for explicit blocks, coincide with its curly
772773braces.
773774` Contains ` is a convenience method that reports whether a
774775position lies in this interval.
@@ -898,6 +899,7 @@ each level of the tree of lexical blocks.
898899 PkgName ✔
899900 Label ✔
900901
902+
901903# Initialization Order
902904
903905
@@ -951,7 +953,8 @@ Across packages, dependencies must be initialized first, although the
951953order among them is not specified.
952954That is, any topological order of the import graph will do.
953955The ` (*Package).Imports ` method returns the set of direct
954- dependencies of a package, in an unspecified order.
956+ dependencies of a package.
957+ >>>>>>> 637ffe0981073879a95f848fd9528efe9231bed9
955958
956959
957960# Types
@@ -1066,7 +1069,7 @@ for expressions containing errors, or for objects without types, like
10661069The ` Name ` method returns the name of the type, such as
10671070` "float64" ` , and the ` Info ` method returns a bitfield that
10681071encodes information about the type, such as whether it is signed or
1069- unsigned, integer or floating point, real or complex.
1072+ unsigned, integer or floating point, or real or complex.
10701073
10711074
10721075
@@ -1135,6 +1138,7 @@ ordered list of field tags.
11351138Each field is a ` Var ` object whose ` IsField ` method returns true.
11361139Field objects have no ` Parent ` scope, because they are
11371140resolved through selections, not through the lexical environment.
1141+ <!-- TODO check this -->
11381142
11391143
11401144
@@ -1172,7 +1176,7 @@ and to `U`, and short of inspecting source positions or walking
11721176the AST---neither of which is possible for objects loaded from compiler
11731177export data---it is not possible to ascertain that ` x ` was declared as
11741178part of ` T ` .
1175- The type checker computes the exact same data structures given this input:
1179+ The type checker builds the exact same data structures given this input:
11761180
11771181
11781182 type T U
@@ -1264,7 +1268,7 @@ These types are recorded during type checking for later use
12641268A type declaration creates a ` TypeName ` object, and the type of
12651269that object is a ` Named ` .
12661270These two entities, an object and a type, are distinct but closely
1267- related, and they exist in one-to-one correpondence .
1271+ related, and they exist in one-to-one correspondence .
12681272
12691273
12701274 type Named struct{ ... }
@@ -1405,15 +1409,15 @@ of the `Info` struct, namely `Types`:
14051409 }
14061410
14071411
1408- No entry is recorded for identifiers since the ` Defs ` and
1412+ No entries are recorded for identifiers since the ` Defs ` and
14091413` Uses ` maps provide more information about them.
1410- Also, no entry is recorded for pseudo-expressions like
1414+ Also, no entries are recorded for pseudo-expressions like
14111415` *ast.KeyValuePair ` or ` *ast.Ellipsis ` .
14121416
14131417
14141418
14151419The value of the ` Types ` map is a ` TypeAndValue ` , which
1416- (unsurprisingly) holds the ` Type ` and value of the expression, and in
1420+ (unsurprisingly) holds the type and value of the expression, and in
14171421addition, its _ mode_ .
14181422The mode is opaque, but has predicates to answer questions such as:
14191423Does this expression denote a value or a type? Does this value have an
@@ -1437,7 +1441,7 @@ satisfy each predicate.
14371441 func (TypeAndValue) IsNil() bool // e.g. "nil"
14381442 func (TypeAndValue) Addressable() bool // e.g. "a[i]" but not "f()", "m[key]"
14391443 func (TypeAndValue) Assignable() bool // e.g. "a[i]", "m[key]"
1440- func (TypeAndValue) HasOk() bool // e.g. "< -ch", "m[key]"
1444+ func (TypeAndValue) HasOk() bool // e.g. "< -ch", "m[key]"
14411445
14421446
14431447The statement below inspects every expression within the AST of a single
@@ -1707,12 +1711,9 @@ and `Indirect`.
17071711
17081712The ` addressable ` flag should be set if the receiver is a
17091713_ variable_ of type ` T ` , since in a method selection on a
1710- variable, an implicit address-of operation (` & ` ) may occur.
1714+ variable, an implicit address-of operation (` & ` ) may occur.
17111715The flag indicates whether the methods of type ` *T ` should be
17121716considered during the lookup.
1713-
1714-
1715-
17161717(You may wonder why this parameter is necessary. Couldn't clients
17171718instead call ` LookupFieldOrMethod ` on the pointer type ` *T `
17181719if the receiver is a ` T ` variable? The answer is that if
@@ -1826,7 +1827,7 @@ Clients can request the method set of a type `T` by calling
18261827 func (s *MethodSet) Lookup(pkg *Package, name string) *Selection
18271828
18281829
1829- The ` Len ` and ` At ` methods access a a list of
1830+ The ` Len ` and ` At ` methods access a list of
18301831` Selections ` , all of kind ` MethodVal ` , ordered by ` Id ` .
18311832The ` Lookup ` function allows lookup of a single method by
18321833name (and package path, as explained in the previous section).
@@ -2087,7 +2088,7 @@ and for constructing new values:
20872088
20882089
20892090All numeric ` Value ` s, whether integer or floating-point, signed or
2090- unsigned, or real or complex, are represented more precisely than the
2091+ unsigned, or real or complex, are represented more precisely than
20912092ordinary Go types like ` int64 ` and ` float64 ` .
20922093Internally, the ` go/constant ` package uses multi-precision data types
20932094like ` Int ` , ` Rat ` , and ` Float ` from the ` math/big ` package so that
0 commit comments