package net.zero918nobita.Xemime.ast;

import net.zero918nobita.Xemime.entity.Int;
import net.zero918nobita.Xemime.entity.Range;

/**
 * 範囲式を表すノードです。
 * @author Kodai Matsumoto
 */

public class RangeExprNode extends Node {
    private Node left;
    private Node right;
    private boolean hasMaxElement;

    public RangeExprNode(int location, Node left, Node right, boolean hasMaxElement) {
        super(location);
        this.left = left;
        this.right = right;
        this.hasMaxElement = hasMaxElement;
    }

    @Override
    public Node run() throws Exception {
        if (!(left instanceof Int)) throw new FatalException(left.getLocation(), 42);
        if (!(right instanceof Int)) throw new FatalException(right.getLocation(), 43);
        Int l = (Int) left.run();
        Int r = (Int) right.run();
        return new Range(getLocation(), l, r, hasMaxElement);
    }
}

@@ -572,16 +572,75 @@
 ption %7B%0A
+        Node l = left.run();%0A        Node r = right.run();%0A
         
@@ -646,19 +646,16 @@
  if (!(l
-eft
  instanc
@@ -729,20 +729,16 @@
  if (!(r
-ight
  instanc
@@ -802,77 +802,8 @@
 3);%0A
-        Int l = (Int) left.run();%0A        Int r = (Int) right.run();%0A
     
@@ -842,10 +842,22 @@
 (), 
-l,
+(Int) l, (Int)
  r, 

Fix typo