plcopen/pou_variables.ysl2
changeset 1945 90bf6bd94b94
parent 1943 9dc0e38552b2
child 1946 95fa4e05e30f
--- a/plcopen/pou_variables.ysl2	Sun Feb 18 21:30:48 2018 +0100
+++ b/plcopen/pou_variables.ysl2	Sun Feb 18 21:51:33 2018 +0100
@@ -16,6 +16,8 @@
     variable "stdlib", "ns:GetStdLibs()";
 
     variable "extensions", "ns:GetExtensions()";
+
+    variable "all", "$project | $stdlib | $extensions";
     
     function "add_root" {
         param "class";
@@ -171,7 +173,7 @@
     template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_class" {
         param "default_class";
         variable "type_name", "@name";
-        variable "pou_infos", "($project|$stdlib|$extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]";
+        variable "pou_infos", "$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name]";
         choose {
             when "$pou_infos" {
                 apply "$pou_infos", mode="var_class";
@@ -218,7 +220,7 @@
     
     template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_edit" {
         variable "type_name", "@name";
-        variable "pou_infos", "$project/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]";
+        variable "pou_infos", "$project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]";
         choose {
             when "$pou_infos" > true
             otherwise > false
@@ -235,9 +237,12 @@
     
     template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_debug" {
         variable "type_name", "@name";
-        variable "datatype_infos", "($project|$stdlib|$extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]";
+        variable "datatype_infos", """
+            $project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
+            $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]
+        """;
         choose {
-            when "$datatype_infos != ''" {
+            when "$datatype_infos" {
                 apply "$datatype_infos", mode="var_debug";
             }
             otherwise > false