[m-dev.] diff: fix {}/N parsing bug in moose

Tyson Dowd trd at cs.mu.OZ.AU
Tue Oct 10 23:16:34 AEDT 2000


Hi,


===================================================================


Estimated hours taken: 1

Fix a bug with moose that was causing my C parser to fail to parse.
The change to add tuples changed the way {}/N was parsed, and moose uses
{}/N for grammar actions.

extras/moose/grammar.m:
	Parse {}/N correctly.


Index: grammar.m
===================================================================
RCS file: /home/pgrad/trd/CVS/moose/grammar.m,v
retrieving revision 1.2
diff -u -r1.2 grammar.m
--- grammar.m	2000/05/06 08:29:00	1.2
+++ grammar.m	2000/10/10 11:52:22
@@ -180,6 +180,9 @@
 		Prod = (Left; Right)
 	; Atom = atom("{}"), Args = [Goal] ->
 		Prod = action(Goal)
+	; Atom = atom("{}"), Args = [Goal | Goals] ->
+		foldl((pred(G::in, Left::in, (Left, action(G))::out) is det),
+			Goals, action(Goal), Prod)
 	; Atom = atom("[]"), Args = [] ->
 		Prod = []
 	; Atom = atom("."), Args = [Head, Tail] ->


-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list