]> Cypherpunks repositories - gostls13.git/commit
exp/types/staging: operands, constants, and error handling
authorRobert Griesemer <gri@golang.org>
Wed, 26 Sep 2012 00:38:22 +0000 (17:38 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 26 Sep 2012 00:38:22 +0000 (17:38 -0700)
commitf5483fb801044eb50185d6630020575e70f454ba
tree44150f8c87f7addf9ac69436bdc5f57e8b0a2313
parent1b6d4b5c0a33909c0f17328e6a45c53d939f5ace
exp/types/staging: operands, constants, and error handling

More pieces of the typechecker code:

- Operands are temporary objects representing an expressions's
type and value (for constants). An operand is the equivalent of
an "attribute" in attribute grammars except that it's not stored
but only passed around during type checking.

- Constant operations are implemented in const.go. Constants are
represented as bool (booleans), int64 and *big.Int (integers),
*big.Rat (floats), complex (complex numbers), and string (strings).

- Error reporting is consolidated in errors.go. Only the first
dozen of lines is new code, the rest of the file contains the
exprString and typeString functions formerly in two separate
files (which have been removed).

This is a replacement CL for 6492101 (which was created without
proper use of hg).

R=rsc, r
CC=golang-dev
https://golang.org/cl/6500114
src/pkg/exp/types/staging/check.go [new file with mode: 0644]
src/pkg/exp/types/staging/const.go [new file with mode: 0644]
src/pkg/exp/types/staging/errors.go [new file with mode: 0644]
src/pkg/exp/types/staging/exprstring.go [deleted file]
src/pkg/exp/types/staging/operand.go [new file with mode: 0644]
src/pkg/exp/types/staging/predicates.go
src/pkg/exp/types/staging/stubs.go [new file with mode: 0644]
src/pkg/exp/types/staging/types.go
src/pkg/exp/types/staging/typestring.go [deleted file]
src/pkg/exp/types/staging/universe.go