mirror of
https://github.com/correl/mercenary.git
synced 2024-11-23 11:09:50 +00:00
Updated variable assignment to support the /set command
git-svn-id: file:///srv/svn/ircclient/trunk@14 a9804ffe-773b-11dd-bd7c-89c3ef1d2733
This commit is contained in:
parent
a8443598b8
commit
62bd189a5c
2 changed files with 16 additions and 7 deletions
|
@ -179,10 +179,20 @@ struct mirc_script : public grammar<mirc_script> {
|
|||
= ch_p('%') >> identifier
|
||||
;
|
||||
assignment
|
||||
= !(str_p("var") >> *space)
|
||||
= (
|
||||
!(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('/')
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue