Annotation of parser3/tests/059.html, revision 1.3
1.2 paf 1: @main[]
1.3 ! misha 2: ...^oneOf[a;a,b,c]...<br />
! 3: ...^oneOf[a;ax,b,c]...<br />
! 4: ...^oneWord[Word]...<br />
! 5: ...^oneWord[wo rd]...<br />
1.2 paf 6:
7:
8: @oneOf[s;list][t] выдаёт строку, если строка она есть в списке(разделенном запятыми)
9: $t[^list.lsplit[,]]
1.3 ! misha 10: ^try{
! 11: ^if(!^t.locate[piece;$s]){
! 12: ^throw[user;$s;unknown]
! 13: }
! 14: $result[$s]
! 15: }{
! 16: ^if($exception.type eq "user"){
! 17: $exception.handled(1)
! 18: $result['$s' not in list '$list']
! 19: }
! 20: }
! 21:
1.2 paf 22:
23: @oneWord[s]
1.3 ! misha 24: ^try{
! 25: ^if(^s.match[\W]){
! 26: ^throw[user;$s;not word]
! 27: }
! 28: $result[$s]
! 29: }{
! 30: ^if($exception.type eq "user"){
! 31: $exception.handled(1)
! 32: $result['$s' not a word]
! 33: }
! 34: }
! 35:
E-mail: