From: ian Date: Sat, 31 Jan 2004 19:57:36 +0000 (+0000) Subject: test "part"; part A is optional X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=676a956a56784de975f8643fc54e999634a6b762;p=trains.git test "part"; part A is optional --- diff --git a/layout/informat.txt b/layout/informat.txt index a64674e..7c8352f 100644 --- a/layout/informat.txt +++ b/layout/informat.txt @@ -61,7 +61,7 @@ Commands * showlibrary lists only parts, not objects * the -e and -E command line options distinguish parts and objects - part N [-]O [F A] [FR AR ...] + part N [-]O [F [A]] [FR AR ...] obj[flip] O A F [P] Places an instance of object or part O. The loc defined inside O as F (`formal parameter', F must be just ) is placed at @@ -83,7 +83,8 @@ Commands specifies that the loc FR inside O is exported into the global namespace as a new loc AR. Either FR or AR may start with `-'. Also, each loc L inside O is exported into the global namespace as a - new loc N_L (unless N_L already exists). + new loc N_L (unless N_L already exists). If A is not specified then + N_F is used. For `obj[flip]' if prefix P (syntax is that of an identifier) is specified, each other loc L inside O is exported into the global diff --git a/layout/layout b/layout/layout index 342b73a..d2da8c4 100755 --- a/layout/layout +++ b/layout/layout @@ -712,7 +712,10 @@ sub cmd__obj ($) { $obj_id= can(\&cva_idstr); if (defined $part_name) { $formal_id= can(\&cva_idstr); - $actual= can(\&cva_idex); + $actual= cano(\&cva_idex, undef); + if (!defined $actual) { + $actual= cva_idex("${part_name}_${formal_id}"); + } } else { $actual= can(\&cva_idex); $formal_id= can(\&cva_idstr); @@ -966,6 +969,7 @@ while (<>) { @al= split /\s+/, $_; next unless @al; print DEBUG "=== @al\n"; + last if $al[0] eq 'eof'; push @{ $ctx->{CmdLog} }, [ @al ] if exists $ctx->{CmdLog}; cmd__one(); } diff --git a/layout/ours.m4 b/layout/ours.m4 index c4a8964..b0c053d 100644 --- a/layout/ours.m4 +++ b/layout/ours.m4 @@ -1,7 +1,7 @@ include(`parts.i4') abs midx_m 830 500 90 -obj cross_peco_l midx_m m midx_ +part midx cross_peco_l m abs dem_tljp_m 200 200 0 obj pt_peco_mr dem_tljp_m c dem_tljp_