MCPcopy
hub / github.com/postcss/postcss / comment

Method comment

lib/parser.js:179–196  ·  view source on GitHub ↗
(token)

Source from the content-addressed store, hash-verified

177 }
178
179 comment(token) {
180 let node = new Comment()
181 this.init(node, token[2])
182 node.source.end = this.getPosition(token[3] || token[2])
183 node.source.end.offset++
184
185 let text = token[1].slice(2, -2)
186 if (!text.trim()) {
187 node.text = ''
188 node.raws.left = text
189 node.raws.right = ''
190 } else {
191 let match = text.match(/^(\s*)([^]*\S)(\s*)$/)
192 node.text = match[2]
193 node.raws.left = match[1]
194 node.raws.right = match[3]
195 }
196 }
197
198 createTokenizer() {
199 this.tokenizer = tokenizer(this.input)

Callers 3

parseMethod · 0.95
postcss.test.tsFile · 0.45
checkFunction · 0.45

Calls 2

initMethod · 0.95
getPositionMethod · 0.95

Tested by 1

checkFunction · 0.36