Annotation of parser3/tests/129.html, revision 1.4

1.3       misha       1: @main[]
1.2       paf         2: $table[^table::create{group    name
                      3: first  a
                      4: first  b
                      5: second c
                      6: third  d
                      7: third  e
                      8: }]
1.3       misha       9: 
                     10: 
1.4     ! misha      11: ^do[unique key, no value columns, no options]{
        !            12:        ^table.hash[name]
        !            13: }
        !            14: 
        !            15: 
        !            16: ^do[non-unique key, no value columns, no options]{
        !            17:        ^table.hash[group]
        !            18: }[if key not unique ^$.distinct(1) must be specified]
        !            19: 
        !            20: 
        !            21: ^do[non-unique key, no value columns, options: ^$.distinct[tables] (backward)]{
        !            22:        ^table.hash[group][
        !            23:                $.distinct[tables]
        !            24:        ]
        !            25: }
        !            26: 
        !            27: 
        !            28: ^do[non-unique key, no value columns, options: ^$.distinct[tables], ^$.type[hash] ]{
        !            29:        ^table.hash[group][
        !            30:                $.distinct[tables]
        !            31:                $.type[hash]
        !            32:        ]
        !            33: }[^$.distinct[tables] and ^$.type[...] can't be specified together]
        !            34: 
        !            35: 
        !            36: ^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[table]]{
        !            37:        ^table.hash[group][
        !            38:                $.distinct(1)
        !            39:                $.type[table]
        !            40:        ]
        !            41: }
        !            42: 
        !            43: 
        !            44: ^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[table]]{
        !            45:        ^table.hash[group][
        !            46:                $.type[table]
        !            47:        ]
        !            48: }[non unique key without distinct option]
        !            49: 
        !            50: 
        !            51: ^do[unique key, no value columns, options: ^$.type[table]]{
        !            52:        ^table.hash[name][
        !            53:                $.type[table]
        !            54:        ]
        !            55: }
        !            56: 
        !            57: 
        !            58: ^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[hash]]{
        !            59:        ^table.hash[group][
        !            60:                $.distinct(1)
        !            61:                $.type[hash]
        !            62:        ]
        !            63: }
        !            64: 
        !            65: 
        !            66: ^do[non-unique key, no value columns, options: ^$.distinct(1) (as above because ^$.type[hash] == default)]{
        !            67:        ^table.hash[group][
        !            68:                $.distinct(1)
        !            69:        ]
        !            70: }
        !            71: 
        !            72: 
        !            73: ^do[non-unique key, no value columns, options: ^$.distinct(1) ^$.type[string]]{
        !            74:        ^table.hash[group][
        !            75:                $.distinct(1)
        !            76:                $.type[string]
        !            77:        ]
        !            78: }[with ^$.type[string] only one field must be specified]
1.3       misha      79: 
                     80: 
1.4     ! misha      81: ^do[non-unique key, one value column (name), options: ^$.distinct(1) ^$.type[string]]{
        !            82:        ^table.hash[group;name][
1.3       misha      83:                $.distinct(1)
                     84:                $.type[string]
1.4     ! misha      85:        ]
        !            86: }
        !            87: 
        !            88: 
        !            89: 
        !            90: 
        !            91: @do[sTitle;jCode;sExceptionComment][h]
        !            92: <h3>$sTitle</h3>
        !            93: ^try{
        !            94:        $h[$jCode]
        !            95:        ^print[$h]
1.3       misha      96: }{
1.4     ! misha      97:        ^if($exception.type eq "parser.runtime"){
1.3       misha      98:                $exception.handled(1)
1.4     ! misha      99:                ^if(def $sExceptionComment){
        !           100:                        failed, that's OK.<br />
        !           101:                        $sExceptionComment
        !           102:                }{
        !           103:                        something wrong
        !           104:                }
1.3       misha     105:        }
                    106: }
                    107: 
                    108: 
                    109: 
                    110: @print[hData][sKey;value]
                    111: ^hData.foreach[sKey;value]{
                    112:        $sKey ^if($value is "table"){^value.menu{$value.name}[,]}{^if($value is "string"){$value}{^if($value is "hash"){<blockquote>^print[$value]</blockquote>}}}<br />
1.4     ! misha     113: }

E-mail: