first commit
This commit is contained in:
3
build/node_modules/css-tree/lib/syntax/scope/atrulePrelude.js
generated
vendored
Normal file
3
build/node_modules/css-tree/lib/syntax/scope/atrulePrelude.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
getNode: require('./default')
|
||||
};
|
||||
78
build/node_modules/css-tree/lib/syntax/scope/default.js
generated
vendored
Normal file
78
build/node_modules/css-tree/lib/syntax/scope/default.js
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
var cmpChar = require('../../tokenizer').cmpChar;
|
||||
var TYPE = require('../../tokenizer').TYPE;
|
||||
|
||||
var IDENTIFIER = TYPE.Identifier;
|
||||
var STRING = TYPE.String;
|
||||
var NUMBER = TYPE.Number;
|
||||
var FUNCTION = TYPE.Function;
|
||||
var URL = TYPE.Url;
|
||||
var NUMBERSIGN = TYPE.NumberSign;
|
||||
var LEFTPARENTHESIS = TYPE.LeftParenthesis;
|
||||
var LEFTSQUAREBRACKET = TYPE.LeftSquareBracket;
|
||||
var PLUSSIGN = TYPE.PlusSign;
|
||||
var HYPHENMINUS = TYPE.HyphenMinus;
|
||||
var COMMA = TYPE.Comma;
|
||||
var SOLIDUS = TYPE.Solidus;
|
||||
var ASTERISK = TYPE.Asterisk;
|
||||
var PERCENTSIGN = TYPE.PercentSign;
|
||||
var BACKSLASH = TYPE.Backslash;
|
||||
var U = 117; // 'u'.charCodeAt(0)
|
||||
|
||||
module.exports = function defaultRecognizer(context) {
|
||||
switch (this.scanner.tokenType) {
|
||||
case NUMBERSIGN:
|
||||
return this.HexColor();
|
||||
|
||||
case COMMA:
|
||||
context.space = null;
|
||||
context.ignoreWSAfter = true;
|
||||
return this.Operator();
|
||||
|
||||
case SOLIDUS:
|
||||
case ASTERISK:
|
||||
case PLUSSIGN:
|
||||
case HYPHENMINUS:
|
||||
return this.Operator();
|
||||
|
||||
case LEFTPARENTHESIS:
|
||||
return this.Parentheses(this.readSequence, context.recognizer);
|
||||
|
||||
case LEFTSQUAREBRACKET:
|
||||
return this.Brackets(this.readSequence, context.recognizer);
|
||||
|
||||
case STRING:
|
||||
return this.String();
|
||||
|
||||
case NUMBER:
|
||||
switch (this.scanner.lookupType(1)) {
|
||||
case PERCENTSIGN:
|
||||
return this.Percentage();
|
||||
|
||||
case IDENTIFIER:
|
||||
// edge case: number with folowing \0 and \9 hack shouldn't to be a Dimension
|
||||
if (cmpChar(this.scanner.source, this.scanner.tokenEnd, BACKSLASH)) {
|
||||
return this.Number();
|
||||
} else {
|
||||
return this.Dimension();
|
||||
}
|
||||
|
||||
default:
|
||||
return this.Number();
|
||||
}
|
||||
|
||||
case FUNCTION:
|
||||
return this.Function(this.readSequence, context.recognizer);
|
||||
|
||||
case URL:
|
||||
return this.Url();
|
||||
|
||||
case IDENTIFIER:
|
||||
// check for unicode range, it should start with u+ or U+
|
||||
if (cmpChar(this.scanner.source, this.scanner.tokenStart, U) &&
|
||||
cmpChar(this.scanner.source, this.scanner.tokenStart + 1, PLUSSIGN)) {
|
||||
return this.UnicodeRange();
|
||||
} else {
|
||||
return this.Identifier();
|
||||
}
|
||||
}
|
||||
};
|
||||
5
build/node_modules/css-tree/lib/syntax/scope/index.js
generated
vendored
Normal file
5
build/node_modules/css-tree/lib/syntax/scope/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
AtrulePrelude: require('./atrulePrelude'),
|
||||
Selector: require('./selector'),
|
||||
Value: require('./value')
|
||||
};
|
||||
56
build/node_modules/css-tree/lib/syntax/scope/selector.js
generated
vendored
Normal file
56
build/node_modules/css-tree/lib/syntax/scope/selector.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
var TYPE = require('../../tokenizer').TYPE;
|
||||
|
||||
var IDENTIFIER = TYPE.Identifier;
|
||||
var NUMBER = TYPE.Number;
|
||||
var NUMBERSIGN = TYPE.NumberSign;
|
||||
var LEFTSQUAREBRACKET = TYPE.LeftSquareBracket;
|
||||
var PLUSSIGN = TYPE.PlusSign;
|
||||
var SOLIDUS = TYPE.Solidus;
|
||||
var ASTERISK = TYPE.Asterisk;
|
||||
var FULLSTOP = TYPE.FullStop;
|
||||
var COLON = TYPE.Colon;
|
||||
var GREATERTHANSIGN = TYPE.GreaterThanSign;
|
||||
var VERTICALLINE = TYPE.VerticalLine;
|
||||
var TILDE = TYPE.Tilde;
|
||||
|
||||
function getNode(context) {
|
||||
switch (this.scanner.tokenType) {
|
||||
case PLUSSIGN:
|
||||
case GREATERTHANSIGN:
|
||||
case TILDE:
|
||||
context.space = null;
|
||||
context.ignoreWSAfter = true;
|
||||
return this.Combinator();
|
||||
|
||||
case SOLIDUS: // /deep/
|
||||
return this.Combinator();
|
||||
|
||||
case FULLSTOP:
|
||||
return this.ClassSelector();
|
||||
|
||||
case LEFTSQUAREBRACKET:
|
||||
return this.AttributeSelector();
|
||||
|
||||
case NUMBERSIGN:
|
||||
return this.IdSelector();
|
||||
|
||||
case COLON:
|
||||
if (this.scanner.lookupType(1) === COLON) {
|
||||
return this.PseudoElementSelector();
|
||||
} else {
|
||||
return this.PseudoClassSelector();
|
||||
}
|
||||
|
||||
case IDENTIFIER:
|
||||
case ASTERISK:
|
||||
case VERTICALLINE:
|
||||
return this.TypeSelector();
|
||||
|
||||
case NUMBER:
|
||||
return this.Percentage();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getNode: getNode
|
||||
};
|
||||
7
build/node_modules/css-tree/lib/syntax/scope/value.js
generated
vendored
Normal file
7
build/node_modules/css-tree/lib/syntax/scope/value.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
getNode: require('./default'),
|
||||
'-moz-element': require('../function/element'),
|
||||
'element': require('../function/element'),
|
||||
'expression': require('../function/expression'),
|
||||
'var': require('../function/var')
|
||||
};
|
||||
Reference in New Issue
Block a user