Skip to content

Commit

Permalink
rename UnicodeRange attribute name -> value
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Jan 12, 2017
1 parent 313b7c0 commit 9cf3b7d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lib/parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ function getUnicodeRange() {
return {
type: 'UnicodeRange',
info: getInfo(start),
name: scanner.substrToCursor(start)
value: scanner.substrToCursor(start)
};
}

Expand Down
6 changes: 3 additions & 3 deletions lib/utils/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ function translate(node) {
case 'Identifier':
return node.name;

case 'UnicodeRange':
return node.name;

case 'PseudoClass':
return node.sequence !== null
? ':' + node.name + '(' + each(node.sequence) + ')'
Expand All @@ -183,6 +180,9 @@ function translate(node) {
case 'Id':
return '#' + node.name;

case 'UnicodeRange':
return node.value;

case 'Hash':
return '#' + node.value;

Expand Down
6 changes: 3 additions & 3 deletions lib/utils/translateWithSourceMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ function translate(node) {
case 'Identifier':
return node.name;

case 'UnicodeRange':
return node.name;

case 'PseudoClass':
return node.sequence !== null
? ':' + node.name + '(' + each(node.sequence) + ')'
Expand All @@ -257,6 +254,9 @@ function translate(node) {
case 'Id':
return '#' + node.name;

case 'UnicodeRange':
return node.value;

case 'Hash':
return '#' + node.value;

Expand Down
10 changes: 5 additions & 5 deletions test/fixture/parse/stylesheet/StyleSheet.json
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "U+2074"
"value": "U+2074"
},
{
"type": "Operator",
Expand All @@ -987,7 +987,7 @@
},
{
"type": "UnicodeRange",
"name": "U+20AC"
"value": "U+20AC"
},
{
"type": "Operator",
Expand All @@ -998,7 +998,7 @@
},
{
"type": "UnicodeRange",
"name": "U+2212"
"value": "U+2212"
},
{
"type": "Operator",
Expand All @@ -1009,7 +1009,7 @@
},
{
"type": "UnicodeRange",
"name": "U+2215"
"value": "U+2215"
},
{
"type": "Operator",
Expand All @@ -1020,7 +1020,7 @@
},
{
"type": "UnicodeRange",
"name": "U+E0FF"
"value": "U+E0FF"
}
]
}
Expand Down
20 changes: 10 additions & 10 deletions test/fixture/parse/value/UnicodeRange.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "U+0F00"
"value": "U+0F00"
}
]
}
Expand All @@ -18,7 +18,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "U+0F00-0FFF"
"value": "U+0F00-0FFF"
}
]
}
Expand All @@ -30,7 +30,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "u+0025-00FF"
"value": "u+0025-00FF"
}
]
}
Expand All @@ -42,7 +42,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "U+FF00-FF10"
"value": "U+FF00-FF10"
}
]
}
Expand All @@ -54,7 +54,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "U+1234-2345"
"value": "U+1234-2345"
}
]
}
Expand All @@ -66,7 +66,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "U+1234-abcd"
"value": "U+1234-abcd"
}
]
}
Expand All @@ -78,7 +78,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "U+0-7F"
"value": "U+0-7F"
}
]
}
Expand All @@ -90,7 +90,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "u+0f00??"
"value": "u+0f00??"
}
]
}
Expand All @@ -114,7 +114,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "u+0"
"value": "u+0"
},
{
"type": "Number",
Expand All @@ -130,7 +130,7 @@
"sequence": [
{
"type": "UnicodeRange",
"name": "u+12e"
"value": "u+12e"
},
{
"type": "Number",
Expand Down

0 comments on commit 9cf3b7d

Please sign in to comment.