MCPcopy
hub / github.com/davyxu/tabtoy / valueWrapperLua

Function valueWrapperLua

v2/printer/lua.go:11–26  ·  view source on GitHub ↗
(g *Globals, t model.FieldType, n *model.Node)

Source from the content-addressed store, hash-verified

9)
10
11func valueWrapperLua(g *Globals, t model.FieldType, n *model.Node) string {
12
13 switch t {
14 case model.FieldType_String:
15 return util.StringWrap(util.StringEscape(n.Value))
16 case model.FieldType_Enum:
17 if g.LuaEnumIntValue {
18 return fmt.Sprintf("%d", n.EnumValue)
19 } else {
20 return fmt.Sprintf("\"%s\"", n.Value)
21 }
22
23 }
24
25 return n.Value
26}
27
28type luaPrinter struct {
29}

Callers 1

printTableLuaFunction · 0.85

Calls 2

StringWrapFunction · 0.92
StringEscapeFunction · 0.92

Tested by

no test coverage detected