This is an automated email from the ASF dual-hosted git repository.

radu pushed a commit to branch issue/SLING-7681
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-compiler-java.git


The following commit(s) were added to refs/heads/issue/SLING-7681 by this push:
     new 48d8003  SLING-7701 - [HTL] Add support for negative numbers
48d8003 is described below

commit 48d8003a8aa6eb43153e4ab7ed0f239ea9a7e306
Author: Radu Cotescu <r...@apache.org>
AuthorDate: Tue Jun 12 11:42:47 2018 +0200

    SLING-7701 - [HTL] Add support for negative numbers
    
    * made sure numerical operators add a space before negative numbers
    * added spaces between all other binary operators and the operands
---
 .../scripting/sightly/java/compiler/impl/operator/ComparisonOpGen.java  | 2 +-
 .../scripting/sightly/java/compiler/impl/operator/ConcatenateOpGen.java | 2 +-
 .../scripting/sightly/java/compiler/impl/operator/EquivalenceOpGen.java | 2 +-
 .../scripting/sightly/java/compiler/impl/operator/LogicalOpGen.java     | 2 +-
 .../scripting/sightly/java/compiler/impl/operator/NumericOpGen.java     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/ComparisonOpGen.java
 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/ComparisonOpGen.java
index 9590c6e..96b626f 100644
--- 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/ComparisonOpGen.java
+++ 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/ComparisonOpGen.java
@@ -80,7 +80,7 @@ public class ComparisonOpGen implements BinaryOpGen {
     private void generateWithOperator(JavaSource source, SideEffectVisitor 
visitor,
                                       ExpressionNode leftNode, ExpressionNode 
rightNode) {
         leftNode.accept(visitor);
-        source.append(javaOperator);
+        source.append(" ").append(javaOperator).append(" ");
         rightNode.accept(visitor);
     }
 
diff --git 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/ConcatenateOpGen.java
 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/ConcatenateOpGen.java
index 0470037..1a20a50 100644
--- 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/ConcatenateOpGen.java
+++ 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/ConcatenateOpGen.java
@@ -40,7 +40,7 @@ public final class ConcatenateOpGen implements BinaryOpGen {
     @Override
     public void generate(JavaSource source, ExpressionTranslator visitor, 
TypedNode left, TypedNode right) {
         GenHelper.typeCoercion(source, visitor, left, Type.STRING);
-        source.append("+");
+        source.append(" + ");
         GenHelper.typeCoercion(source, visitor, right, Type.STRING);
     }
 }
diff --git 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/EquivalenceOpGen.java
 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/EquivalenceOpGen.java
index 33aa34d..4a6d79b 100644
--- 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/EquivalenceOpGen.java
+++ 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/EquivalenceOpGen.java
@@ -77,7 +77,7 @@ public class EquivalenceOpGen implements BinaryOpGen {
 
     private void generateEqualsOperator(JavaSource source, SideEffectVisitor 
visitor, ExpressionNode leftNode, ExpressionNode rightNode) {
         leftNode.accept(visitor);
-        source.append(operator());
+        source.append(" ").append(operator()).append(" ");
         rightNode.accept(visitor);
     }
 
diff --git 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/LogicalOpGen.java
 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/LogicalOpGen.java
index 328175b..6613b6b 100644
--- 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/LogicalOpGen.java
+++ 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/LogicalOpGen.java
@@ -72,7 +72,7 @@ public abstract class LogicalOpGen implements BinaryOpGen {
     private void generateWithOperator(JavaSource source, SideEffectVisitor 
visitor,
                                       ExpressionNode leftNode, ExpressionNode 
rightNode) {
         leftNode.accept(visitor);
-        source.append(javaOperator);
+        source.append(" ").append(javaOperator).append(" ");
         rightNode.accept(visitor);
     }
 }
diff --git 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/NumericOpGen.java
 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/NumericOpGen.java
index 120b2b2..be3dc7e 100644
--- 
a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/NumericOpGen.java
+++ 
b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/operator/NumericOpGen.java
@@ -42,7 +42,7 @@ public class NumericOpGen implements BinaryOpGen {
     public void generate(JavaSource source, ExpressionTranslator visitor, 
TypedNode left, TypedNode right) {
         Type commonType = commonType(left.getType(), right.getType());
         GenHelper.typeCoercion(source, visitor, left, commonType);
-        source.append(javaOperator);
+        source.append(" ").append(javaOperator).append(" ");
         GenHelper.typeCoercion(source, visitor, right, commonType);
     }
 

-- 
To stop receiving notification emails like this one, please contact
r...@apache.org.

Reply via email to