Skip to content

Commit

Permalink
An+B -> AnPlusB
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Feb 8, 2017
1 parent 86308b8 commit 87fd11d
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion lib/parser/Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var WHITESPACE = TYPE.Whitespace;
var COMMENT = TYPE.Comment;

var sequence = require('./sequence');
var getAnPlusB = require('./type/An+B');
var getAnPlusB = require('./type/AnPlusB');
var getAtrule = require('./type/Atrule');
var getAtruleExpression = require('./type/AtruleExpression');
var getAttributeSelector = require('./type/AttributeSelector');
Expand Down
2 changes: 1 addition & 1 deletion lib/parser/type/An+B.js → lib/parser/type/AnPlusB.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module.exports = function AnPlusB() {
}

return {
type: 'An+B',
type: 'AnPlusB',
loc: this.getLocation(start, end),
a: a,
b: b
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function translate(node) {
case 'Dimension':
return node.value + node.unit;

case 'An+B':
case 'AnPlusB':
var result = '';
var a = node.a !== null && node.a !== undefined;
var b = node.b !== null && node.b !== undefined;
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/translateWithSourceMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function translate(node) {
case 'Dimension':
return node.value + node.unit;

case 'An+B':
case 'AnPlusB':
var result = '';
var a = node.a !== null && node.a !== undefined;
var b = node.b !== null && node.b !== undefined;
Expand Down
2 changes: 1 addition & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var walk = require('../lib/utils/walk').all;
var stringify = require('./helpers/stringify.js');
var css = '/fixture/stringify.css';
var types = [
'An+B', 'Atrule', 'AtruleExpression', 'AttributeSelector', 'Block', 'Brackets',
'AnPlusB', 'Atrule', 'AtruleExpression', 'AttributeSelector', 'Block', 'Brackets',
'ClassSelector', 'Combinator', 'Comment', 'Declaration', 'Dimension', 'Function',
'HexColor', 'IdSelector', 'Identifier', 'Nth', 'MediaFeature', 'MediaQuery', 'MediaQueryList',
'Number', 'Operator', 'Parentheses', 'Percentage', 'PseudoClassSelector',
Expand Down
40 changes: 20 additions & 20 deletions test/fixture/parse/selector/Nth.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -26,7 +26,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -44,7 +44,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -62,7 +62,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -80,7 +80,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -98,7 +98,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -116,7 +116,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -134,7 +134,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -153,7 +153,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -171,7 +171,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "+3",
"b": "-2"
},
Expand All @@ -189,7 +189,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": null,
"b": "10"
},
Expand All @@ -207,7 +207,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": null
},
Expand Down Expand Up @@ -293,7 +293,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "1",
"b": null
},
Expand All @@ -311,7 +311,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "-1",
"b": null
},
Expand All @@ -330,7 +330,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -349,7 +349,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "+3",
"b": "-2"
},
Expand All @@ -368,7 +368,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand All @@ -387,7 +387,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "+3",
"b": "-2"
},
Expand All @@ -405,7 +405,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "123456",
"b": "-12345678"
},
Expand All @@ -423,7 +423,7 @@
{
"type": "Nth",
"nth": {
"type": "An+B",
"type": "AnPlusB",
"a": "2",
"b": "1"
},
Expand Down
4 changes: 2 additions & 2 deletions test/fixture/stringify.ast
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@
}
},
"nth": {
"type": "An+B",
"type": "AnPlusB",
"loc": {
"source": "stringify.css",
"start": {
Expand Down Expand Up @@ -1417,7 +1417,7 @@
}
},
"nth": {
"type": "An+B",
"type": "AnPlusB",
"loc": {
"source": "stringify.css",
"start": {
Expand Down
2 changes: 1 addition & 1 deletion test/walk.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('AST traversal', function() {
}

var shouldVisitTypes = [
'An+B',
'AnPlusB',
'Atrule',
'AtruleExpression',
'Block',
Expand Down

0 comments on commit 87fd11d

Please sign in to comment.