StringParser Class
A simple string/stream parser.
Constructor
Item Index
Methods
check
-
against
Returns true if the next line starts with the
given string against
.
Parameters:
-
against
String
Returns:
end
()
chainable
next
()
String | Undefined
Returns the next line/token; updates the parser's current position pointer and line number as a side effect.
Returns:
The next token.
parse
-
[callback]
end
and error
events.
Parameters:
-
[callback]
Function optional
Returns:
parse_line
-
line
Parses a single line. This method should be implemented by all subclasses.
Parameters:
-
line
StringThe line to parse.
pause
()
Resumes _parse method after a short timeout; these small timeouts effectively give the browser more time to breathe and are a remedy for the 'long running script' warnings in Firefox.
skip
-
over
-
[until]
Like next()
but skips lines matching over
until the end of data is reached or, if given,
the next line starts with until
.
Returns:
The next line.
verify
()
chainable
Properties
_parse
Unknown
trim
String
The token trim value; defaults to a carriage return. If present, this value will be cut off at the end of each token during parsing.