MCPcopy
hub / github.com/vuejs/core / cleanup

Method cleanup

packages/compiler-core/src/tokenizer.ts:1098–1116  ·  packages/compiler-core/src/tokenizer.ts::Tokenizer.cleanup

* Remove data that has already been consumed from the buffer.

()

Source from the content-addressed store, hash-verified

1096 * Remove data that has already been consumed from the buffer.
1097 */
1098 private cleanup() {
1099 class="cm">// If we are inside of text or attributes, emit what we already have.
1100 if (this.sectionStart !== this.index) {
1101 if (
1102 this.state === State.Text ||
1103 (this.state === State.InRCDATA && this.sequenceIndex === 0)
1104 ) {
1105 this.cbs.ontext(this.sectionStart, this.index)
1106 this.sectionStart = this.index
1107 } else if (
1108 this.state === State.InAttrValueDq ||
1109 this.state === State.InAttrValueSq ||
1110 this.state === State.InAttrValueNq
1111 ) {
1112 this.cbs.onattribdata(this.sectionStart, this.index)
1113 this.sectionStart = this.index
1114 }
1115 }
1116 }
1117
1118 private finish() {
1119 if (!__BROWSER__ && this.state === State.InEntity) {

Callers 1

parseMethod · 0.95

Calls 2

ontextMethod · 0.80
onattribdataMethod · 0.80

Tested by

no test coverage detected