I'm creating a programming language with an interpreter that is written in Python. The syntax for my language looks like this:
disp "The quick brown fox jumps over the lazy dog" # 'disp' displays text
disp $myStr # anything starting with $ is a string variable
strop add $myStr "... The End" # String operations. Concatenate $myStr and some text.
However, I am having trouble parsing it. If I have the string "Hello, SO!" $myStr
how do I separate it so that "Hello, SO!"
and $myStr
are separate, and make it work with two literals, two variables or one of each?
Thanks in advance.