1. embedded speech marks in strings
- Posted by raseunew Jan 14, 2011
- 1060 views
Release :
Euphoria Interpreter v4.0.0
Linux, Using System Memory
Revision Date: 2010-12-22, Id: 115714454200
the following code
sequence DATA3 = """1,2,3,4,"five",6,7,"eight",9,"10""""
fails with the following error
<0067>:: end of line reached with no closing "
the following all work ok
--// ok sequence DATA1 = """1,2,3,4,"five",6,7,"eight",9,"10" """ --// ok sequence DATA2 = """1,2,3,4,"five",6,7,"eight",9,"10" """
2. Re: embedded speech marks in strings
- Posted by zebra Jan 14, 2011
- 1059 views
Release :
Euphoria Interpreter v4.0.0
Linux, Using System Memory
Revision Date: 2010-12-22, Id: 115714454200
the following code
sequence DATA3 = """1,2,3,4,"five",6,7,"eight",9,"10""""
fails with the following error
<0067>:: end of line reached with no closing "
the following all work ok
--// ok sequence DATA1 = """1,2,3,4,"five",6,7,"eight",9,"10" """ --// ok sequence DATA2 = """1,2,3,4,"five",6,7,"eight",9,"10" """
When ever you want euphoria to ignore a quotation mark that is not to be interpreted. The quotation mark inside a sequence must EACH be escaped by \" then euphoria will see this as a single quotation mark . DATA3 = "\"\"1,2,3,4,"five",6,7,"eight",9,"10"\"\""
3. Re: embedded speech marks in strings
- Posted by jaygade Jan 14, 2011
- 1062 views
I don't think that's what he wants. He's using raw strings and not regular strings and I don't think backslash escaping works in raw strings (which is kinda the point of having them).
The raw string has to be closed with """ . Since he wants to include a final " inside the string as well as the closing """ then he has 4 " at the end.
The interpreter sees """ as a single token leaving a trailing ", causing the error.
I would suggest if you want to do that then use ` quoted strings instead. I think that other scripting languages which have this capability have the same problem.
Reference: http://openeuphoria.org/docs/lang_def.html#_78_characterstringsandindividualcharacters
4. Re: embedded speech marks in strings
- Posted by raseunew Jan 14, 2011
- 1062 views
my aim was to use raw strings.
i don't really like the idea of using ` (backtick)
char (reminds me too much of bash escape sequences)