Re: Better string constants
Carl Gay <[email protected]>
| Newsgroups | gmane.comp.lang.dylan.gwydion.devel |
|---|---|
| Message-ID | <CALekcH1fTnLwTEsSS01gkzeM50Wabo-QRZKh75q7SeYpOCfLGA@mail.gmail.com> |
On Fri, Mar 1, 2013 at 1:56 AM, Dustin Voss <[email protected]> wrote: > On Feb 28, 2013, at 8:40 AM, Carl Gay <[email protected]> wrote: > > On Thu, Feb 28, 2013 at 9:52 AM, Alfredo Beaumont < > [email protected]> wrote: > >> I don't see any reason not to allow multiline strings with the actual >> syntax: >> >> " >> A: { >> a: 'a' >> b: 'b' >> c: 'c' >> } >> " >> > > Will the compiler always be able to give good warnings for unterminated > strings? I don't see how. If not, I'd prefer to have the common case > stay as it is and add new syntax for the less common cases of multi-line > and raw strings. > > > > What do you mean by “good warnings”? The compiler should certainly be able > to see that it hits the end of the source record with an unterminated > string. > > As far as the BNF goes, the only change necessary to support this would be > to change the definition of string-character to include newline in addition > to space. > It's very unlikely to reach the end of the source record since double-quote is a common character. The string will terminate at the beginning of the next string and the compiler will start looking for comma, close-paren, whatever. Since it thinks the first string parsed fine it will give some strange warning about the content of the second string and it won't be able to pinpoint the error to the beginning of the string like it nicely did in the example Bruce just sent out. _______________________________________________ hackers mailing list [email protected] https://lists.opendylan.org/mailman/listinfo/hackers