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

1.5     ! misha       1: @main[]
        !             2: $table[^table::create{group    name
        !             3: first  a
        !             4: first  b
        !             5: second c
        !             6: third  d
        !             7: third  e
        !             8: }]
        !             9: 
        !            10: 
        !            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]
        !            79: 
        !            80: 
        !            81: ^do[non-unique key, one value column (name), options: ^$.distinct(1) ^$.type[string]]{
        !            82:        ^table.hash[group;name][
        !            83:                $.distinct(1)
        !            84:                $.type[string]
        !            85:        ]
        !            86: }
        !            87: 
        !            88: 
        !            89: 
        !            90: 
        !            91: @do[sTitle;jCode;sExceptionComment][h]
        !            92: <h3>$sTitle</h3>
        !            93: ^try{
        !            94:        $h[$jCode]
        !            95:        ^print[$h]
        !            96: }{
        !            97:        ^if($exception.type eq "parser.runtime"){
        !            98:                $exception.handled(1)
        !            99:                ^if(def $sExceptionComment){
        !           100:                        failed, that's OK.<br />
        !           101:                        $sExceptionComment
        !           102:                }{
        !           103:                        something wrong
        !           104:                }
        !           105:        }
        !           106: }
        !           107: 
        !           108: 
        !           109: 
        !           110: @print[h][t;v]
        !           111: $t[^h._keys[]]
        !           112: ^t.sort{$t.key}
        !           113: ^t.menu{
        !           114:        $v[$h.[$t.key]]
        !           115:        $t.key ^if($v is "table"){^v.menu{$v.name}[,]}{^if($v is "string"){$v}{^if($v is "hash"){<blockquote>^print[$v]</blockquote>}}}<br />
        !           116: }

E-mail: