- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for makeFromLiteral (0.7 sec)
-
src/go/types/util.go
// endPos returns the position of the first character immediately after node n. func endPos(n ast.Node) token.Pos { return n.End() } // makeFromLiteral returns the constant value for the given literal string and kind. func makeFromLiteral(lit string, kind token.Token) constant.Value { return constant.MakeFromLiteral(lit, kind, 0)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 1.7K bytes - Viewed (0) -
src/cmd/compile/internal/types2/util.go
func endPos(n syntax.Node) syntax.Pos { return syntax.EndPos(n) } // makeFromLiteral returns the constant value for the given literal string and kind. func makeFromLiteral(lit string, kind syntax.LitKind) constant.Value { return constant.MakeFromLiteral(lit, kind2tok[kind], 0) } var kind2tok = [...]token.Token{ syntax.IntLit: token.INT, syntax.FloatLit: token.FLOAT,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 2.1K bytes - Viewed (0) -
src/go/constant/example_test.go
func ExampleCompare() { vs := []constant.Value{ constant.MakeString("Z"), constant.MakeString("bacon"), constant.MakeString("go"), constant.MakeString("Frame"), constant.MakeString("defer"), constant.MakeFromLiteral(`"a"`, token.STRING, 0), } slices.SortFunc(vs, func(a, b constant.Value) int { if constant.Compare(a, token.LSS, b) { return -1 } if constant.Compare(a, token.GTR, b) { return +1 }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 3.5K bytes - Viewed (0) -
src/go/internal/gccgoimporter/parser.go
im = re re = "0" default: val = constant.MakeFromLiteral(re, token.FLOAT, 0) if val == nil { p.error("could not parse float literal") } typ = types.Typ[types.UntypedFloat] return } p.expectKeyword("i") reval := constant.MakeFromLiteral(re, token.FLOAT, 0) if reval == nil { p.error("could not parse real component of complex literal")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 02 23:14:07 UTC 2024 - 31.2K bytes - Viewed (0) -
src/go/types/operand.go
case token.IMAG: kind = UntypedComplex case token.CHAR: kind = UntypedRune case token.STRING: kind = UntypedString default: panic("unreachable") } val := makeFromLiteral(lit, k) if val.Kind() == constant.Unknown { x.mode = invalid x.typ = Typ[Invalid] return } x.mode = constant_ x.typ = Typ[kind] x.val = val }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 21:17:10 UTC 2024 - 11.1K bytes - Viewed (0) -
src/cmd/compile/internal/types2/operand.go
case syntax.ImagLit: kind = UntypedComplex case syntax.RuneLit: kind = UntypedRune case syntax.StringLit: kind = UntypedString default: panic("unreachable") } val := makeFromLiteral(lit, k) if val.Kind() == constant.Unknown { x.mode = invalid x.typ = Typ[Invalid] return } x.mode = constant_ x.typ = Typ[kind] x.val = val }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 21:17:10 UTC 2024 - 11K bytes - Viewed (0) -
src/go/constant/value.go
} // MakeFromLiteral returns the corresponding integer, floating-point, // imaginary, character, or string value for a Go literal string. The // tok value must be one of [token.INT], [token.FLOAT], [token.IMAG], // [token.CHAR], or [token.STRING]. The final argument must be zero. // If the literal string syntax is invalid, the result is an [Unknown]. func MakeFromLiteral(lit string, tok token.Token, zero uint) Value {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 34K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"Int", Const, 5}, {"Int64Val", Func, 5}, {"Kind", Type, 5}, {"Make", Func, 13}, {"MakeBool", Func, 5}, {"MakeFloat64", Func, 5}, {"MakeFromBytes", Func, 5}, {"MakeFromLiteral", Func, 5}, {"MakeImag", Func, 5}, {"MakeInt64", Func, 5}, {"MakeString", Func, 5}, {"MakeUint64", Func, 5}, {"MakeUnknown", Func, 5}, {"Num", Func, 5}, {"Real", Func, 5},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0)