瀏覽代碼

Merge pull request #292 from Yakindu/issue-291

#291: Ensure check code is effectively Boolean.
Alexander Nyßen 9 年之前
父節點
當前提交
1761134ba5
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/FlowCode.xtend

+ 2 - 2
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/FlowCode.xtend

@@ -121,10 +121,10 @@ class FlowCode {
 	'''	
 
 	def dispatch CharSequence code(Check it) 
-		'''«IF condition != null»«condition.code»«ELSE»bool_true«ENDIF»'''
+		'''«IF condition != null»(«condition.code») ? bool_true : bool_false«ELSE»bool_true«ENDIF»'''
 	
 	def dispatch CharSequence code(CheckRef it) 
-		'''«IF check != null»«check.shortName»(«scHandle»)«ELSE»bool_true«ENDIF»'''
+		'''«IF check != null»(«check.shortName»(«scHandle»)) ? bool_true : bool_false«ELSE»bool_true«ENDIF»'''
 
 	def dispatch CharSequence code(If it) '''
 		«stepComment»