✏️ 编辑:var.js
路径:
/home/boguraj1/public_html/jobsite/node_modules/css-tree/lib/syntax/function/var.js
大小:1.25 KB · 修改:2022-11-21 20:08:20 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
var TYPE = require('../../tokenizer').TYPE; var rawMode = require('../node/Raw').mode; var COMMA = TYPE.Comma; var WHITESPACE = TYPE.WhiteSpace; // var( <ident> , <value>? ) module.exports = function() { var children = this.createList(); this.scanner.skipSC(); // NOTE: Don't check more than a first argument is an ident, rest checks are for lexer children.push(this.Identifier()); this.scanner.skipSC(); if (this.scanner.tokenType === COMMA) { children.push(this.Operator()); const startIndex = this.scanner.tokenIndex; const value = this.parseCustomProperty ? this.Value(null) : this.Raw(this.scanner.tokenIndex, rawMode.exclamationMarkOrSemicolon, false); if (value.type === 'Value' && value.children.isEmpty()) { for (let offset = startIndex - this.scanner.tokenIndex; offset <= 0; offset++) { if (this.scanner.lookupType(offset) === WHITESPACE) { value.children.appendData({ type: 'WhiteSpace', loc: null, value: ' ' }); break; } } } children.push(value); } return children; };
💾 保存
取消
保存为 UTF-8,换行统一为 LF