Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csscom
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Taddeüs Kroes
csscom
Commits
d3820174
Commit
d3820174
authored
12 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Fixed line number counter in parser for comments
parent
90e4a60f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parse.py
+10
-10
10 additions, 10 deletions
parse.py
with
10 additions
and
10 deletions
parse.py
+
10
−
10
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
))
...
...
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