Commit Graph

7 Commits

Author SHA1 Message Date
Rintaro Ishizaki
a0ebdbc089 [Lexer] Fix assertion failure for unterminated string literal
in string interpolation in multiline string literal.

    """
    \("<-this is unterminated.
    """

In this case, the outer multiline literal should form 'tok::unknown'
along with a error message.
2018-09-22 02:09:19 +09:00
Rintaro Ishizaki
a2d3ff4deb [SE-0182][Lexer] Diagnose escaped newline at the end of the last line in multiline string 2017-07-26 21:18:58 +09:00
John Holdsworth
c0fcc1afba [Parse] An implementation for SE-0182 2017-07-21 18:07:06 +01:00
Rintaro Ishizaki
c8bd1aa401 [Parse] Fix skipping string interpolation in Lexer
Maintain inner most string literal mode to determine whether we allow
newline character or not.

* Disallow newline after multiline string in string interpolation. (SR-5171)
* Allow unbalanced `"` in multiline string in string interpolation.
2017-06-16 02:22:49 +09:00
Brent Royal-Gordon
1d70565d55 Better diagnostics for multi-line string literals (#9148)
[Parse] Improve multi-line string literal errors

Adds descriptive errors and fix-its for multi-line string literal indentation and newline errors.
2017-05-08 13:24:31 -07:00
John Holdsworth
fea17f22aa [Parse] Add support for multiline strings inside interpolations
Adds support for multiline string literals to appear inside of string interpolations. Tests added.
2017-04-27 19:02:23 -07:00
John Holdsworth
981e706fd9 An implementation for 0168-multi-line-string-literals.md (#8813)
This adds support for SE-0168, multi-line string literals.

Extend the lexer to recognize the new literals. Test cases added.

There are still areas for future diagnostic improvement, such as fixits and notes as to why a multi-line string literal will be malformed. Multi-line literals are explicitly forbidden inside of string interpolation, though this may be relaxed in the future.
2017-04-25 18:13:03 -07:00