MCPcopy Index your code
hub / github.com/Shopify/go-lua / tokenToString

Method tokenToString

scanner.go:87–99  ·  view source on GitHub ↗
(t rune)

Source from the content-addressed store, hash-verified

85func isDecimal(c rune) bool { return '0' <= c && c <= '9' }
86
87func (s *scanner) tokenToString(t rune) string {
88 switch {
89 case t == tkName || t == tkString:
90 return s.s
91 case t == tkNumber:
92 return fmt.Sprintf("%f", s.n)
93 case t < firstReserved:
94 return string(t) // TODO check for printable rune
95 case t < tkEOS:
96 return fmt.Sprintf("'%s'", tokens[t-firstReserved])
97 }
98 return tokens[t-firstReserved]
99}
100
101func (s *scanner) scanError(message string, token rune) {
102 buff := chunkID(s.source)

Callers 3

errorExpectedMethod · 0.95
scanErrorMethod · 0.95
checkMatchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected