From 62bd189a5ca5667ac8849668ac578f82ffe357d5 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Tue, 10 Nov 2009 05:39:37 +0000 Subject: [PATCH] Updated variable assignment to support the /set command git-svn-id: file:///srv/svn/ircclient/trunk@14 a9804ffe-773b-11dd-bd7c-89c3ef1d2733 --- mirc/includes/parser.h | 18 ++++++++++++++---- mirc/test.mrc | 5 ++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/mirc/includes/parser.h b/mirc/includes/parser.h index d14ef3d..cc6b8c3 100644 --- a/mirc/includes/parser.h +++ b/mirc/includes/parser.h @@ -179,10 +179,20 @@ struct mirc_script : public grammar { = ch_p('%') >> identifier ; assignment - = !(str_p("var") >> *space) - >> variable[v_def] - >> *space >> ch_p('=') >> *space - >> expression[v_assign] + = ( + !(str_p("var") >> *space) + >> variable[v_def] + >> *space >> ch_p('=') >> *space + >> expression[v_assign] + ) + | + ( + !ch_p('/') + >> str_p("set") >> *space + >> variable[v_def] + >> *space + >> expression[v_assign] + ) ; alias_action = !ch_p('/') >> !ch_p('/') diff --git a/mirc/test.mrc b/mirc/test.mrc index 159a3df..d431305 100644 --- a/mirc/test.mrc +++ b/mirc/test.mrc @@ -2,14 +2,13 @@ echo TEST Code line match [ 2 = $line ] ; Test comment echo TEST Code line match [ 4 = $line ] -set name Correl %first = Correl - +set %last Roush %middle = Joseph %name = %first $& - %middle Roush + %middle %last echo Hello %name $+ ! $& How $lower(ArE YoU) $+ ? showversion