Crate go_types

source ·
Expand description

This crate is part of the Goscript project. Please refer to https://goscript.dev for more information.

It’s a port of the the parser from the Go standard library https://github.com/golang/go/tree/release-branch.go1.12/src/go/types

Feature

  • btree_map: Make it use BTreeMap instead of HashMap

Modules

Structs

  • ImportKey identifies an imported package by import path and source directory (directory containing the file containing the import). In practice, the directory may always be the same, or may not matter. Given an (import path, directory), an importer must always return the same package (but given two different import paths, an importer may still return the same package by mapping them to the same package paths).
  • A LangObj describes a named language entity such as a package, constant, type, variable, function (incl. methods), or label.
  • A Selection describes a selector expression x.f. For the declarations:
  • The container of all “managed” objects also works as a “global” variable holder
  • Universe sets up the universe scope, the unsafe package and all the builtin types and functions

Enums

  • A Builtin is the id of a builtin function.
  • constant implements Values representing untyped Go constants and their corresponding operations.
  • EntityType defines the types of LangObj entities
  • ExprKind describes the kind of an expression; the kind determines if an expression is valid in ‘statement context’.
  • An OperandMode specifies the (addressing) mode of an operand.
  • SelectionKind describes the kind of a selector expression x.f (excluding qualified identifiers).

Traits

Type Aliases