MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / htmlCommentEndOffset

Function htmlCommentEndOffset

src/cm/modes/astro/parser/tokens.ts:193–214  ·  view source on GitHub ↗
(input: Input, offset: number)

Source from the content-addressed store, hash-verified

191}
192
193function htmlCommentEndOffset(input: Input, offset: number): number | null {
194 if (
195 input.peek(offset) !== lessThan ||
196 input.peek(offset + 1) !== exclamation ||
197 input.peek(offset + 2) !== dash ||
198 input.peek(offset + 3) !== dash
199 ) {
200 return null;
201 }
202
203 for (let i = offset + 4; ; i++) {
204 const next = input.peek(i);
205 if (next === eof) return i;
206 if (
207 next === dash &&
208 input.peek(i + 1) === dash &&
209 input.peek(i + 2) === greaterThan
210 ) {
211 return i + 3;
212 }
213 }
214}
215
216function expressionEndOffset(
217 input: Input,

Callers 1

htmlContentEndOffsetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected