String returns the unescaped representation of the input that has been lexed so far. Usually it would only be called after all the input has been processed.
()
| 172 | // that has been lexed so far. Usually it would only be |
| 173 | // called after all the input has been processed. |
| 174 | func (s *stringLexer) String() string { |
| 175 | out := &strings.Builder{} |
| 176 | for _, i := range s.items { |
| 177 | out.WriteString(i.String()) |
| 178 | } |
| 179 | return out.String() |
| 180 | } |
| 181 | |
| 182 | // DecodeString accepts a raw string as it might be found in some |
| 183 | // JavaScript source code, and converts any escape sequences. E.g: |