Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mincss
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
mincss
Commits
1c3e2ecb
Commit
1c3e2ecb
authored
Jul 18, 2014
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some support for xross-browser compatibility hacks
parent
9f135688
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
lexer.mll
lexer.mll
+12
-9
parser.mly
parser.mly
+3
-1
No files found.
lexer.mll
View file @
1c3e2ecb
...
@@ -25,7 +25,7 @@ let unicode = '\\' h(h(h(h(h(h)?)?)?)?)? wc?
...
@@ -25,7 +25,7 @@ let unicode = '\\' h(h(h(h(h(h)?)?)?)?)? wc?
let
escape
=
unicode
|
'\\'
[
^
'\r'
'\n'
'\012'
'
0
'
-
'
9
'
'
a'
-
'
f'
'
A'
-
'
F'
]
let
escape
=
unicode
|
'\\'
[
^
'\r'
'\n'
'\012'
'
0
'
-
'
9
'
'
a'
-
'
f'
'
A'
-
'
F'
]
let
nmstart
=
[
'
_'
'
a'
-
'
z'
'
A'
-
'
Z'
]
|
nonascii
|
escape
let
nmstart
=
[
'
_'
'
a'
-
'
z'
'
A'
-
'
Z'
]
|
nonascii
|
escape
let
nmchar
=
[
'
_'
'
a'
-
'
z'
'
A'
-
'
Z'
'
0
'
-
'
9
'
'
-
'
]
|
nonascii
|
escape
let
nmchar
=
[
'
_'
'
a'
-
'
z'
'
A'
-
'
Z'
'
0
'
-
'
9
'
'
-
'
]
|
nonascii
|
escape
let
string1
=
'
"'
([^'
\n
' '
\r
' '
\012
' '"
'
]
|
'\\'
nl
|
escape
)
*
'
"'
let
string1
=
'
"'
([^'
\n
' '
\r
' '
\012
' '"
'
]
|
'\\'
nl
|
escape
)
*
'
"'
let string2 = '
\'
' ([^'
\n
' '
\r
' '
\012
' '
\'
'] | '
\\
' nl | escape)* '
\'
'
let string2 = '
\'
' ([^'
\n
' '
\r
' '
\012
' '
\'
'] | '
\\
' nl | escape)* '
\'
'
let mystring = string1 | string2
let mystring = string1 | string2
let badstring1 = '"
'
([
^
'\n'
'\r'
'\012'
'
"'] | '
\\
'nl | escape)* '
\\
'?
let badstring1 = '"
'
([
^
'\n'
'\r'
'\012'
'
"'] | '
\\
'nl | escape)* '
\\
'?
...
@@ -71,6 +71,8 @@ let X = ['x' 'X']
...
@@ -71,6 +71,8 @@ let X = ['x' 'X']
let Y = ['y' 'Y']
let Y = ['y' 'Y']
let Z = ['z' 'Z']
let Z = ['z' 'Z']
let uagent = ('-' ("
webkit
" | "
moz
" | "
ms
" | "
o
") '-')?
rule token = parse
rule token = parse
| s { S }
| s { S }
...
@@ -88,14 +90,14 @@ rule token = parse
...
@@ -88,14 +90,14 @@ rule token = parse
| '#' (name as nm) { HASH nm }
| '#' (name as nm) { HASH nm }
| '@' I M P O R T { IMPORT_SYM }
| '@' I M P O R T
{ IMPORT_SYM }
| '@' P A G E { PAGE_SYM }
| '@' P A G E
{ PAGE_SYM }
| '@' M E D I A { MEDIA_SYM }
| '@' M E D I A
{ MEDIA_SYM }
| "
@
charset
" { CHARSET_SYM }
| "
@
charset
"
{ CHARSET_SYM }
| '@' F O N T '-' F A C E { FONT_FACE_SYM }
| '@' F O N T '-' F A C E
{ FONT_FACE_SYM }
| '@' N A M E S P A C E { NAMESPACE_SYM }
| '@' N A M E S P A C E
{ NAMESPACE_SYM }
| '@'
K E Y F R A M E S
{ KEYFRAMES_SYM }
| '@'
uagent K E Y F R A M E S
{ KEYFRAMES_SYM }
| '@' S U P P O R T S { SUPPORTS_SYM }
| '@' S U P P O R T S
{ SUPPORTS_SYM }
| (w | comment)* w A N D w (w | comment)* { SUPPORTS_AND }
| (w | comment)* w A N D w (w | comment)* { SUPPORTS_AND }
| (w | comment)* w O R w (w | comment)* { SUPPORTS_OR }
| (w | comment)* w O R w (w | comment)* { SUPPORTS_OR }
...
@@ -141,4 +143,5 @@ rule token = parse
...
@@ -141,4 +143,5 @@ rule token = parse
| eof | '
\000
' { EOF }
| eof | '
\000
' { EOF }
| _ { token lexbuf }
| _ as c { raise (SyntaxError ("
unexpected
'
" ^ Char.escaped c ^ "
'
")) }
| _ as c { raise (SyntaxError ("
unexpected
'
" ^ Char.escaped c ^ "
'
")) }
parser.mly
View file @
1c3e2ecb
...
@@ -251,7 +251,9 @@ pseudo:
...
@@ -251,7 +251,9 @@ pseudo:
declaration
:
declaration
:
|
name
=
property
S
*
COLON
S
*
value
=
expr
important
=
boption
(
ig2
(
IMPORTANT_SYM
,
S
*
))
|
name
=
property
S
*
COLON
S
*
value
=
expr
important
=
boption
(
ig2
(
IMPORTANT_SYM
,
S
*
))
{
(
String
.
lowercase
name
,
value
,
important
)
}
{
(
String
.
lowercase
name
,
value
,
important
)
}
%
inline
property
:
name
=
IDENT
{
name
}
%
inline
property
:
|
name
=
IDENT
{
name
}
|
STAR
name
=
IDENT
{
"*"
^
name
}
(* IE7 property name hack *)
expr
:
expr
:
|
l
=
exprl
{
concat_terms
l
}
|
l
=
exprl
{
concat_terms
l
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment