()
| 2180 | } |
| 2181 | |
| 2182 | func (s *Scanner) scanBigIntSuffix() ast.Kind { |
| 2183 | if s.char() == 'n' { |
| 2184 | s.tokenValue += "n" |
| 2185 | if s.tokenFlags&ast.TokenFlagsBinaryOrOctalSpecifier != 0 { |
| 2186 | s.tokenValue = jsnum.ParsePseudoBigInt(s.tokenValue) + "n" |
| 2187 | } |
| 2188 | s.pos++ |
| 2189 | return ast.KindBigIntLiteral |
| 2190 | } |
| 2191 | if s.numberCache == nil { |
| 2192 | s.numberCache = make(map[string]string) |
| 2193 | } |
| 2194 | if cached, ok := s.numberCache[s.tokenValue]; ok { |
| 2195 | s.tokenValue = cached |
| 2196 | } else { |
| 2197 | tokenValue := jsnum.FromString(s.tokenValue).String() |
| 2198 | if tokenValue == s.tokenValue { |
| 2199 | tokenValue = s.tokenValue |
| 2200 | } |
| 2201 | s.numberCache[s.tokenValue] = tokenValue |
| 2202 | s.tokenValue = tokenValue |
| 2203 | } |
| 2204 | return ast.KindNumericLiteral |
| 2205 | } |
| 2206 | |
| 2207 | func (s *Scanner) scanInvalidCharacter() { |
| 2208 | _, size := s.charAndSize() |
no test coverage detected