Sha256: b39a0b511ca10a99ecb3b23302601f094f881730fea27a3840f625caa4d9f3f2

Contents?: true

Size: 1.28 KB

Versions: 41

Compression:

Stored size: 1.28 KB

Contents

var TYPE = require('../../tokenizer').TYPE;

var SEMICOLON = TYPE.Semicolon;
var LEFTCURLYBRACKET = TYPE.LeftCurlyBracket;

module.exports = {
    name: 'AtrulePrelude',
    structure: {
        children: [[]]
    },
    parse: function(name) {
        var children = null;

        if (name !== null) {
            name = name.toLowerCase();
        }

        this.scanner.skipSC();

        if (this.atrule.hasOwnProperty(name) &&
            typeof this.atrule[name].prelude === 'function') {
            // custom consumer
            children = this.atrule[name].prelude.call(this);
        } else {
            // default consumer
            children = this.readSequence(this.scope.AtrulePrelude);
        }

        this.scanner.skipSC();

        if (this.scanner.eof !== true &&
            this.scanner.tokenType !== LEFTCURLYBRACKET &&
            this.scanner.tokenType !== SEMICOLON) {
            this.error('Semicolon or block is expected');
        }

        if (children === null) {
            children = this.createList();
        }

        return {
            type: 'AtrulePrelude',
            loc: this.getLocationFromList(children),
            children: children
        };
    },
    generate: function(node) {
        this.children(node);
    },
    walkContext: 'atrulePrelude'
};

Version data entries

41 entries across 31 versions & 9 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
optimacms-0.1.61 spec/dummy/node_modules/csso/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
disco_app-0.18.0 test/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
disco_app-0.18.2 test/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
disco_app-0.16.1 test/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
disco_app-0.15.2 test/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
disco_app-0.18.4 test/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
disco_app-0.18.1 test/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
disco_app-0.14.0 test/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
isomorfeus-preact-10.5.7 node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
isomorfeus-preact-10.5.6 node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
isomorfeus-preact-10.5.5 node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
isomorfeus-preact-10.5.4 node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
isomorfeus-preact-10.5.3 node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
isomorfeus-preact-10.5.2 node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
tang-0.2.1 spec/tang_app/node_modules/csso/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
tang-0.2.1 spec/tang_app/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/csso/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js