Author: czadra
Date: Tue Dec 4 07:58:46 2012
New Revision: 1416802
URL: http://svn.apache.org/viewvc?rev=1416802&view=rev
Log:
CSSCombinator extends now CSSNodeBase
Modified:
incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/css/CSSCombinatorTests.java
incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSCombinator.java
incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g
Modified:
incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/css/CSSCombinatorTests.java
URL:
http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/css/CSSCombinatorTests.java?rev=1416802&r1=1416801&r2=1416802&view=diff
==============================================================================
---
incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/css/CSSCombinatorTests.java
(original)
+++
incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/css/CSSCombinatorTests.java
Tue Dec 4 07:58:46 2012
@@ -68,7 +68,7 @@ public class CSSCombinatorTests extends
CSSCombinator combinator = getCSSCombinator(code);
//TODO why CSSCombinator doesn't extend CSSNodeBase??
- //assertThat("combinator.getOperator()" ,
combinator.getOperator(), is( CSSModelTreeType.COMBINATOR ) );
+ assertThat("combinator.getOperator()" ,
combinator.getOperator(), is( CSSModelTreeType.COMBINATOR ) );
assertThat("combinator.getCombinatorType()" ,
combinator.getCombinatorType(), is(CombinatorType.DESCENDANT) );
assertThat("combinator.getSelector()" ,
combinator.getSelector(), not( (ICSSSelector) null) );
@@ -84,6 +84,7 @@ public class CSSCombinatorTests extends
String code = " s|VBox s|HBox s|Label";
CSSCombinator combinator = getCSSCombinator(code);
+ assertThat("combinator.getOperator()" ,
combinator.getOperator(), is( CSSModelTreeType.COMBINATOR ) );
assertThat("combinator.getCombinatorType()" ,
combinator.getCombinatorType(), is(CombinatorType.DESCENDANT) );
assertThat("combinator.getSelector()" ,
combinator.getSelector(), not( (ICSSSelector) null) );
Modified:
incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSCombinator.java
URL:
http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSCombinator.java?rev=1416802&r1=1416801&r2=1416802&view=diff
==============================================================================
---
incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSCombinator.java
(original)
+++
incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSCombinator.java
Tue Dec 4 07:58:46 2012
@@ -19,6 +19,8 @@
package org.apache.flex.compiler.internal.css;
+import org.antlr.runtime.TokenStream;
+import org.antlr.runtime.tree.CommonTree;
import org.apache.flex.compiler.css.CombinatorType;
import org.apache.flex.compiler.css.ICSSCombinator;
import org.apache.flex.compiler.css.ICSSSelector;
@@ -26,10 +28,12 @@ import org.apache.flex.compiler.css.ICSS
/**
* Implementation of {@link ICSSCombinator}.
*/
-public class CSSCombinator implements ICSSCombinator
+public class CSSCombinator extends CSSNodeBase implements ICSSCombinator
{
- protected CSSCombinator(final CSSSelector selector, final CombinatorType
type)
+ protected CSSCombinator(final CSSSelector selector, final CombinatorType
type,
+ final CommonTree tree, final TokenStream tokenStream)
{
+ super(tree, tokenStream, CSSModelTreeType.COMBINATOR);
assert selector != null : "Selector can't be null.";
assert type != null : "Combinator type can't be null.";
this.selector = selector;
Modified:
incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g
URL:
http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g?rev=1416802&r1=1416801&r2=1416802&view=diff
==============================================================================
---
incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g
(original)
+++
incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g
Tue Dec 4 07:58:46 2012
@@ -218,7 +218,7 @@ scope
if (simpleSelectorStack.isEmpty())
combinator = null;
else
- combinator = new CSSCombinator(simpleSelectorStack.peek(),
CombinatorType.DESCENDANT);
+ combinator = new CSSCombinator(simpleSelectorStack.peek(),
CombinatorType.DESCENDANT, $start, tokenStream);
}
@after
{