MCPcopy
hub / github.com/google/mangle / StringValue

Method StringValue

ast/ast.go:439–444  ·  view source on GitHub ↗

StringValue returns the string value of this constant, if it is of type string.

()

Source from the content-addressed store, hash-verified

437
438// StringValue returns the string value of this constant, if it is of type string.
439func (c Constant) StringValue() (string, error) {
440 if c.Type != StringType {
441 return "", fmt.Errorf("not a string constant %v", c)
442 }
443 return c.Symbol, nil
444}
445
446// NumberValue returns the number(int64) value of this constant, if it is of type number.
447func (c Constant) NumberValue() (int64, error) {

Callers 9

declarationMappingsMethod · 0.80
DeclsMethod · 0.80
findPackageFunction · 0.80
TestStringConstantFunction · 0.80
DocMethod · 0.80
PackageIDMethod · 0.80
MergePredicateMethod · 0.80
getStringValueFunction · 0.80
EvalApplyFnFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestStringConstantFunction · 0.64