Skip to content

Add line number support in the sabberworm CSS parser #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
173c7ae
store line numbers in css objects
sidkshatriya May 30, 2016
6e65e00
Allow line num to be initialized in the Parser contructor
sidkshatriya May 31, 2016
4972aeb
line number for AtRule should be the number of its identifier
sidkshatriya May 31, 2016
b8d3287
Update tests with line numbers
sidkshatriya Jun 29, 2016
1e1a3a7
Merge branch 'master' into line-number-support-in-css-objects
sidkshatriya Jun 29, 2016
230ef27
Revert "Update tests with line numbers"
sidkshatriya Jun 30, 2016
1920219
CSSList should also implement Renderable
sidkshatriya Jun 30, 2016
8f554da
Rename getLineNum() to getLineNo() and make getLineNo a method in the…
sidkshatriya Jun 30, 2016
4ef7e03
Rule class should implement Renderable
sidkshatriya Jun 30, 2016
ab8c45c
Variable renaming and removing a bit of redundant code
sidkshatriya Jun 30, 2016
b55cee9
Add line number support to UnexpectedTokenException and OutputException
sidkshatriya Jun 30, 2016
faa6dc7
Add method setLineNo() which will be useful for synthetically setting…
sidkshatriya Jun 30, 2016
616bc2c
Remove getLineNo() from class Size as it already there in the class V…
sidkshatriya Jun 30, 2016
fa8ffba
Add method setLineNo to set each component of the class Color
sidkshatriya Jun 30, 2016
ec657c2
Ignore line numbers in ParserTest::testColorParsing()
sidkshatriya Jun 30, 2016
7045ea0
Rename iLineNum to iLineNo
sidkshatriya Jun 30, 2016
349d5ba
Opening braces on the same line for a method
sidkshatriya Jun 30, 2016
d7aa43e
Provide a getter for the OutputException and UnexpectedTokenException…
sidkshatriya Jun 30, 2016
83866af
Opening braces on the same line of method (more)
sidkshatriya Jun 30, 2016
82dcd54
Bug: iLineNo and not getLine()
sidkshatriya Jun 30, 2016
1c572eb
Add new class SourceException that is the parent exception class for …
sidkshatriya Jun 30, 2016
45f7b3b
Use SourceException class instead of raw \Exception
sidkshatriya Jun 30, 2016
61f90b8
Remove setLineNo() method from everywhere
sidkshatriya Jun 30, 2016
24bb671
Pass in the line number to the color test so that it never fails
sidkshatriya Jun 30, 2016
63386df
Remove redundant stuff from UnexpectedTokenException
sidkshatriya Jun 30, 2016
e282cb3
Parser intial line number should be 1 and not 0
sidkshatriya Jun 30, 2016
1644d6a
Add a test for line numbers
sidkshatriya Jun 30, 2016
a6c461e
Use array() instead of [] for PHP 5.3
sidkshatriya Jun 30, 2016
0be01bc
Fix line numbers and some more [] to array()
sidkshatriya Jun 30, 2016
5814549
SourceException and not \Exception
sidkshatriya Jun 30, 2016
134ee42
Yet another missed [] to array() conversion
sidkshatriya Jun 30, 2016
12c945f
Add test for multiline color rule
sidkshatriya Jun 30, 2016
2f06322
Adding a test for exception as suggested by @sabberworm https://githu…
sidkshatriya Jun 30, 2016
7132bed
Minor fixes and tweaks
sidkshatriya Jun 30, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add method setLineNo to set each component of the class Color
  • Loading branch information
sidkshatriya committed Jun 30, 2016
commit fa8ffba564ab1be00e99eaf6519e13c737f14204
8 changes: 8 additions & 0 deletions lib/Sabberworm/CSS/Value/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ public function setColor($aColor) {
$this->aComponents = $aColor;
}

public function setLineNo($iLineNum = 0)
{
foreach($this->aComponents as $color_component) {
$color_component->setLineNo($iLineNum);
}
parent::setLineNo($iLineNum);
}

public function getColorDescription() {
return $this->getName();
}
Expand Down