1. embedded speech marks in strings

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" 

""" 

new topic     » topic index » view message » categorize

2. Re: embedded speech marks in strings

raseunew said...

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"\"\"" 
 
 

new topic     » goto parent     » topic index » view message » categorize

3. Re: embedded speech marks in strings

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: embedded speech marks in strings

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)

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu