--- parser3/tests/129.html 2008/05/29 10:02:35 1.4
+++ parser3/tests/129.html 2009/07/08 00:08:18 1.5
@@ -1,113 +1,116 @@
-@main[]
-$table[^table::create{group name
-first a
-first b
-second c
-third d
-third e
-}]
-
-
-^do[unique key, no value columns, no options]{
- ^table.hash[name]
-}
-
-
-^do[non-unique key, no value columns, no options]{
- ^table.hash[group]
-}[if key not unique ^$.distinct(1) must be specified]
-
-
-^do[non-unique key, no value columns, options: ^$.distinct[tables] (backward)]{
- ^table.hash[group][
- $.distinct[tables]
- ]
-}
-
-
-^do[non-unique key, no value columns, options: ^$.distinct[tables], ^$.type[hash] ]{
- ^table.hash[group][
- $.distinct[tables]
- $.type[hash]
- ]
-}[^$.distinct[tables] and ^$.type[...] can't be specified together]
-
-
-^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[table]]{
- ^table.hash[group][
- $.distinct(1)
- $.type[table]
- ]
-}
-
-
-^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[table]]{
- ^table.hash[group][
- $.type[table]
- ]
-}[non unique key without distinct option]
-
-
-^do[unique key, no value columns, options: ^$.type[table]]{
- ^table.hash[name][
- $.type[table]
- ]
-}
-
-
-^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[hash]]{
- ^table.hash[group][
- $.distinct(1)
- $.type[hash]
- ]
-}
-
-
-^do[non-unique key, no value columns, options: ^$.distinct(1) (as above because ^$.type[hash] == default)]{
- ^table.hash[group][
- $.distinct(1)
- ]
-}
-
-
-^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[string]]{
- ^table.hash[group][
- $.distinct(1)
- $.type[string]
- ]
-}[with ^$.type[string] only one field must be specified]
-
-
-^do[non-unique key, one value column (name), options: ^$.distinct(1) ^$.type[string]]{
- ^table.hash[group;name][
- $.distinct(1)
- $.type[string]
- ]
-}
-
-
-
-
-@do[sTitle;jCode;sExceptionComment][h]
-
$sTitle
-^try{
- $h[$jCode]
- ^print[$h]
-}{
- ^if($exception.type eq "parser.runtime"){
- $exception.handled(1)
- ^if(def $sExceptionComment){
- failed, that's OK.
- $sExceptionComment
- }{
- something wrong
- }
- }
-}
-
-
-
-@print[hData][sKey;value]
-^hData.foreach[sKey;value]{
- $sKey ^if($value is "table"){^value.menu{$value.name}[,]}{^if($value is "string"){$value}{^if($value is "hash"){^print[$value]
}}}
-}
+@main[]
+$table[^table::create{group name
+first a
+first b
+second c
+third d
+third e
+}]
+
+
+^do[unique key, no value columns, no options]{
+ ^table.hash[name]
+}
+
+
+^do[non-unique key, no value columns, no options]{
+ ^table.hash[group]
+}[if key not unique ^$.distinct(1) must be specified]
+
+
+^do[non-unique key, no value columns, options: ^$.distinct[tables] (backward)]{
+ ^table.hash[group][
+ $.distinct[tables]
+ ]
+}
+
+
+^do[non-unique key, no value columns, options: ^$.distinct[tables], ^$.type[hash] ]{
+ ^table.hash[group][
+ $.distinct[tables]
+ $.type[hash]
+ ]
+}[^$.distinct[tables] and ^$.type[...] can't be specified together]
+
+
+^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[table]]{
+ ^table.hash[group][
+ $.distinct(1)
+ $.type[table]
+ ]
+}
+
+
+^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[table]]{
+ ^table.hash[group][
+ $.type[table]
+ ]
+}[non unique key without distinct option]
+
+
+^do[unique key, no value columns, options: ^$.type[table]]{
+ ^table.hash[name][
+ $.type[table]
+ ]
+}
+
+
+^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[hash]]{
+ ^table.hash[group][
+ $.distinct(1)
+ $.type[hash]
+ ]
+}
+
+
+^do[non-unique key, no value columns, options: ^$.distinct(1) (as above because ^$.type[hash] == default)]{
+ ^table.hash[group][
+ $.distinct(1)
+ ]
+}
+
+
+^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[string]]{
+ ^table.hash[group][
+ $.distinct(1)
+ $.type[string]
+ ]
+}[with ^$.type[string] only one field must be specified]
+
+
+^do[non-unique key, one value column (name), options: ^$.distinct(1) ^$.type[string]]{
+ ^table.hash[group;name][
+ $.distinct(1)
+ $.type[string]
+ ]
+}
+
+
+
+
+@do[sTitle;jCode;sExceptionComment][h]
+$sTitle
+^try{
+ $h[$jCode]
+ ^print[$h]
+}{
+ ^if($exception.type eq "parser.runtime"){
+ $exception.handled(1)
+ ^if(def $sExceptionComment){
+ failed, that's OK.
+ $sExceptionComment
+ }{
+ something wrong
+ }
+ }
+}
+
+
+
+@print[h][t;v]
+$t[^h._keys[]]
+^t.sort{$t.key}
+^t.menu{
+ $v[$h.[$t.key]]
+ $t.key ^if($v is "table"){^v.menu{$v.name}[,]}{^if($v is "string"){$v}{^if($v is "hash"){^print[$v]
}}}
+}