Wiki

Ticket #120 (assigned idea)

Opened 15 years ago

Last modified 15 years ago

Support verbatim string notation

Reported by: gauthier Owned by: Chuck
Priority: medium Milestone: Cobra 0.9
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

have support for csharp verbatim string equivalent.

Attachments

bigraw.patch Download (15.3 KB) - added by hopscc 15 years ago.

Change History

Changed 15 years ago by hopscc

How is that different from cobra raw string

a = r"xyzzy [a+b] %c"

Changed 15 years ago by Chuck

He may have just missed it, since he doesn't reference it.

But C# also allows its version of the raw string to span lines and includes the \r\n in the result. Cobra currently does not.

I would like Python style mult-line strings at some point, but probably with indentation as the Python and C# approaches tend to either ruin code formatting or have extra leading whitespace per line in the string contents.

Changed 15 years ago by hopscc

so thats something like the  uber-Raw string discussed a while back.

Would it be preferable to have a new construct support \r\n and some form of whitespace control or allow the existing raw string construct to handle newlines
( and have another construct to control whitespace with newline).

Changed 15 years ago by hopscc

  • owner set to hopscc
  • status changed from new to assigned

Changed 15 years ago by hopscc

Working on this now initially having syntax

a = R' ......
    ......
    ......' 

Auto remove indentation if indented to expected level
optional support for '|' bounding
support both R'...' and R"..." syntaxes.

Changed 15 years ago by hopscc

Changed 15 years ago by hopscc

Patch for multiline raw string ( bigraw string) using syntax

R'........'
and
R"........"

tests and relnote

supports auto indent trimming and line edge bounding with '|'
Rough notes and examples in test file.

see also forum discussion item in
 Multiline Strings
which I'm going to write next.

Changed 15 years ago by hopscc

  • owner changed from hopscc to Chuck

Pox, Forgot to move the state of this bug back to chuck for response/action.

Changed 15 years ago by gauthier

I tried the sharp'@""' notation but it's breaking after the first carriage.

As a temporary workaround, is there a possibility to support this:

sharp'@"multi
line
string
"'

Changed 15 years ago by hopscc

Perhaps bug report it as a bug/feature request against the sharp string literal

sharp''

sharp literal not support multiline strings....

Note: See TracTickets for help on using tickets.