Browse Source

regenerated after short-circuit fix

stepan-mitkin 3 years ago
parent
commit
bc3fdc8b5d

+ 1 - 1
generators/AutoHotkey_L.tcl

@@ -8,7 +8,7 @@ Break Continue Exit ExitApp Gosub Goto If Else IfEqual IfExist IfGreater IfGreat
 HKEY_LOCAL_MACHINE HKEY_USERS HKEY_CURRENT_USER HKEY_CLASSES_ROOT HKEY_CURRENT_CONFIG HKLM HKU HKCU HKCR HKCC REG_SZ REG_EXPAND_SZ REG_MULTI_SZ REG_DWORD REG_BINARY
 }
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc assign { variable value } {
     #item 1398

+ 1 - 1
generators/c.tcl

@@ -37,7 +37,7 @@ volatile
 while 
 }
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc assign { variable value } {
     #item 578

+ 42 - 92
generators/cpp.tcl

@@ -92,7 +92,7 @@ xor
 xor_eq 
 }
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc al { text } {
     #item 2749
@@ -857,15 +857,10 @@ proc classify_keywords { keywords name } {
         }
     }
     #item 1212
-    if {$inline} {
-        #item 1213
-        if {$abstract} {
-            #item 1216
-            lappend errors \
-            "$name: both inline and abstract is not allowed"
-        } else {
-            
-        }
+    if {($inline) && ($abstract)} {
+        #item 1216
+        lappend errors \
+        "$name: both inline and abstract is not allowed"
     } else {
         
     }
@@ -901,17 +896,12 @@ proc classify_keywords { keywords name } {
             set access "static"
         }
         #item 703
-        if {$dispatch == "normal"} {
+        if {($dispatch == "normal") || ($dispatch == "static")} {
             
         } else {
-            #item 698
-            if {$dispatch == "static"} {
-                
-            } else {
-                #item 704
-                lappend errors \
-                "$name: wrong dispatch: $dispatch"
-            }
+            #item 704
+            lappend errors \
+            "$name: wrong dispatch: $dispatch"
         }
         #item 716
         if {$abstract} {
@@ -1358,7 +1348,7 @@ proc extract_signature { text name } {
                     incr i
                 }
                 #item 834
-                if {$type == "ctr"} {
+                if {($type == "ctr") || ($type == "dtr")} {
                     #item 838
                     if {$returns == ""} {
                         
@@ -1368,24 +1358,12 @@ proc extract_signature { text name } {
                         "$name: constructors and destructors must not have return type"
                     }
                 } else {
-                    #item 835
-                    if {$type == "dtr"} {
-                        #item 838
-                        if {$returns == ""} {
-                            
-                        } else {
-                            #item 839
-                            set error_message \
-                            "$name: constructors and destructors must not have return type"
-                        }
+                    #item 842
+                    if {$returns == ""} {
+                        #item 845
+                        set returns "void"
                     } else {
-                        #item 842
-                        if {$returns == ""} {
-                            #item 845
-                            set returns "void"
-                        } else {
-                            
-                        }
+                        
                     }
                 }
             } else {
@@ -1441,7 +1419,7 @@ proc extract_signature { text name } {
                             incr i
                         }
                         #item 834
-                        if {$type == "ctr"} {
+                        if {($type == "ctr") || ($type == "dtr")} {
                             #item 838
                             if {$returns == ""} {
                                 
@@ -1451,24 +1429,12 @@ proc extract_signature { text name } {
                                 "$name: constructors and destructors must not have return type"
                             }
                         } else {
-                            #item 835
-                            if {$type == "dtr"} {
-                                #item 838
-                                if {$returns == ""} {
-                                    
-                                } else {
-                                    #item 839
-                                    set error_message \
-                                    "$name: constructors and destructors must not have return type"
-                                }
+                            #item 842
+                            if {$returns == ""} {
+                                #item 845
+                                set returns "void"
                             } else {
-                                #item 842
-                                if {$returns == ""} {
-                                    #item 845
-                                    set returns "void"
-                                } else {
-                                    
-                                }
+                                
                             }
                         }
                     } else {
@@ -1483,15 +1449,10 @@ proc extract_signature { text name } {
         }
     }
     #item 846
-    if {$type == "dtr"} {
-        #item 847
-        if {[ llength $parameters ] > 0} {
-            #item 850
-            set error_message \
-            "$name: destructor cannot have parameters"
-        } else {
-            
-        }
+    if {($type == "dtr") && ([ llength $parameters ] > 0)} {
+        #item 850
+        set error_message \
+        "$name: destructor cannot have parameters"
     } else {
         
     }
@@ -2262,20 +2223,18 @@ proc isolate_branch { gdb branches branch name } {
     
         } elseif {$_next_item_ == 1828} {
             if {$next == $first_header} {
-                set _next_item_ 1832
+                #item 1832
+                set msg "Diagram $name: cannot jump to the first branch "
+                append msg "of state machine."
+                #item 1833
+                error $msg
+                set _next_item_ 1984
             } else {
                 #item 1841
                 set type [ gen::p.vertex_type $gdb $next ]
                 set _next_item_ 18420001
             }
     
-        } elseif {$_next_item_ == 1832} {
-            set msg "Diagram $name: cannot jump to the first branch "
-            append msg "of state machine."
-            #item 1833
-            error $msg
-            set _next_item_ 1984
-    
         } elseif {$_next_item_ == 18420001} {
             if {$type == "beginend"} {
                 set _next_item_ 1850
@@ -3142,7 +3101,9 @@ proc parse_globals { section } {
                 incr i
                 set _next_item_ 25000001
             } else {
-                set _next_item_ 2480
+                #item 2480
+                error "Unexpected end after $header"
+                set _next_item_ 2516
             }
     
         } elseif {$_next_item_ == 25000001} {
@@ -3159,7 +3120,9 @@ proc parse_globals { section } {
                 incr i
                 set _next_item_ 25090001
             } else {
-                set _next_item_ 2466
+                #item 2466
+                error "Unexpected end of block after $header"
+                set _next_item_ 2516
             }
     
         } elseif {$_next_item_ == 25090001} {
@@ -3184,10 +3147,6 @@ proc parse_globals { section } {
                 set _next_item_ 2463
             }
     
-        } elseif {$_next_item_ == 2466} {
-            error "Unexpected end of block after $header"
-            set _next_item_ 2516
-    
         } elseif {$_next_item_ == 25000002} {
             if {$current == "\}"} {
                 #item 2507
@@ -3200,10 +3159,6 @@ proc parse_globals { section } {
                 set _next_item_ 2516
             }
     
-        } elseif {$_next_item_ == 2480} {
-            error "Unexpected end after $header"
-            set _next_item_ 2516
-    
         } elseif {$_next_item_ == 2516} {
             return $result
     
@@ -3994,18 +3949,13 @@ proc returns_void { gdb diagram_id } {
     #item 1395
     set trimmed [ string trim $last ]
     #item 1397
-    if {$trimmed == "returns void"} {
+    if {($trimmed == "returns void") || (!([ string match "returns *" $trimmed ]))} {
         
     } else {
-        #item 1380
-        if {[ string match "returns *" $trimmed ]} {
-            #item 1427
-            set name [ diagram_name $gdb $diagram_id ]
-            #item 1384
-            error "Diagram $name is a state machine and must not return values."
-        } else {
-            
-        }
+        #item 1427
+        set name [ diagram_name $gdb $diagram_id ]
+        #item 1384
+        error "Diagram $name is a state machine and must not return values."
     }
 }
 

+ 1 - 1
generators/cs.tcl

@@ -112,7 +112,7 @@ yield
 
 }
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc add_handlers { gdb machines functions } {
     #item 1580

+ 1 - 1
generators/cycle_body.tcl

@@ -12,7 +12,7 @@ variable cont ""
 variable return_none ""
 variable block_close ""
 variable comment ""
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc generate_body { gdb diagram_id start_item node_list items incoming callbacks } {
     #item 76

+ 1 - 1
generators/java.tcl

@@ -16,7 +16,7 @@ abstract    continue  for           new            switch
     true false null
 }
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc assign { variable value } {
     #item 572

+ 3 - 9
generators/lua.tcl

@@ -12,7 +12,7 @@ and       break     do        else      elseif
     while
 }
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc append_sm_names { gdb } {
     #item 1852
@@ -152,14 +152,8 @@ proc extract_signature { text name } {
                 #item 1851
                 set left [ lindex $current 0 ]
                 #item 1856
-                if {$is_handler} {
-                    #item 1846
-                    if {($left == "private") || ($left == "state machine")} {
-                        
-                    } else {
-                        #item 45
-                        lappend parameters $current
-                    }
+                if {($is_handler) && (($left == "private") || ($left == "state machine"))} {
+                    
                 } else {
                     #item 45
                     lappend parameters $current

+ 6 - 24
generators/machine.tcl

@@ -7,7 +7,7 @@ set g_last_used 0
 variable g_visited
 array set g_visited {}
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc add_change_state { gdb new_diagram vertex_id last end callbacks prev_new } {
     #item 778
@@ -892,30 +892,12 @@ proc is_receive { gdb vertex_id } {
     	from vertices
     	where vertex_id = :vertex_id } ] type text
     #item 214
-    if {$type == "action"} {
-        #item 217
-        if {$text == "receive"} {
-            #item 218
-            return 1
-        } else {
-            #item 219
-            return 0
-        }
+    if {(($type == "action") || ($type == "select")) && ($text == "receive")} {
+        #item 218
+        return 1
     } else {
-        #item 220
-        if {$type == "select"} {
-            #item 217
-            if {$text == "receive"} {
-                #item 218
-                return 1
-            } else {
-                #item 219
-                return 0
-            }
-        } else {
-            #item 219
-            return 0
-        }
+        #item 219
+        return 0
     }
 }
 

+ 1 - 1
generators/node_sorter.tcl

@@ -25,7 +25,7 @@ set init_sql {
 	create unique index link_by_src_ord on links(src, ordinal);
 }
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc add_incoming { node_id } {
     #item 67

+ 9 - 41
generators/nogoto.tcl

@@ -6,7 +6,7 @@ array set debug_paths {}
 variable structures_built 0
 variable g_stack {}
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc after_others { order nodes current } {
     #item 39730001
@@ -582,7 +582,7 @@ proc gen_if { db item_id parent_loop } {
     #item 4207
     set loop_id [ get_node_loop_id $db $item_id ]
     #item 4208
-    if {$loop_id == {}} {
+    if {($loop_id == {}) || ($parent_loop == $loop_id)} {
         #item 3859
         set result [ list "if" $item_id ]
         #item 3860
@@ -612,45 +612,13 @@ proc gen_if { db item_id parent_loop } {
             return [ list $result $next ]
         }
     } else {
-        #item 4211
-        if {$parent_loop == $loop_id} {
-            #item 3859
-            set result [ list "if" $item_id ]
-            #item 3860
-            lassign \
-            [ generate_if_seq $db $next0 $if_stop $loop_break $parent_loop ] \
-            then_block after_then
-            #item 3861
-            lassign \
-            [ generate_if_seq $db $next1 $if_stop $loop_break $parent_loop ] \
-            else_block after_else
-            #item 4202
-            if {($then_block == {}) || ($else_block == {})} {
-                #item 4206
-                return {}
-            } else {
-                #item 3862
-                lappend result $then_block $else_block
-                #item 3864
-                if {$after_then == ""} {
-                    #item 3867
-                    set next $after_else
-                } else {
-                    #item 3863
-                    set next $after_then
-                }
-                #item 3858
-                return [ list $result $next ]
-            }
-        } else {
-            #item 4212
-            complain [ list \
-             "gen_if" \
-             "if is not inside its loop" \
-             "$item_id, $parent_loop, $loop_id" ]
-            #item 4206
-            return {}
-        }
+        #item 4212
+        complain [ list \
+         "gen_if" \
+         "if is not inside its loop" \
+         "$item_id, $parent_loop, $loop_id" ]
+        #item 4206
+        return {}
     }
 }
 

+ 1 - 1
generators/python.tcl

@@ -15,7 +15,7 @@ continue  finally   is        return
 def       for       lambda    try
 }
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc assign { variable value } {
     #item 572

+ 12 - 42
generators/verilog.tcl

@@ -161,7 +161,7 @@ xnor
 xor
 }
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc build_always_block { name keyword parameters extra_reset body } {
     #item 729
@@ -1283,24 +1283,12 @@ proc get_always_keyword { start_text parameters } {
     set first_line \
     [lindex [ lindex $parameters 0 ] 0]
     #item 688
-    if {$start_text == "always"} {
+    if {(($start_text == "always") || ($start_text == "always_ff")) || ($start_text == "always_comb")} {
         #item 694
         return $start_text
     } else {
-        #item 1705
-        if {$start_text == "always_ff"} {
-            #item 694
-            return $start_text
-        } else {
-            #item 1706
-            if {$start_text == "always_comb"} {
-                #item 694
-                return $start_text
-            } else {
-                #item 695
-                return $first_line
-            }
-        }
+        #item 695
+        return $first_line
     }
 }
 
@@ -1866,18 +1854,12 @@ proc is_always_block { start_text parameters } {
     set first_line_substr \
     [ string range $first_line 0 5 ]
     #item 672
-    if {$start_text_substr == "always"} {
+    if {($start_text_substr == "always") || ($first_line_substr == "always")} {
         #item 678
         return 1
     } else {
-        #item 675
-        if {$first_line_substr == "always"} {
-            #item 678
-            return 1
-        } else {
-            #item 679
-            return 0
-        }
+        #item 679
+        return 0
     }
 }
 
@@ -1892,18 +1874,12 @@ proc is_assign_block { start_text parameters } {
     set first_line \
     [ string trim $first_line ]
     #item 1882
-    if {$start_text == "assign"} {
+    if {($start_text == "assign") || ($first_line == "assign")} {
         #item 1888
         return 1
     } else {
-        #item 1885
-        if {$first_line == "assign"} {
-            #item 1888
-            return 1
-        } else {
-            #item 1889
-            return 0
-        }
+        #item 1889
+        return 0
     }
 }
 
@@ -2248,14 +2224,8 @@ proc p.print_to_file { gdb fhandle functions header parameters inputs outputs in
         puts -nonewline $fhandle \
         "\n${indent}// Outputs\n${indent}$output_signals"
         #item 980
-        if {$input_signals == ""} {
-            #item 983
-            if {$inout_signals == ""} {
-                
-            } else {
-                #item 984
-                puts -nonewline $fhandle ","
-            }
+        if {($input_signals == "") && ($inout_signals == "")} {
+            
         } else {
             #item 984
             puts -nonewline $fhandle ","

+ 7 - 19
scripts/alt_edit.tcl

@@ -32,7 +32,7 @@ array set t_as {}
 
 variable next_shadow_id 0
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc clear { } {
     #item 782
@@ -177,19 +177,13 @@ proc find_allied { shadow_id direction delta allied } {
                 lassign [ get_shadow_by_id $other ] \
                 	oleft otop oright obottom
                 #item 1279
-                if {[ rectangles_on_axis $left $top $right $bottom \
-	$oleft $otop $oright $obottom $axis_or ]} {
+                if {([ rectangles_on_axis $left $top $right $bottom \
+	$oleft $otop $oright $obottom $axis_or ]) || ([ should_also_pull $shadow_id $mytype $other \
+	$direction $delta ])} {
                     #item 1281
                     find_allied $other $direction $delta output
                 } else {
-                    #item 1567
-                    if {[ should_also_pull $shadow_id $mytype $other \
-	$direction $delta ]} {
-                        #item 1281
-                        find_allied $other $direction $delta output
-                    } else {
-                        
-                    }
+                    
                 }
             }
             #item 12720003
@@ -635,17 +629,11 @@ proc shadows_for_direction { shadows direction delta } {
             #item 1209
             set type [ get_shadow_type $shadow_id ]
             #item 1208
-            if {$type == "icon"} {
+            if {($type == "icon") || (!($type == $direction))} {
                 #item 1214
                 lappend result $shadow_id
             } else {
-                #item 1210
-                if {$type == $direction} {
-                    
-                } else {
-                    #item 1214
-                    lappend result $shadow_id
-                }
+                
             }
             #item 12070003
             incr _ind1207

+ 49 - 72
scripts/graph2.tcl

@@ -63,7 +63,7 @@ variable man_vers {}
 
 
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc a.to.head { a } {
     #item 1360
@@ -414,21 +414,16 @@ proc connected.check { } {
         #item 12590004
         set icon_id [ lindex $_col1259 $_ind1259 ]
         #item 1261
-        if {[ man.marked $icon_id ]} {
+        if {([ man.marked $icon_id ]) || ([ man.icon.type $icon_id ] == "commentin")} {
             
         } else {
-            #item 1264
-            if {[ man.icon.type $icon_id ] == "commentin"} {
-                
-            } else {
-                #item 1277
-                set message \
-                [mc2 "All icons must be connected together."]
-                #item 1267
-                report.error {} $message
-                #item 1278
-                return 0
-            }
+            #item 1277
+            set message \
+            [mc2 "All icons must be connected together."]
+            #item 1267
+            report.error {} $message
+            #item 1278
+            return 0
         }
         #item 12590003
         incr _ind1259
@@ -732,21 +727,9 @@ proc extract.manhattan { db diagram_id } {
                 #item 872
                 insert.knots
                 #item 1031
-                if {([check.dangling]) && ([check.on.one.line])} {
-                    #item 1365
-                    if {[mwc::is_drakon $diagram_id]} {
-                        #item 1342
-                        if {[connected.check]} {
-                            #item 1032
-                            export.result $db $diagram_id
-                        } else {
-                            #item 1042
-                            export.errors $diagram_id
-                        }
-                    } else {
-                        #item 1032
-                        export.result $db $diagram_id
-                    }
+                if {(([check.dangling]) && ([check.on.one.line])) && (!(([mwc::is_drakon $diagram_id]) && (!([connected.check]))))} {
+                    #item 1032
+                    export.result $db $diagram_id
                 } else {
                     #item 1042
                     export.errors $diagram_id
@@ -1151,54 +1134,48 @@ proc line.cuts.items { ver_item y hor_items } {
     #item 543
     lassign $ver_item item_id x y1 y2
     #item 544
-    if {$y < $y1} {
+    if {($y < $y1) || ($y > $y2)} {
         #item 548
         return $hor_items
     } else {
-        #item 547
-        if {$y > $y2} {
-            #item 548
-            return $hor_items
-        } else {
-            #item 549
-            set output {}
-            #item 5510001
-            set _col551 $hor_items
-            set _len551 [ llength $_col551 ]
-            set _ind551 0
-            while { 1 } {
-                #item 5510002
-                if {$_ind551 < $_len551} {
-                    
-                } else {
-                    break
-                }
-                #item 5510004
-                set hor_item [ lindex $_col551 $_ind551 ]
-                #item 553
-                lassign \
-                [segment.cut.segment $x $hor_item] \
-                left right
-                #item 554
-                if {$left == {}} {
-                    
-                } else {
-                    #item 557
-                    lappend output $left
-                }
-                #item 558
-                if {$right == {}} {
-                    
-                } else {
-                    #item 561
-                    lappend output $right
-                }
-                #item 5510003
-                incr _ind551
+        #item 549
+        set output {}
+        #item 5510001
+        set _col551 $hor_items
+        set _len551 [ llength $_col551 ]
+        set _ind551 0
+        while { 1 } {
+            #item 5510002
+            if {$_ind551 < $_len551} {
+                
+            } else {
+                break
             }
-            #item 550
-            return $output
+            #item 5510004
+            set hor_item [ lindex $_col551 $_ind551 ]
+            #item 553
+            lassign \
+            [segment.cut.segment $x $hor_item] \
+            left right
+            #item 554
+            if {$left == {}} {
+                
+            } else {
+                #item 557
+                lappend output $left
+            }
+            #item 558
+            if {$right == {}} {
+                
+            } else {
+                #item 561
+                lappend output $right
+            }
+            #item 5510003
+            incr _ind551
         }
+        #item 550
+        return $output
     }
 }
 

+ 1 - 1
scripts/hie_engine.tcl

@@ -12,7 +12,7 @@ array set back {}
 array set names {}
 
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc add.call { caller called } {
     #item 118

+ 4 - 10
structure/struct.tcl

@@ -1,6 +1,6 @@
 namespace eval st {
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc access_decl { field_name user } {
     #item 748
@@ -2038,18 +2038,12 @@ proc field_eq { fname udata } {
         return "${class}_Equal\(left->$fname, right->$fname\)"
     } else {
         #item 1665
-        if {[ is_integral $class ]} {
+        if {([ is_integral $class ]) || ([ is_pointer $class ])} {
             #item 1668
             return "\(left->$fname == right->$fname\)"
         } else {
-            #item 1669
-            if {[ is_pointer $class ]} {
-                #item 1668
-                return "\(left->$fname == right->$fname\)"
-            } else {
-                #item 1673
-                return "\(memcmp\(&left->$fname, &right->$fname, sizeof\($class\)\) == 0\)"
-            }
+            #item 1673
+            return "\(memcmp\(&left->$fname, &right->$fname, sizeof\($class\)\) == 0\)"
         }
     }
 }

+ 63 - 377
structure/tables.tcl

@@ -2,7 +2,7 @@ namespace eval tab {
 
 
 
-# Autogenerated with DRAKON Editor 1.25
+# Autogenerated with DRAKON Editor 1.27
 
 proc actions_and_shelves { } {
     #item 209
@@ -869,18 +869,13 @@ proc check_class_inheritance { class } {
         }
     }
     #item 1912
-    if {$base_link == {}} {
+    if {($base_link == {}) || (!([find_cycles $base_link [ list $class ]]))} {
         
     } else {
-        #item 1915
-        if {[find_cycles $base_link [ list $class ]]} {
-            #item 1919
-            set message "Inheritance cycle detected at class $name."
-            #item 1918
-            report_error_class $name $message
-        } else {
-            
-        }
+        #item 1919
+        set message "Inheritance cycle detected at class $name."
+        #item 1918
+        report_error_class $name $message
     }
 }
 
@@ -915,23 +910,8 @@ proc check_empty_link { id } {
         set src2 [ get_link_src_table $link_id ]
         set dst2 [ get_link_dst_table $link_id ]
         #item 1411
-        if {$type == $type2} {
-            #item 1415
-            if {$own == $own2} {
-                #item 1416
-                if {$src == $src2} {
-                    #item 1417
-                    if {$dst == $dst2} {
-                        break
-                    } else {
-                        
-                    }
-                } else {
-                    
-                }
-            } else {
-                
-            }
+        if {((($type == $type2) && ($own == $own2)) && ($src == $src2)) && ($dst == $dst2)} {
+            break
         } else {
             
         }
@@ -1259,16 +1239,11 @@ proc con_hor_up { edge_id in_con } {
                 set right [ get_vertex_right $vertex1 ]
                 set up [ get_vertex_up $vertex1 ]
                 #item 490
-                if {$right == ""} {
-                    #item 493
-                    if {$up == ""} {
-                        #item 496
-                        report_error_edge \
-                         $edge_id \
-                         "Expected connector up or to the right"
-                    } else {
-                        
-                    }
+                if {($right == "") && ($up == "")} {
+                    #item 496
+                    report_error_edge \
+                     $edge_id \
+                     "Expected connector up or to the right"
                 } else {
                     
                 }
@@ -1445,16 +1420,11 @@ proc con_ver_left { edge_id in_con } {
                 set down [ get_vertex_down $vertex1 ]
                 set left [ get_vertex_left $vertex1 ]
                 #item 709
-                if {$left == ""} {
-                    #item 712
-                    if {$down == ""} {
-                        #item 715
-                        report_error_edge \
-                         $edge_id \
-                         "Expected connector down or to the left"
-                    } else {
-                        
-                    }
+                if {($left == "") && ($down == "")} {
+                    #item 715
+                    report_error_edge \
+                     $edge_id \
+                     "Expected connector down or to the left"
                 } else {
                     
                 }
@@ -1628,24 +1598,19 @@ proc core_can_delete { class } {
             set own [ get_link_ownership $link ]
             set link_type [ get_link_type $link ]
             #item 2610
-            if {$link_type == "paw"} {
-                #item 2462
-                if {$own == "none"} {
-                    #item 2467
-                    set dst [ get_link_dst_table $link ]
-                    #item 2468
-                    set action [ list \
-                     "action" "ensure_deleted" "field" $field \
-                     "class" $dst ]
-                    #item 2466
-                    set check [ list \
-                     "foreach" [ list "field" $field ] \
-                     "do" $action ]
-                    #item 2470
-                    lappend body $check
-                } else {
-                    
-                }
+            if {($link_type == "paw") && ($own == "none")} {
+                #item 2467
+                set dst [ get_link_dst_table $link ]
+                #item 2468
+                set action [ list \
+                 "action" "ensure_deleted" "field" $field \
+                 "class" $dst ]
+                #item 2466
+                set check [ list \
+                 "foreach" [ list "field" $field ] \
+                 "do" $action ]
+                #item 2470
+                lappend body $check
             } else {
                 
             }
@@ -2310,192 +2275,9 @@ proc core_update { field } {
          "proc" "setter" "class" $class \
          "field" $field "args" {}
         #item 1758
-        if {$indexes == {}} {
-            #item 1760
-            if {$type == "data"} {
-                #item 2105
-                lappend head "type" "simple"
-            } else {
-                #item 1771
-                lappend head "type" "complex"
-                set body {}
-                #item 1778
-                lappend body \
-                 [ list "action" "check_self" "class" $class ]
-                #item 2539
-                lappend body \
-                 [ list "action" "check_change" "field" $field ]
-                #item 2543
-                set fields [ get_class_fields $class ]
-                #item 25440001
-                set _col2544 $fields
-                set _len2544 [ llength $_col2544 ]
-                set _ind2544 0
-                while { 1 } {
-                    #item 25440002
-                    if {$_ind2544 < $_len2544} {
-                        
-                    } else {
-                        break
-                    }
-                    #item 25440004
-                    set other [ lindex $_col2544 $_ind2544 ]
-                    #item 2546
-                    if {$other == $field} {
-                        
-                    } else {
-                        #item 2550
-                        set f_indexes [ get_field2_indexes $other ]
-                        #item 2551
-                        if {[indexes_contain_field $f_indexes $field]} {
-                            #item 2549
-                            lappend body \
-                             [ list "action" "fetch_field" "field" $other ]
-                        } else {
-                            
-                        }
-                    }
-                    #item 25440003
-                    incr _ind2544
-                }
-                #item 17790001
-                set _col1779 $indexes
-                set _len1779 [ llength $_col1779 ]
-                set _ind1779 0
-                while { 1 } {
-                    #item 17790002
-                    if {$_ind1779 < $_len1779} {
-                        
-                    } else {
-                        break
-                    }
-                    #item 17790004
-                    set index [ lindex $_col1779 $_ind1779 ]
-                    #item 1793
-                    set ifields [ index_fields $index ]
-                    #item 2552
-                    if {[contains $ifields $field]} {
-                        #item 1792
-                        set old [ remove $ifields $field ]
-                        #item 2106
-                        lappend body \
-                         [ list "action" "index_not_exists" \
-                         "index" $index "fields" $ifields \
-                         "changed" $field ]
-                    } else {
-                        
-                    }
-                    #item 17790003
-                    incr _ind1779
-                }
-                #item 1794
-                if {$link == {}} {
-                    
-                } else {
-                    #item 2606
-                    lappend body \
-                    [ make_foreign_check $field $link "update" ]
-                }
-                #item 1809
-                if {$link == {}} {
-                    
-                } else {
-                    #item 2265
-                    set op [ get_connect_type $field ]
-                    set target [ get_target $link ]
-                    #item 2264
-                    if {$op == ""} {
-                        
-                    } else {
-                        #item 1824
-                        lappend body \
-                         [ list "action" "disconnect_old" \
-                         "op" $op "field" $field \
-                         "link" $link "target" $target ]
-                    }
-                }
-                #item 18250001
-                set _col1825 $indexes
-                set _len1825 [ llength $_col1825 ]
-                set _ind1825 0
-                while { 1 } {
-                    #item 18250002
-                    if {$_ind1825 < $_len1825} {
-                        
-                    } else {
-                        break
-                    }
-                    #item 18250004
-                    set index [ lindex $_col1825 $_ind1825 ]
-                    #item 1828
-                    set ifields [ index_fields $index ]
-                    #item 2555
-                    if {[contains $ifields $field]} {
-                        #item 1827
-                        lappend body \
-                         [ list "action" "remove_from_index_old" \
-                         "index" $index "fields" $ifields \
-                         "old" $field ]
-                    } else {
-                        
-                    }
-                    #item 18250003
-                    incr _ind1825
-                }
-                #item 1829
-                lappend body \
-                 [ list "action" "replace" \
-                 "class" $class "field" $field ]
-                #item 18300001
-                set _col1830 $indexes
-                set _len1830 [ llength $_col1830 ]
-                set _ind1830 0
-                while { 1 } {
-                    #item 18300002
-                    if {$_ind1830 < $_len1830} {
-                        
-                    } else {
-                        break
-                    }
-                    #item 18300004
-                    set index [ lindex $_col1830 $_ind1830 ]
-                    #item 1833
-                    set ifields [ index_fields $index ]
-                    #item 2558
-                    if {[contains $ifields $field]} {
-                        #item 1832
-                        set old [ remove $ifields $field ]
-                        #item 2107
-                        lappend body \
-                         [ list "action" "add_to_index" \
-                         "index" $index "fields" $ifields ]
-                    } else {
-                        
-                    }
-                    #item 18300003
-                    incr _ind1830
-                }
-                #item 1834
-                if {$link == {}} {
-                    
-                } else {
-                    #item 2267
-                    set op [ get_connect_type $field ]
-                    #item 2266
-                    if {$op == ""} {
-                        
-                    } else {
-                        #item 2108
-                        lappend body \
-                         [ list "action" "connect" \
-                         "op" $op \
-                         "field" $field \
-                         "link" $link ]
-                    }
-                }
-                #item 2109
-                lappend head "body" $body
-            }
+        if {($indexes == {}) && ($type == "data")} {
+            #item 2105
+            lappend head "type" "simple"
         } else {
             #item 1771
             lappend head "type" "complex"
@@ -2808,30 +2590,11 @@ proc ensure_no_fields_reuse { class_id field_name edge } {
                 set src_field [ get_link_src_field $link_id ]
                 set dst_field [ get_link_dst_field $link_id ]
                 #item 1170
-                if {$src_table == $class_id} {
-                    #item 1173
-                    if {$src_field == $field_name} {
-                        #item 1180
-                        report_error_edge $edge \
-                         "Field $field_name is already used for another link"
-                        break
-                    } else {
-                        
-                    }
-                } else {
-                    
-                }
-                #item 1176
-                if {$dst_table == $class_id} {
-                    #item 1179
-                    if {$dst_field == $field_name} {
-                        #item 1180
-                        report_error_edge $edge \
-                         "Field $field_name is already used for another link"
-                        break
-                    } else {
-                        
-                    }
+                if {(($src_table == $class_id) && ($src_field == $field_name)) || (($dst_table == $class_id) && ($dst_field == $field_name))} {
+                    #item 1180
+                    report_error_edge $edge \
+                     "Field $field_name is already used for another link"
+                    break
                 } else {
                     
                 }
@@ -2866,30 +2629,11 @@ proc ensure_no_fields_reuse { class_id field_name edge } {
                     set src_field [ get_link_src_field $link_id ]
                     set dst_field [ get_link_dst_field $link_id ]
                     #item 1170
-                    if {$src_table == $class_id} {
-                        #item 1173
-                        if {$src_field == $field_name} {
-                            #item 1180
-                            report_error_edge $edge \
-                             "Field $field_name is already used for another link"
-                            break
-                        } else {
-                            
-                        }
-                    } else {
-                        
-                    }
-                    #item 1176
-                    if {$dst_table == $class_id} {
-                        #item 1179
-                        if {$dst_field == $field_name} {
-                            #item 1180
-                            report_error_edge $edge \
-                             "Field $field_name is already used for another link"
-                            break
-                        } else {
-                            
-                        }
+                    if {(($src_table == $class_id) && ($src_field == $field_name)) || (($dst_table == $class_id) && ($dst_field == $field_name))} {
+                        #item 1180
+                        report_error_edge $edge \
+                         "Field $field_name is already used for another link"
+                        break
                     } else {
                         
                     }
@@ -2922,30 +2666,11 @@ proc ensure_no_fields_reuse { class_id field_name edge } {
                         set src_field [ get_link_src_field $link_id ]
                         set dst_field [ get_link_dst_field $link_id ]
                         #item 1170
-                        if {$src_table == $class_id} {
-                            #item 1173
-                            if {$src_field == $field_name} {
-                                #item 1180
-                                report_error_edge $edge \
-                                 "Field $field_name is already used for another link"
-                                break
-                            } else {
-                                
-                            }
-                        } else {
-                            
-                        }
-                        #item 1176
-                        if {$dst_table == $class_id} {
-                            #item 1179
-                            if {$dst_field == $field_name} {
-                                #item 1180
-                                report_error_edge $edge \
-                                 "Field $field_name is already used for another link"
-                                break
-                            } else {
-                                
-                            }
+                        if {(($src_table == $class_id) && ($src_field == $field_name)) || (($dst_table == $class_id) && ($dst_field == $field_name))} {
+                            #item 1180
+                            report_error_edge $edge \
+                             "Field $field_name is already used for another link"
+                            break
                         } else {
                             
                         }
@@ -3005,16 +2730,11 @@ proc find_base { class } {
         set type [ get_link_type $link ]
         set src [ get_link_src_table $link ]
         #item 1460
-        if {$type == "inheritance"} {
-            #item 2097
-            if {$src == $class} {
-                #item 1463
-                set dst [ get_link_dst_table $link ]
-                #item 1464
-                return $dst
-            } else {
-                
-            }
+        if {($type == "inheritance") && ($src == $class)} {
+            #item 1463
+            set dst [ get_link_dst_table $link ]
+            #item 1464
+            return $dst
         } else {
             
         }
@@ -3882,19 +3602,9 @@ proc is_collection { field_id } {
         set src_field [ get_link_src_field $link ]
         set type [ get_link_type $link ]
         #item 1363
-        if {$type == "paw"} {
-            #item 1366
-            if {$src == $class_id} {
-                #item 1371
-                if {$src_field == $name} {
-                    #item 1370
-                    return 1
-                } else {
-                    
-                }
-            } else {
-                
-            }
+        if {(($type == "paw") && ($src == $class_id)) && ($src_field == $name)} {
+            #item 1370
+            return 1
         } else {
             
         }
@@ -4371,28 +4081,10 @@ proc report_error_class { name message } {
         set text2 [ get_vertex_text2 $vertex ]
         set type [ get_vertex_type $vertex ]
         #item 1902
-        if {$type == "action"} {
-            #item 1905
-            if {$text == $name} {
-                #item 1911
-                report_error_vertex $vertex $message
-                break
-            } else {
-                
-            }
-        } else {
-            
-        }
-        #item 1906
-        if {$type == "shelf"} {
-            #item 1907
-            if {$text2 == "class $name"} {
-                #item 1911
-                report_error_vertex $vertex $message
-                break
-            } else {
-                
-            }
+        if {(($type == "action") && ($text == $name)) || (($type == "shelf") && ($text2 == "class $name"))} {
+            #item 1911
+            report_error_vertex $vertex $message
+            break
         } else {
             
         }
@@ -4556,14 +4248,8 @@ proc select_fields { class field_selector } {
         set type [ get_field2_type $field ]
         set indexes [ get_field2_indexes $field ]
         #item 2077
-        if {($field_selector == "") || (!([ $field_selector $field ]))} {
-            #item 2200
-            if {$indexes == {}} {
-                
-            } else {
-                #item 2080
-                lappend result $field
-            }
+        if {(($field_selector == "") || (!([ $field_selector $field ]))) && ($indexes == {})} {
+            
         } else {
             #item 2080
             lappend result $field

+ 8 - 23
structure/tables_c.tcl

@@ -13,7 +13,7 @@ variable g_direct {
 	
 	
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc add { field this element indent } {
     #item 2309
@@ -2213,15 +2213,10 @@ proc has_arrow { class } {
         set type [ tab::get_link_type $link ]
         set dst  [ tab::get_link_dst_table $link ]
         #item 2214
-        if {$type == "arrow"} {
-            #item 2216
-            if {$dst == $class} {
-                #item 2220
-                set result 1
-                break
-            } else {
-                
-            }
+        if {($type == "arrow") && ($dst == $class)} {
+            #item 2220
+            set result 1
+            break
         } else {
             
         }
@@ -2256,19 +2251,9 @@ proc has_paw { class exp_own for_m2m } {
         #item 2354
         set type2 [ tab::get_field2_type $field ]
         #item 2338
-        if {$own == $exp_own} {
-            #item 2350
-            if {$link_type == "paw"} {
-                #item 2355
-                if {$type2 == "collection"} {
-                    #item 2353
-                    return 1
-                } else {
-                    
-                }
-            } else {
-                
-            }
+        if {(($own == $exp_own) && ($link_type == "paw")) && ($type2 == "collection")} {
+            #item 2353
+            return 1
         } else {
             
         }

+ 5 - 10
structure/tables_cs.tcl

@@ -6,7 +6,7 @@ Guid DateTime TimeSpan decimal Decimal }
 	
 	
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc add { field this element indent } {
     #item 650
@@ -1306,15 +1306,10 @@ proc has_arrow { class } {
         set type [ tab::get_link_type $link ]
         set dst  [ tab::get_link_dst_table $link ]
         #item 1103
-        if {$type == "arrow"} {
-            #item 1105
-            if {$dst == $class} {
-                #item 1109
-                set result 1
-                break
-            } else {
-                
-            }
+        if {($type == "arrow") && ($dst == $class)} {
+            #item 1109
+            set result 1
+            break
         } else {
             
         }

+ 1 - 1
structure/tables_tcl.tcl

@@ -1,6 +1,6 @@
 namespace eval gen_tcl {
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc add { field id element indent } {
     #item 1214

BIN
tmp/bad_type


+ 1 - 1
unittest/algo2.tcl

@@ -1,7 +1,7 @@
 namespace eval algo2 {
 
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc denormalized { condition1 condition2 condition3 } {
     #item 151

+ 9 - 17
unittest/erltest.erl

@@ -1,4 +1,4 @@
-% Autogenerated with DRAKON Editor 1.23
+% Autogenerated with DRAKON Editor 1.27
 
 -module(erltest).
 -export([mult/2, run/0, switch/1]).
@@ -99,26 +99,18 @@ sil_if(X, Y, Z) ->
 .
 
 switch(X) ->
-    % item 800001
-    case X =:= 1 of true -> 
-        % item 90
-        one
-    ; false ->
-        % item 800002
-        case X =:= 2 of true -> 
+    case X of
+        1 ->
+            % item 90
+            one
+        ;
+        2 ->
             % item 91
             two
-        ; false ->
-            % item 800003
-            case X =:= 3 of true -> 
-                []
-            ; false ->
-                % item 800004
-                throw("Unexpected switch value")
-            end,
+        ;
+        3 ->
             % item 92
             three
-        end
     end
 .
 

+ 19 - 43
unittest/nogoto_src.tcl

@@ -1,6 +1,6 @@
 namespace eval nogotot {
 
-# Autogenerated with DRAKON Editor 1.23
+# Autogenerated with DRAKON Editor 1.27
 
 proc AND { left right } {
     #item 398
@@ -80,18 +80,12 @@ proc ComplexContinue { } {
 
 proc ComplexLogic { a b c d e f } {
     #item 420
-    if {(($a) && (!($b))) && ($c)} {
+    if {((($a) && (!($b))) && ($c)) || ((($d) && (!($e))) && ($f))} {
         #item 430
         return 1
     } else {
-        #item 424
-        if {(($d) && (!($e))) && ($f)} {
-            #item 430
-            return 1
-        } else {
-            #item 431
-            return 0
-        }
+        #item 431
+        return 0
     }
 }
 
@@ -541,45 +535,39 @@ proc LoopsIntersect { } {
     while { 1 } {
         if {$_next_item_ == 334} {
             if {$counter > 0} {
-                set _next_item_ 335
+                #item 335
+                incr counter2 100
+                set _next_item_ 318
             } else {
                 #item 333
                 incr counter2
                 set _next_item_ 318
             }
     
-        } elseif {$_next_item_ == 335} {
-            incr counter2 100
-            set _next_item_ 318
-    
         } elseif {$_next_item_ == 318} {
             incr counter
             set _next_item_ 323
     
         } elseif {$_next_item_ == 323} {
             if {$variable > 5} {
-                set _next_item_ 326
+                #item 326
+                incr variable -1
+                set _next_item_ 334
             } else {
                 #item 319
                 incr counter2
                 set _next_item_ 317
             }
     
-        } elseif {$_next_item_ == 326} {
-            incr variable -1
-            set _next_item_ 334
-    
         } elseif {$_next_item_ == 317} {
             if {$variable > 0} {
-                set _next_item_ 329
+                #item 329
+                incr variable -1
+                set _next_item_ 318
             } else {
                 return {}
             }
     
-        } elseif {$_next_item_ == 329} {
-            incr variable -1
-            set _next_item_ 318
-    
         }
     }
 }
@@ -683,35 +671,23 @@ proc NestedLoop { } {
 
 proc OR { left right } {
     #item 372
-    if {$left} {
+    if {($left) || ($right)} {
         #item 378
         return 1
     } else {
-        #item 373
-        if {$right} {
-            #item 378
-            return 1
-        } else {
-            #item 379
-            return 0
-        }
+        #item 379
+        return 0
     }
 }
 
 proc OR_NOT { left right } {
     #item 385
-    if {$left} {
+    if {($left) || (!($right))} {
         #item 391
         return 1
     } else {
-        #item 386
-        if {$right} {
-            #item 392
-            return 0
-        } else {
-            #item 391
-            return 1
-        }
+        #item 392
+        return 0
     }
 }