Skip to content

Commit 5e32c8c

Browse files
committed
Switch the README file to reStructuredText
1 parent ec85a34 commit 5e32c8c

File tree

2 files changed

+129
-129
lines changed

2 files changed

+129
-129
lines changed

README

Lines changed: 0 additions & 129 deletions
This file was deleted.

README.rst

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
Result representation
2+
=====================
3+
4+
AST nodes (the results of parsing) are represented in JSON as follow.
5+
This representation was chosen to be compact
6+
(and thus less annoying to write by hand)
7+
while staying unambiguous.
8+
For example, the difference between @import and \@import is not lost:
9+
they are represented as ``["at-keyword", "import"]`` and ``["ident", "@import"]``,
10+
respectively.
11+
12+
13+
Component values
14+
----------------
15+
16+
<ident>
17+
Array of length 2: the string ``"ident"``, and the value as a string.
18+
19+
<at-keyword>
20+
Array of length 2: the string ``"at-keyword"``, and the value as a string.
21+
22+
<hash>
23+
Array of length 3: the string ``"hash"``, the value as a string,
24+
and the type as the string ``"id"`` or ``"unrestricted"``.
25+
26+
<string>
27+
Array of length 2: the string ``"string"``, and the value as a string.
28+
29+
<bad-string>
30+
Array of length 1: the string ``"bad-string"``.
31+
32+
<url>
33+
Array of length 2: the string ``"url"``, and the value as a string.
34+
35+
<bad-url>
36+
Array of length 1: the string ``"bad-url"``.
37+
38+
<delim>
39+
The value as a one-character string.
40+
41+
<number>
42+
Array of length 4: the string ``"number"``, the representation as a string,
43+
the value as a number, and the type as the string ``"integer"`` or ``"number"``.
44+
45+
<percentage>
46+
Array of length 4: the string ``"percentage"``, the representation as a string,
47+
the value as a number, and the type as the string ``"integer"`` or ``"number"``.
48+
49+
<dimension>
50+
Array of length 4: the string ``"dimension"``, the representation as a string,
51+
the value as a number, the type as the string ``"integer"`` or ``"number"``,
52+
and the unit as a string.
53+
54+
<unicode-range>
55+
Array of length 2: the string ``"unicode-range"``, and the range as either
56+
null for the empty range, or an array of two numbers.
57+
58+
<include-match>
59+
The string ``"~="``.
60+
61+
<dash-match>
62+
The string ``"|="``.
63+
64+
<prefix-match>
65+
The string ``"^="``.
66+
67+
<suffix-match>
68+
The string ``"$="``.
69+
70+
<substring-match>
71+
The string ``"*="``.
72+
73+
<column>
74+
The string ``"||"``.
75+
76+
<whitespace>
77+
The string ``" "`` (a single space.)
78+
79+
<CDO>
80+
The string ``"<!--"``.
81+
82+
<CDC>
83+
The string ``"-->"``.
84+
85+
<colon>
86+
The string ``":"``.
87+
88+
<semicolon>
89+
The string ``";"``.
90+
91+
<comma>
92+
The string ``","``.
93+
94+
{} block
95+
An array of length N+1: the string ``"{}"``
96+
followed by the N component values of the block’s value.
97+
98+
[] block
99+
An array of length N+1: the string ``"[]"``
100+
followed by the N component values of the block’s value.
101+
102+
() block
103+
An array of length N+1: the string ``"()"``
104+
followed by the N component values of the block’s value.
105+
106+
Function
107+
An array of length N+2: the string ``"function"``
108+
and the name of the function as a string
109+
followed by the N component values of the function’s value.
110+
111+
112+
Other nodes
113+
-----------
114+
115+
Declaration
116+
An array of length 4: the string ``"declaration"``, the name as a string,
117+
the value as a nested array of component values,
118+
and a the important flag as a boolean.
119+
120+
At-rule
121+
An array of length 4: the string ``"at-rule"``,
122+
the name (value of the at-keyword) as a string,
123+
the prelude as a nested array of component values,
124+
and the optional block as a nested array of component value, or null.
125+
126+
Qualified rule
127+
An array of length 3: the string ``"qualified rule"``,
128+
the prelude as a nested array of component values,
129+
and the block as a nested array of component value.

0 commit comments

Comments
 (0)