Update of /var/lib/cvs/fundev/Sources/runtime-manager/debugger-nub/gdb-mi
In directory cantor:/tmp/cvs-serv5799
Modified Files:
Tag: fundev-2-1-gdb-nub
gdb-access.dylan
Log Message:
optional was easy now...
Index: gdb-access.dylan
===================================================================
RCS file:
/var/lib/cvs/fundev/Sources/runtime-manager/debugger-nub/gdb-mi/Attic/gdb-access.dylan,v
retrieving revision 1.1.2.31
retrieving revision 1.1.2.32
diff -u -d -r1.1.2.31 -r1.1.2.32
--- gdb-access.dylan 13 Apr 2004 18:18:51 -0000 1.1.2.31
+++ gdb-access.dylan 13 Apr 2004 18:46:09 -0000 1.1.2.32
@@ -1027,7 +1027,7 @@
end block;
end begin;
-// juxtapose -- run two parsers side-by-side
+// parallel -- run two parsers side-by-side
// both consuming the same input
//
define function parallel(p1 :: <function>, p2 :: <function>, #key connective
:: <function> = list)
@@ -1064,4 +1064,15 @@
pair(inp.always,
matched),
more.tail)
+end;
+
+
+// optional -- given a parser, construct
+// a new parser that: always succeeds
+// producing something when input has been
+// consumed, #f otherwise
+//
+define function optional(p :: <function>)
+ => optional :: <function>;
+ parallel(p, epsilon, connective: identity)
end;
!DSPAM:407c357458461226117634!
_______________________________________________
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
http://www.gwydiondylan.org/mailman/listinfo/gd-chatter
|
|