12 # Scheme machine. This is ambiguous with the item machine. We commit
13 # to the scheme machine on colon.
14 ( [^:/?#]+ ':' @(colon,1) @scheme )?
16 # Location machine. This is ambiguous with the item machine. We remain
17 # ambiguous until a second slash, at that point and all points after
18 # we place a higher priority on staying in the location machine over
19 # moving into the item machine.
20 ( ( '/' ( '/' [^/?#]* ) $(loc,1) ) %loc %/loc )?
22 # Item machine. Ambiguous with both scheme and location, which both
23 # get a higher priority on the characters causing ambiguity.
24 ( ( [^?#]+ ) $(loc,0) $(colon,0) %item %/item )?
26 # Last two components, the characters that initiate these machines are
27 # not supported in any previous components, therefore there are no
28 # ambiguities introduced by these parts.
29 ( '?' [^#]* %query %/query)?