UNPKG

attrpath

Version:
82 lines 1.6 kB
/** * Copyright © 2020 2021 2022 7thCode.(http://seventh-code.com/) * This software is released under the MIT License. * opensource.org/licenses/mit-license.php */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ParserStream = void 0; /** * ParserStream */ class ParserStream { /* * * * */ constructor(value) { this.start = 0; this.end = 0; this.value = ""; this.value = value; } /** * char * * @remarks current position char */ get char() { return this.value.charAt(this.end); } /** * charCode * * @remarks current position charCode */ get charCode() { return this.value.charCodeAt(this.end); } /** * current * * @remarks * String between restore point and current position. */ get current() { return this.value.substring(this.start, this.end); } /** * is_terminal * * @remarks end? */ get is_terminal() { return (this.value.length <= this.end); } /** * restore_point * * @remarks save point. */ restore_point() { this.start = this.end; } /** * restore * * @remarks current position restore to restore_point. */ restore() { this.end = this.start; } /** * next * * @remarks Advance the parsed end by one character */ next() { this.end++; } } exports.ParserStream = ParserStream; //# sourceMappingURL=stream.js.map