Page Speed Optimization Libraries
1.13.35.1
|
#include "js_minify.h"
Public Member Functions | |
JsMinifyingTokenizer (const JsTokenizerPatterns *patterns, StringPiece input) | |
JsMinifyingTokenizer (const JsTokenizerPatterns *patterns, StringPiece input, net_instaweb::source_map::MappingVector *mappings) | |
JsKeywords::Type | NextToken (StringPiece *token_out) |
Gets the next token type from the input,. | |
bool | has_error () const |
This works like JsTokenizer, except that it only emits whitespace and comment tokens that are deemed necessary for the script to work. IE conditional compilation comments are kept; other comments are removed. Whitespace tokens are only emitted if they are necessary to separate other tokens or for semicolon insertion, and any that are emitted will be collapsed to a single whitespace character.
pagespeed::js::JsMinifyingTokenizer::JsMinifyingTokenizer | ( | const JsTokenizerPatterns * | patterns, |
StringPiece | input | ||
) |
Creates a tokenizer that will tokenize the given input string (which must outlive the JsMinifyingTokenizer object).
pagespeed::js::JsMinifyingTokenizer::JsMinifyingTokenizer | ( | const JsTokenizerPatterns * | patterns, |
StringPiece | input, | ||
net_instaweb::source_map::MappingVector * | mappings | ||
) |
Version that sets source mappings as well. Note: Source Maps are only correct for ASCII text. Line and column numbers will be incorrect if there are multi-byte chars in input.
|
inline |
True if an error has been encountered. All future calls to NextToken() will return JsKeywords::kEndOfInput with an empty token string.