Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
csscom
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
csscom
Commits
47a2e5f5
Commit
47a2e5f5
authored
Dec 31, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parser now recognizes properties at the end of a block without semicolon
parent
efb00ab5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
parse.py
parse.py
+15
-9
No files found.
parse.py
View file @
47a2e5f5
...
...
@@ -21,6 +21,16 @@ def parse_groups(css):
selectors
=
None
comment
=
False
def
parse_property
():
assert
selectors
is
not
None
if
stack
.
strip
():
parts
=
stack
.
split
(
':'
,
1
)
assert
len
(
parts
)
==
2
name
,
value
=
map
(
str
.
strip
,
parts
)
assert
'
\
n
'
not
in
name
properties
.
append
((
name
,
value
))
try
:
for
c
in
css
:
char
=
c
...
...
@@ -41,6 +51,9 @@ def parse_groups(css):
stack
=
''
assert
len
(
selectors
)
elif
c
==
'}'
:
# Last property may not have been closed with a semicolon
parse_property
()
if
selectors
is
None
:
# Closing group
current_group
=
root_group
...
...
@@ -51,15 +64,8 @@ def parse_groups(css):
properties
=
[]
elif
c
==
';'
:
# Property definition
assert
selectors
is
not
None
if
stack
.
strip
():
parts
=
stack
.
split
(
':'
,
1
)
assert
len
(
parts
)
==
2
name
,
value
=
map
(
str
.
strip
,
parts
)
assert
'
\
n
'
not
in
name
properties
.
append
((
name
,
value
))
stack
=
''
parse_property
()
stack
=
''
elif
c
==
'*'
and
prev_char
==
'/'
:
# Comment start
comment
=
True
...
...
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