package lux.xquery;

import lux.compiler.ExpressionVisitor;
import lux.xpath.AbstractExpression;

public class CommentConstructor extends AbstractExpression {

    private final AbstractExpression content;
    
    public CommentConstructor (AbstractExpression abstractExpression) {
        super (Type.COMMENT);
        this.content = abstractExpression;
        this.subs = new AbstractExpression[0];
    }
    
    public AbstractExpression accept(ExpressionVisitor visitor) {
        return visitor.visit(this);
    }

    @Override
    public void toString(StringBuilder buf) {
        buf.append("comment { ");
        content.toString(buf);
        buf.append(" }");
    }

    @Override
    public int getPrecedence () {
        return 0;
    }

}

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

@@ -157,59 +157,8 @@
  %7B%0A%0A
-    private final AbstractExpression content;%0A    %0A
     
@@ -272,19 +272,20 @@
 his.
-content = a
+subs = new A
 bstr
@@ -301,35 +301,14 @@
 sion
-;%0A        this.subs = new A
+%5B%5D %7B a
 bstr
@@ -324,11 +324,10 @@
 sion
-%5B0%5D
+ %7D
 ;%0A  
@@ -550,15 +550,15 @@
     
-content
+subs%5B0%5D
 .toS

use subs for content, rather than a special member variable