Uploaded image for project: 'Swift'
  1. Swift
  2. SR-170

SE 0168 Multi-Line String Literals

    XMLWordPrintable

    Details

      Description

      I would very much like to implement python-style multi-line string literals in swift (not to be confused with slightly more complex heredoc style syntax). Strings would be started by a triple quote and ended by a triple quote, potentially with any consistent internal indentation stripped from the resulting string.

      Something to the effect of:

      let foo = """
        this is the first line
        this is the second line
      """
      

      Is there any interest, and if so is there any code I would need to touch outside of lib/Parse/Lexer.cpp? I only have a basic understanding of C++ and don't grok SourceKit in any way whatsoever.

      My main motivation is to make the use of DocOpt style command-line parsing significantly more pleasant. To see an example of what I mean, please check out http://docopt.org/

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            ttilley Travis Tilley
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: