Skip to content

Rust: "different styles between \r and \n" at end of line comments #34

@rdipardo

Description

@rdipardo

While trying out a patch for #33, TestLexers found this additional problem:

Lexing rust\Issue33.rs
C:\Users\Rob\source\git\scintilla-contib\lexilla\test\examples\rust\Issue33.rs:1: different styles between \r and \n at 21: 4, 0

C:\Users\Rob\source\git\scintilla-contib\lexilla\test\examples\rust\Issue33.rs:1: has different styles with \n versus \r\n line ends

SciTE (5.1.4) visually confirmed premature style switching after line comments in a file saved with Windows EOLs:

LexRust-EOL-splitting

This patch attempts to correct the EOL splitting: LexRust-Fix-EOL-splitting-at-comment-ends.zip

It would be ideal to have an omnibus lexer test (e.g. "AllStyles.rs"), but I leave that for someone who knows the language better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rustCaused by the rust lexer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions