Skip to content

Multiline string literals in EOL #168

@kolovos

Description

@kolovos

String literals in EOL can be multi-line as shown below.

Image

This "feature" is unintentional and undocumented. Before da11738 we used SingleLineRules to syntax-highlight string literals in Epsilon Eclipse's editors, which was masking this. However, in da11738 the EOL editor became consistent with the parser and now uses MultiLineRules. This can create some awkward syntax highlighting when a string is not properly closed with a single/double quote as shown below.

Image

What's more, being an accidental feature, multi-line strings are not properly supported (e.g. indentation is not considered when computing their contents). To maintain backwards compatibility, one option would be to use SingleLineRules for double-quoted strings and raise a warning in the editor when multi-line double-quoted strings are used. For single-quoted strings, we can keep the MultiLineRule for syntax highlighting and not raise a warning, with the intention of improving support for them in 3.0 (i.e. in 3.0 onwards double-quoted strings would be single-line and single-quoted strings would be multi-line with proper support for indentation).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions