//
//  ASTNode+Validation.swift
//  Lioness
//
//  Created by Louis D'hauwe on 17/11/2016.
//  Copyright © 2016 Silver Fox. All rights reserved.
//

import Foundation

extension ASTNode {
	
	var isValidConditionNode: Bool {
		
		if self is BinaryOpNode || self is VariableNode || self is InternalVariableNode || self is BooleanNode || self is CallNode {
			return true
		}
		
		return false
	}
	
}

extension ASTNode {
	
	var isValidBinaryOpNode: Bool {
		
		if self is BinaryOpNode || self is NumberNode || self is VariableNode || self is InternalVariableNode || self is BooleanNode || self is CallNode {
			return true
		}
		
		return false
	}
	
}

//
//  ASTNode+Validation.swift
//  Lioness
//
//  Created by Louis D'hauwe on 17/11/2016.
//  Copyright © 2016 Silver Fox. All rights reserved.
//

import Foundation

extension ASTNode {
	
	var isValidConditionNode: Bool {
		
		if self is BinaryOpNode || self is VariableNode || self is InternalVariableNode || self is BooleanNode {
			return true
		}
		
		return false
	}
	
}

extension ASTNode {
	
	var isValidBinaryOpNode: Bool {
		
		if self is BinaryOpNode || self is NumberNode || self is VariableNode || self is InternalVariableNode || self is BooleanNode {
			return true
		}
		
		return false
	}
	
}

--- 
+++ 
@@ -12,7 +12,7 @@
 	
 	var isValidConditionNode: Bool {
 		
-		if self is BinaryOpNode || self is VariableNode || self is InternalVariableNode || self is BooleanNode {
+		if self is BinaryOpNode || self is VariableNode || self is InternalVariableNode || self is BooleanNode || self is CallNode {
 			return true
 		}
 		
@@ -25,7 +25,7 @@
 	
 	var isValidBinaryOpNode: Bool {
 		
-		if self is BinaryOpNode || self is NumberNode || self is VariableNode || self is InternalVariableNode || self is BooleanNode {
+		if self is BinaryOpNode || self is NumberNode || self is VariableNode || self is InternalVariableNode || self is BooleanNode || self is CallNode {
 			return true
 		}
 		
Allow call nodes for binary operations and conditions
