first commit
This commit is contained in:
8
build/node_modules/css-tree/lib/syntax/atrule/font-face.js
generated
vendored
Normal file
8
build/node_modules/css-tree/lib/syntax/atrule/font-face.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: null,
|
||||
block: function() {
|
||||
return this.Block(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
39
build/node_modules/css-tree/lib/syntax/atrule/import.js
generated
vendored
Normal file
39
build/node_modules/css-tree/lib/syntax/atrule/import.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
var List = require('../../utils/list');
|
||||
var TYPE = require('../../tokenizer').TYPE;
|
||||
|
||||
var STRING = TYPE.String;
|
||||
var IDENTIFIER = TYPE.Identifier;
|
||||
var URL = TYPE.Url;
|
||||
var LEFTPARENTHESIS = TYPE.LeftParenthesis;
|
||||
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: function() {
|
||||
var children = new List();
|
||||
|
||||
this.scanner.skipSC();
|
||||
|
||||
switch (this.scanner.tokenType) {
|
||||
case STRING:
|
||||
children.appendData(this.String());
|
||||
break;
|
||||
|
||||
case URL:
|
||||
children.appendData(this.Url());
|
||||
break;
|
||||
|
||||
default:
|
||||
this.scanner.error('String or url() is expected');
|
||||
}
|
||||
|
||||
if (this.scanner.lookupNonWSType(0) === IDENTIFIER ||
|
||||
this.scanner.lookupNonWSType(0) === LEFTPARENTHESIS) {
|
||||
children.appendData(this.WhiteSpace());
|
||||
children.appendData(this.MediaQueryList());
|
||||
}
|
||||
|
||||
return children;
|
||||
},
|
||||
block: null
|
||||
}
|
||||
};
|
||||
7
build/node_modules/css-tree/lib/syntax/atrule/index.js
generated
vendored
Normal file
7
build/node_modules/css-tree/lib/syntax/atrule/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
'font-face': require('./font-face'),
|
||||
'import': require('./import'),
|
||||
'media': require('./media'),
|
||||
'page': require('./page'),
|
||||
'supports': require('./supports')
|
||||
};
|
||||
14
build/node_modules/css-tree/lib/syntax/atrule/media.js
generated
vendored
Normal file
14
build/node_modules/css-tree/lib/syntax/atrule/media.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var List = require('../../utils/list');
|
||||
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: function() {
|
||||
return new List().appendData(
|
||||
this.MediaQueryList()
|
||||
);
|
||||
},
|
||||
block: function() {
|
||||
return this.Block(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
14
build/node_modules/css-tree/lib/syntax/atrule/page.js
generated
vendored
Normal file
14
build/node_modules/css-tree/lib/syntax/atrule/page.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var List = require('../../utils/list');
|
||||
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: function() {
|
||||
return new List().appendData(
|
||||
this.SelectorList()
|
||||
);
|
||||
},
|
||||
block: function() {
|
||||
return this.Block(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
100
build/node_modules/css-tree/lib/syntax/atrule/supports.js
generated
vendored
Normal file
100
build/node_modules/css-tree/lib/syntax/atrule/supports.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
var List = require('../../utils/list');
|
||||
var TYPE = require('../../tokenizer').TYPE;
|
||||
|
||||
var WHITESPACE = TYPE.WhiteSpace;
|
||||
var COMMENT = TYPE.Comment;
|
||||
var IDENTIFIER = TYPE.Identifier;
|
||||
var FUNCTION = TYPE.Function;
|
||||
var LEFTPARENTHESIS = TYPE.LeftParenthesis;
|
||||
var HYPHENMINUS = TYPE.HyphenMinus;
|
||||
var COLON = TYPE.Colon;
|
||||
|
||||
function consumeRaw() {
|
||||
return new List().appendData(
|
||||
this.Raw(this.scanner.currentToken, 0, 0, false, false)
|
||||
);
|
||||
}
|
||||
|
||||
function parentheses() {
|
||||
var index = 0;
|
||||
|
||||
this.scanner.skipSC();
|
||||
|
||||
// TODO: make it simplier
|
||||
if (this.scanner.tokenType === IDENTIFIER) {
|
||||
index = 1;
|
||||
} else if (this.scanner.tokenType === HYPHENMINUS &&
|
||||
this.scanner.lookupType(1) === IDENTIFIER) {
|
||||
index = 2;
|
||||
}
|
||||
|
||||
if (index !== 0 && this.scanner.lookupNonWSType(index) === COLON) {
|
||||
return new List().appendData(
|
||||
this.Declaration()
|
||||
);
|
||||
}
|
||||
|
||||
return readSequence.call(this);
|
||||
}
|
||||
|
||||
function readSequence() {
|
||||
var children = new List();
|
||||
var space = null;
|
||||
var child;
|
||||
|
||||
this.scanner.skipSC();
|
||||
|
||||
scan:
|
||||
while (!this.scanner.eof) {
|
||||
switch (this.scanner.tokenType) {
|
||||
case WHITESPACE:
|
||||
space = this.WhiteSpace();
|
||||
continue;
|
||||
|
||||
case COMMENT:
|
||||
this.scanner.next();
|
||||
continue;
|
||||
|
||||
case FUNCTION:
|
||||
child = this.Function(consumeRaw, this.scope.AtrulePrelude);
|
||||
break;
|
||||
|
||||
case IDENTIFIER:
|
||||
child = this.Identifier();
|
||||
break;
|
||||
|
||||
case LEFTPARENTHESIS:
|
||||
child = this.Parentheses(parentheses, this.scope.AtrulePrelude);
|
||||
break;
|
||||
|
||||
default:
|
||||
break scan;
|
||||
}
|
||||
|
||||
if (space !== null) {
|
||||
children.appendData(space);
|
||||
space = null;
|
||||
}
|
||||
|
||||
children.appendData(child);
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: function() {
|
||||
var children = readSequence.call(this);
|
||||
|
||||
if (children.isEmpty()) {
|
||||
this.scanner.error('Condition is expected');
|
||||
}
|
||||
|
||||
return children;
|
||||
},
|
||||
block: function() {
|
||||
return this.Block(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user