1Parse.alternatives(3kaya)    Kaya module reference   Parse.alternatives(3kaya)
2
3
4

NAME

6       Parse::alternatives - Parse a string using a set of parsers.
7

SYNOPSIS

9       a alternatives( [Parser<a> ] alts, var ParseState st )
10

ARGUMENTS

12       alts A list of parser functions
13
14       st The current parsing state
15

DESCRIPTION

17       Parse  a  string  using a set of parsers. The first one which parses is
18       used.
19
20
21    // Equivalent to
22    parser = alts[0] `or` alts[1] `or` alts[2]
23             `or` ... `or` alts[size(alts)-1];
24    parsed = parser(st);
25

AUTHORS

27       Kaya  standard  library  by  Edwin  Brady,  Chris  Morris  and   others
28       (kaya@kayalang.org). For further information see http://kayalang.org/
29

LICENSE

31       The  Kaya  standard  library  is free software; you can redistribute it
32       and/or modify it under the terms  of  the  GNU  Lesser  General  Public
33       License  (version  2.1  or  any later version) as published by the Free
34       Software Foundation.
35
37       Parse.or (3kaya)
38
39
40
41Kaya                             December 2010       Parse.alternatives(3kaya)
Impressum