Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/d4rky-pl/phamlp
Browse files Browse the repository at this point in the history
  • Loading branch information
goncaloe committed Mar 8, 2011
2 parents f8ff0aa + 9b58941 commit 636eb69
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 13 deletions.
51 changes: 51 additions & 0 deletions README.markdown
@@ -0,0 +1,51 @@
## Issues from the original Google Code repository
Since the original Google Code project seems abandoned, this is an attempt to get a current status of pending issues.

### Resolved Issues
* [Issue 47](http://code.google.com/p/phamlp/issues/detail?id=47): Sass: Unitless function throws an error. [resolved](https://github.com/MarcWeber/phamlp/commit/aaeed17368f2fbc5b40716415e0a38f88c6b661a)
* [Issue 48](http://code.google.com/p/phamlp/issues/detail?id=48): Haml Proper Indenting? [resolved](https://github.com/MarcWeber/phamlp/commit/237b87f2b6f64bd5d6703790f9befa55a7226e6c)
* [Issue 52](http://code.google.com/p/phamlp/issues/detail?id=52): Processing of color components numeric overflowing [resolved](https://github.com/MarcWeber/phamlp/commit/79cc6a37f615a9cbe1dfe330bad11d5c94a4a081)
* [Issue 58](http://code.google.com/p/phamlp/issues/detail?id=58): sass and haml parsing error [partially resolved](https://github.com/MarcWeber/phamlp/commit/0758bed56f447f50d08f595e988ca866d9caa7f2) see issue MarcWeber/phamlp#1
* [Issue 59](http://code.google.com/p/phamlp/issues/detail?id=59): sass mixin argument parsing error [resolved](https://github.com/MarcWeber/phamlp/commit/be5c769002bdf0d54b039aca3a2b55ab84a7fbef)
* [Issue 69](http://code.google.com/p/phamlp/issues/detail?id=69): Some function of Sass are failing [resolved](https://github.com/MarcWeber/phamlp/commit/331f0b7ccebc914a9de512d79a145376a9165a1a)
* [Issue 71](http://code.google.com/p/phamlp/issues/detail?id=71): vendor properties are not correctly merged [resolved](https://github.com/MarcWeber/phamlp/commit/64bc4e076a5100608a5e05d1903a96a0a3059639)
* [Issue 72](http://code.google.com/p/phamlp/issues/detail?id=72): SASS function alias 'color_stops' broken [resolved](https://github.com/MarcWeber/phamlp/commit/02b6e235117af0551089606a6fd8747ed472191b)
* [Issue 73](http://code.google.com/p/phamlp/issues/detail?id=73): Fix webkit gradient with color-stop [resolved](https://github.com/MarcWeber/phamlp/commit/64580bf819d895b10e5cc9fe6d3033c2335670f5)
* [Issue 74](http://code.google.com/p/phamlp/issues/detail?id=74): SassNestedRenderer: Missing argument, caused by SassNestedRenderer [resolved](https://github.com/MarcWeber/phamlp/commit/bf1408462be7dec6885b9a7dfe666b66f4f6a0df)
* [Issue 75](http://code.google.com/p/phamlp/issues/detail?id=75): Function font_files has incorrect brackets [resolved](https://github.com/MarcWeber/phamlp/commit/e271c2dd018dad0dfa25fa8f41b7a9b1b455abe8)
* [Issue 78](http://code.google.com/p/phamlp/issues/detail?id=78): wrong darken value [resolved](https://github.com/MarcWeber/phamlp/commit/43032beaf0d892ecfc4fd08742ca26817fbaa226)
* [Issue 86](http://code.google.com/p/phamlp/issues/detail?id=86): != &= implementation is missing [resolved](https://github.com/MarcWeber/phamlp/commit/2b0ce57083cabd4b621a45e96e012bfe728ca229)


### Unresolved (added to GitHub issues)
* [Issue 58](http://code.google.com/p/phamlp/issues/detail?id=58): sass and haml parsing error [new issue](https://github.com/MarcWeber/phamlp/issues#issue/1)

### Backlog (unprocessed from Google code)
* [Issue 49](http://code.google.com/p/phamlp/issues/detail?id=49): Allow to not include any helper file
* [Issue 50](http://code.google.com/p/phamlp/issues/detail?id=50): Execution of php code after specified tag attributes
* [Issue 51](http://code.google.com/p/phamlp/issues/detail?id=51): no css generation with PHP 5.3.1
* [Issue 53](http://code.google.com/p/phamlp/issues/detail?id=53): [Sass] Proper Attribution of Compass Source
* [Issue 54](http://code.google.com/p/phamlp/issues/detail?id=54): Invalid css output whe using @else if inside of mixin
* [Issue 55](http://code.google.com/p/phamlp/issues/detail?id=55): @media rules doesnt work in sass
* [Issue 56](http://code.google.com/p/phamlp/issues/detail?id=56): transparent is not a colour
* [Issue 57](http://code.google.com/p/phamlp/issues/detail?id=57): Indentation guess algorithm fails if there is a multiline comment at the top
* [Issue 60](http://code.google.com/p/phamlp/issues/detail?id=60): sass script processing order
* [Issue 61](http://code.google.com/p/phamlp/issues/detail?id=61): Yii Ext: Docs code for Sass
* [Issue 62](http://code.google.com/p/phamlp/issues/detail?id=62): Demo files for Yii Framework not up to date
* [Issue 63](http://code.google.com/p/phamlp/issues/detail?id=63): Yii specific phamlp extension: consider moving vendors folder
* [Issue 64](http://code.google.com/p/phamlp/issues/detail?id=64): Example SCSS code on the Project Home page is incorrect.
* [Issue 65](http://code.google.com/p/phamlp/issues/detail?id=65): Haml helper function list_of return empty
* [Issue 66](http://code.google.com/p/phamlp/issues/detail?id=66): Exception while throwing SassPropertyNodeException in SassPropertyNode::isa()
* [Issue 67](http://code.google.com/p/phamlp/issues/detail?id=67): Extension could not be found
* [Issue 68](http://code.google.com/p/phamlp/issues/detail?id=68): Extensions parameter is missing in sass.php (CakePHP version)
* [Issue 70](http://code.google.com/p/phamlp/issues/detail?id=70): Sass : parsing fails with :: and =
* [Issue 76](http://code.google.com/p/phamlp/issues/detail?id=76): SASS mixin font-face produces wrong css
* [Issue 77](http://code.google.com/p/phamlp/issues/detail?id=77): Mixin::opacity: Required variable (opacity) not given
* [Issue 79](http://code.google.com/p/phamlp/issues/detail?id=79): add support CSS3 PIE
* [Issue 80](http://code.google.com/p/phamlp/issues/detail?id=80): extend selector with nesting
* [Issue 81](http://code.google.com/p/phamlp/issues/detail?id=81): No documentation on how to use Compass
* [Issue 82](http://code.google.com/p/phamlp/issues/detail?id=82): sass assets for CakePHP does not support plugins
* [Issue 83](http://code.google.com/p/phamlp/issues/detail?id=83): No Exception thrown when compiling scss files
* [Issue 84](http://code.google.com/p/phamlp/issues/detail?id=84): Warning: dirname() expects parameter 1 to be string, array given in /var/www/domains/sinwolf.com/www/cms/application/classes/packager/plugins/phamlp/sass/SassFile.php on line 79
* [Issue 87](http://code.google.com/p/phamlp/issues/detail?id=87): Haml - Escaping differs from original haml
* [Issue 88](http://code.google.com/p/phamlp/issues/detail?id=88): Haml - allows nesting that original haml does not
7 changes: 4 additions & 3 deletions haml/HamlParser.php
Expand Up @@ -447,6 +447,7 @@ public function haml2PHP($sourceFile) {
* @return HamlRootNode the root of this document tree
*/
private function toTree($source) {
$source = str_replace(array("\r\n", "\n\r", "\r"), "\n", $source);
$this->source = explode("\n", $source);
$this->setIndentChar();

Expand Down Expand Up @@ -950,7 +951,7 @@ private function parseAttributeHash($subject) {
$attributes[$attr[3]] = '<?php echo ' . join(($attr[3] === 'id' ? ".'_'." : ".' '."), $values) . '; ?>';
}
elseif (!empty($attr[6])) {
$attributes[$attr[3]] = $this->interpolate($attr[6]);
$attributes[$attr[3]] = $this->interpolate($attr[6], $attr[3]);
}
elseif ($attr[6] === '') {
$attributes[$attr[3]] = $attr[6];
Expand Down Expand Up @@ -1256,7 +1257,7 @@ private function parseWhitespaceControl($line) {
* @param string the text to interpolate
* @return string the interpolated text
*/
protected function interpolate($string) {
return preg_replace(self::MATCH_INTERPOLATION, self::INTERPOLATE, $string);
protected function interpolate($string, $type = '') {
return preg_replace(self::MATCH_INTERPOLATION, (in_array($type, $this->minimizedAttributes) ? '\1' : self::INTERPOLATE), $string);
}
}
23 changes: 19 additions & 4 deletions haml/renderers/HamlRenderer.php
@@ -1,5 +1,5 @@
<?php
/* SVN FILE: $Id$ */
/* SVN FILE: $Id: HamlRenderer.php 93 2010-05-20 17:43:41Z chris.l.yates $ */
/**
* HamlRenderer class file.
* @author Chris Yates <chris.l.yates@gmail.com>
Expand Down Expand Up @@ -70,11 +70,26 @@ private function renderAttributes($attributes) {
if (is_integer($name)) { // attribute function
$output .= " $value";
}
elseif ($name == $value &&
elseif ($name == $value && in_array($name, $this->minimizedAttributes) &&
($this->format === 'html4' || $this->format === 'html5')) {
$output .= " $name";
}
else {
elseif(in_array($name, $this->minimizedAttributes))
{
// $value is a variable, isset is called to make sure E_NOTICE is not thrown
if(preg_match("/^\\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/", trim($value)))
{
$output .= "<"."?php if(isset($value) && !empty($value)): ?"."> $name={$this->attrWrapper}<"."?php echo $value; ?".">{$this->attrWrapper};<"."?php endif; ?".">";
}

// $value is either a method, a constant or a ternary operator
else
{
$output .= "<"."?php if($value): ?"."> $name={$this->attrWrapper}<"."?php echo $value; ?".">{$this->attrWrapper};<"."?php endif; ?".">";
}
}
else
{
$output .= " $name={$this->attrWrapper}$value{$this->attrWrapper}";
}
}
Expand Down Expand Up @@ -134,4 +149,4 @@ public function renderEndCodeBlock($node) {
public function renderContent($node) {
return $node->content;
}
}
}
2 changes: 1 addition & 1 deletion sass/SassParser.php
Expand Up @@ -540,7 +540,7 @@ private function getNode($node) {
case SassVariableNode::isa($token):
return new SassVariableNode($token);
break;
case SassPropertyNode::isa($token, $this->property_syntax):
case SassPropertyNode::isa(array('token' => $token, 'syntax' => $this->property_syntax)):
return new SassPropertyNode($token, $this->property_syntax);
break;
case SassMixinDefinitionNode::isa($token):
Expand Down
3 changes: 2 additions & 1 deletion sass/script/literals/SassLiteral.php
Expand Up @@ -359,5 +359,6 @@ abstract public function toString();
* @param string the subject string
* @return mixed match at the start of the string or false if no match
*/
abstract public static function isa($subject);
// Static function SassLiteral::isa() should not be abstract
// abstract public static function isa($subject);
}
19 changes: 15 additions & 4 deletions sass/tree/SassPropertyNode.php
@@ -1,5 +1,5 @@
<?php
/* SVN FILE: $Id$ */
/* SVN FILE: $Id: SassPropertyNode.php 118 2010-09-21 09:45:11Z chris.l.yates@gmail.com $ */
/**
* SassPropertyNode class file.
* @author Chris Yates <chris.l.yates@gmail.com>
Expand Down Expand Up @@ -95,7 +95,7 @@ public function __construct($token, $syntax = 'new') {
*/
public function parse($context) {
$return = array();
if ($this->value!=="") {
if ($this->value !== "") {
$node = clone $this;
$node->name = ($this->inNamespace() ? "{$this->namespace}-" : '') .
$this->interpolate($this->name, $context);
Expand Down Expand Up @@ -177,7 +177,18 @@ public function getValue() {
* @param string the property syntax being used
* @return boolean true if the token represents this type of node, false if not
*/
public static function isa($token, $syntax) {
public static function isa($token) {

if(!is_array($token))
{
$syntax = 'old';
}
else
{
$syntax = $token['syntax'];
$token = $token['token'];
}

$matches = self::match($token, $syntax);

if (!empty($matches)) {
Expand Down Expand Up @@ -236,4 +247,4 @@ private static function isPseudoSelector($string) {
return (isset($matches[0]) && in_array($matches[0], self::$psuedoSelectors)) ||
preg_match(self::MATCH_INTERPOLATION, $string);
}
}
}

0 comments on commit 636eb69

Please sign in to comment.