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
d3820174
Commit
d3820174
authored
Dec 31, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed line number counter in parser for comments
parent
90e4a60f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
parse.py
parse.py
+10
-10
No files found.
parse.py
View file @
d3820174
...
...
@@ -35,11 +35,14 @@ def parse_groups(css):
for
c
in
css
:
char
=
c
if
char
==
'
\
n
'
:
lineno
+=
1
if
comment
:
# Comment end?
if
c
==
'/'
and
prev_char
==
'*'
:
if
c
har
==
'/'
and
prev_char
==
'*'
:
comment
=
False
elif
c
==
'{'
:
elif
c
har
==
'{'
:
# Block start
if
selectors
is
not
None
:
# Block is nested, save group selector
...
...
@@ -50,7 +53,7 @@ def parse_groups(css):
#print stack.strip(), '->', selectors
stack
=
''
assert
len
(
selectors
)
elif
c
==
'}'
:
elif
c
har
==
'}'
:
# Last property may not have been closed with a semicolon
parse_property
()
...
...
@@ -62,21 +65,18 @@ def parse_groups(css):
current_group
.
append
((
selectors
,
properties
))
selectors
=
None
properties
=
[]
elif
c
==
';'
:
elif
c
har
==
';'
:
# Property definition
parse_property
()
stack
=
''
elif
c
==
'*'
and
prev_char
==
'/'
:
elif
c
har
==
'*'
and
prev_char
==
'/'
:
# Comment start
comment
=
True
stack
=
stack
[:
-
1
]
else
:
if
c
==
'
\
n
'
:
lineno
+=
1
stack
+=
c
stack
+=
char
prev_char
=
c
prev_char
=
c
har
except
AssertionError
:
raise
Exception
(
'unexpected
\
'
%c
\
'
on line %d'
%
(
char
,
lineno
))
...
...
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