Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mincss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
mincss
Commits
1c3e2ecb
Commit
1c3e2ecb
authored
10 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Added some support for xross-browser compatibility hacks
parent
9f135688
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lexer.mll
+12
-9
12 additions, 9 deletions
lexer.mll
parser.mly
+3
-1
3 additions, 1 deletion
parser.mly
with
15 additions
and
10 deletions
lexer.mll
+
12
−
9
View file @
1c3e2ecb
...
...
@@ -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
nmstart
=
[
'
_'
'
a'
-
'
z'
'
A'
-
'
Z'
]
|
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 mystring = string1 | string2
let badstring1 = '"
'
([
^
'\n'
'\r'
'\012'
'
"'] | '
\\
'nl | escape)* '
\\
'?
...
...
@@ -71,6 +71,8 @@ let X = ['x' 'X']
let Y = ['y' 'Y']
let Z = ['z' 'Z']
let uagent = ('-' ("
webkit
" | "
moz
" | "
ms
" | "
o
") '-')?
rule token = parse
| s { S }
...
...
@@ -88,14 +90,14 @@ rule token = parse
| '#' (name as nm) { HASH nm }
| '@' I M P O R T { IMPORT_SYM }
| '@' P A G E { PAGE_SYM }
| '@' M E D I A { MEDIA_SYM }
| "
@
charset
" { CHARSET_SYM }
| '@' F O N T '-' F A C E { FONT_FACE_SYM }
| '@' N A M E S P A C E { NAMESPACE_SYM }
| '@' K E Y F R A M E S
{ KEYFRAMES_SYM }
| '@' S U P P O R T S { SUPPORTS_SYM }
| '@' I M P O R T
{ IMPORT_SYM }
| '@' P A G E
{ PAGE_SYM }
| '@' M E D I A
{ MEDIA_SYM }
| "
@
charset
"
{ CHARSET_SYM }
| '@' F O N T '-' F A C E
{ FONT_FACE_SYM }
| '@' N A M E S P A C E
{ NAMESPACE_SYM }
| '@'
uagent
K E Y F R A M E S { KEYFRAMES_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 O R w (w | comment)* { SUPPORTS_OR }
...
...
@@ -141,4 +143,5 @@ rule token = parse
| eof | '
\000
' { EOF }
| _ { token lexbuf }
| _ as c { raise (SyntaxError ("
unexpected
'
" ^ Char.escaped c ^ "
'
")) }
This diff is collapsed.
Click to expand it.
parser.mly
+
3
−
1
View file @
1c3e2ecb
...
...
@@ -251,7 +251,9 @@ pseudo:
declaration
:
|
name
=
property
S
*
COLON
S
*
value
=
expr
important
=
boption
(
ig2
(
IMPORTANT_SYM
,
S
*
))
{
(
String
.
lowercase
name
,
value
,
important
)
}
%
inline
property
:
name
=
IDENT
{
name
}
%
inline
property
:
|
name
=
IDENT
{
name
}
|
STAR
name
=
IDENT
{
"*"
^
name
}
(* IE7 property name hack *)
expr
:
|
l
=
exprl
{
concat_terms
l
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment