Skip to content

Commit

Permalink
Merge 38e696f into 044f768
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Jan 29, 2019
2 parents 044f768 + 38e696f commit 060e815
Show file tree
Hide file tree
Showing 34 changed files with 798 additions and 756 deletions.
34 changes: 17 additions & 17 deletions docs/ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export interface NumberValue extends INode {
https://www.w3.org/TR/css3-values/#numbers
- Examples :
- `-10` :
```json
```js
{
"type": "Number",
"value": -10,
Expand All @@ -87,7 +87,7 @@ export interface NumberValue extends INode {
}
```
- `/*comment*/ +.01` :
```json
```js
{
"type": "Number",
"value": 0.01,
Expand Down Expand Up @@ -134,7 +134,7 @@ export interface LengthValue extends INode {
https://www.w3.org/TR/css3-values/#lengths
- Examples :
- `-10px` :
```json
```js
{
"type": "Length",
"value": -10,
Expand All @@ -146,7 +146,7 @@ export interface LengthValue extends INode {
}
```
- `-10PX` :
```json
```js
{
"type": "Length",
"value": -10,
Expand All @@ -155,7 +155,7 @@ export interface LengthValue extends INode {
"before": "",
"value": { ... },
"unit": {
"raw": "PX"
"raw": "PX",
"value": "px"
}
}
Expand Down Expand Up @@ -363,23 +363,23 @@ export interface Word extends INode {
- `Word` is node of words or unknown values.
- Examples :
- `foo` :
```json
```js
{
"type": "Word",
"value": "foo",
"raws": { ... }
}
```
- `-10foo` :
```json
```js
{
"type": "Word",
"value": "-10foo",
"raws": { ... }
}
```
- `#{ foo-bar }` :
```json
```js
{
"type": "Word",
"value": "#{ foo-bar }",
Expand Down Expand Up @@ -416,7 +416,7 @@ export interface MathExpression extends INode {
- `MathExpression` is node of the mathematical expression with a right side and a left side.
- Examples :
- `100% - 20px` :
```json
```js
{
"type": "MathExpression",
"left": { "type": "Percentage", "value": 100, "unit": "%", ... },
Expand All @@ -426,7 +426,7 @@ export interface MathExpression extends INode {
}
```
- `/* a */ 100% /* b */ - /* c */ 20px` :
```json
```js
{
"type": "MathExpression",
"left": { ... , "raws": { "before": "/* a */ " } },
Expand Down Expand Up @@ -457,7 +457,7 @@ export interface FunctionNode extends IContainer {
- `Function` is node of the function call expression.
- Examples :
- `call(100% - 20px)` :
```json
```js
{
"type": "Function",
"name": "call",
Expand All @@ -466,7 +466,7 @@ export interface FunctionNode extends IContainer {
}
```
- `var(--foo-bar)` :
```json
```js
{
"type": "Function",
"name": "var",
Expand All @@ -475,7 +475,7 @@ export interface FunctionNode extends IContainer {
}
```
- `/*a*/ var( /*b*/ --foo-bar /*c*/ , /*d*/ 10px /*e*/ )` :
```json
```js
{
"type": "Function",
"name": "var",
Expand Down Expand Up @@ -528,15 +528,15 @@ export interface StringNode extends INode {
- `String` is node of the string.
- Examples :
- `'str'` :
```json
```js
{
"type": "String",
"value": "'str'",
...
}
```
- `"str"` :
```json
```js
{
"type": "String",
"value": "\"str\"",
Expand Down Expand Up @@ -584,15 +584,15 @@ export type Other = Operator | Punctuator
*/
export interface Punctuator extends INode {
type: "Punctuator"
value: "," | "(" | ")"
value: "," | ")"
raws: {
before: string
}
}
```

- `Punctuator` is node of the punctuator.
- `(`, `)` that could not be processed are retained as `Punctuator` nodes.
- `)` that could not be processed are retained as `Punctuator` nodes.

### Operator

Expand Down
1 change: 1 addition & 0 deletions scripts/create-fixtures-ast.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
"use strict"

//------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions scripts/update-fixtures-ast.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
"use strict"

//------------------------------------------------------------------------------
Expand Down

0 comments on commit 060e815

Please sign in to comment.