The rule for using the comment line will look something like this:
spacer: charset reduce [tab cr newline #" "]
spaces: [some spacer]
any-spaces: [any spacer]
[any-spaces "//" thru newline]
, . .
text: {array('system.email' => array(
'to' => array(
'contactus' => 'contactus@example.com',
'newregistration' => 'newreg@example.com',
'requestaccess' => 'requestaccess@example.com',
'workflow' => 'test_workflow@example.com'
)
));}
list: []
spacer: charset reduce [tab cr newline
any-spaces: [any spacer]
comment-rule: [any-spaces "//" thru newline]
email-rule: [
thru "'"
copy name to "'" skip
thru "'"
copy email to "'"
thru newline
]
system-emails: [
thru "'system.email'" [
thru "to' => array("
some [
comment-rule |
email-rule (append list reduce [name email])
]
] to end
]
parse text system-emails
print list
.
, . , :
decomment: func [str [string!] /local new-str com comment-removing-rule] [
new-str: copy ""
com: [
"//"
thru newline
]
comment-removing-rule: [
some [
com |
copy char skip (append new-str char)
]
]
parse str comment-removing-rule
return new-str
]