[m-users.] Funny syntax in xml.parse.m

Volker Wysk post at volker-wysk.de
Fri Jun 24 04:47:42 AEST 2022


Am Donnerstag, dem 23.06.2022 um 20:36 +0200 schrieb Volker Wysk:
> Hi
> 
> In xml.parse.m in the XML library there are a lot of constructs like this:
> 
> xmlDecl -->
>     lit("<?xml")        then (pred(_::in, pdi, puo) is det -->
>     versionInfo         then (pred(_::in, pdi, puo) is det -->
>     opt(encodingDecl)   then (pred(MEnc::in, pdi, puo) is det -->
>     opt(sdDecl)         then (pred(_::in, pdi, puo) is det -->
> ...
> 
> There's no "if" or "else" corresponding to the "then"'s. Can someone tell me
> what this syntax is called? I couldn't find it documented in the sections
> 2.13/2.14 about DCGs, in the language reference manual.


I've found it. It's defined in parsing.m. So "then" isn't a reserved word in
Mercury.

Bye, Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20220623/6c1c99f5/attachment.sig>


More information about the users mailing list