codepoint-scanner
UTF-16 code-point based lexical string scanner.
npm install codepoint-scanner --save
You can also download the files manually.
npm stats
Usage
var scan =
API
scanner.string()
var scanner = scanner// => 'Hello world!'
scanner.codepoints()
var scanner = scanner// => [ 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33 ]
scanner.index()
var scanner = scannerindex// => 0
scanner.next()
var scanner = scannernext// => 101 scannernext// => 108 scannerindex// => 2
scanner.bos()
var scanner = scanner// => true scannernext// => 101 scanner// => false
scanner.reset()
var scanner = scannernext// => 101 scanner// => true
scanner.eos()
var scanner = scanner// => false scannerindexscannerlength - 1// => true
scanner.$()
var scanner = scanner// => false scanner// => true
scanner.peek()
var scanner = scannerindex// => 0 scanner// => [ 72 ] scanner// => [ 32 ] scanner// => [ 32, 119 ] scannerindex// => 0
scanner.at()
var scanner = scannerindex// => 0 scanner// => 32
Contributing
SEE: contributing.md