(pattern, consume, caseInsensitive)
| 57 | (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) |
| 58 | } |
| 59 | match(pattern, consume, caseInsensitive) { |
| 60 | if (typeof pattern == "string") { |
| 61 | let cased = str => caseInsensitive ? str.toLowerCase() : str |
| 62 | let substr = this.string.substr(this.pos, pattern.length) |
| 63 | if (cased(substr) == cased(pattern)) { |
| 64 | if (consume !== false) this.pos += pattern.length |
| 65 | return true |
| 66 | } |
| 67 | } else { |
| 68 | let match = this.string.slice(this.pos).match(pattern) |
| 69 | if (match && match.index > 0) return null |
| 70 | if (match && consume !== false) this.pos += match[0].length |
| 71 | return match |
| 72 | } |
| 73 | } |
| 74 | current(){return this.string.slice(this.start, this.pos)} |
| 75 | hideFirstChars(n, inner) { |
| 76 | this.lineStart += n |
no test coverage detected