• Robert Griesemer's avatar
    exp/types/staging: operands, constants, and error handling · f5483fb8
    Robert Griesemer authored
    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
    f5483fb8
const.go 13.7 KB