Skip to content

Rust: add cstring and raw cstring lexing#292

Closed
Ekopalypse wants to merge 4 commits intoScintillaOrg:masterfrom
Ekopalypse:rust_cstring_raw_cstring
Closed

Rust: add cstring and raw cstring lexing#292
Ekopalypse wants to merge 4 commits intoScintillaOrg:masterfrom
Ekopalypse:rust_cstring_raw_cstring

Conversation

@Ekopalypse
Copy link
Copy Markdown
Contributor

@Ekopalypse Ekopalypse commented Nov 28, 2024

fixes #268

@nyamatongwe
Copy link
Copy Markdown
Member

That mostly looks good.

include/SciLexer.h is generated from include/LexicalStyles.iface by scripts/LexillaGen.py and will be overwritten by build scripts. The new style definitions should be added to include/LexicalStyles.iface.

To avoid multiple definition problems, non-static definitions like StringType and NUM_RUST_KEYWORD_LISTS should be in an unnamed namespace. Most maintained lexers place almost the whole file except for the LexerModule definition in an unnamed namespace.

Since there is a non-ASCII character 'æ' encoded as UTF-8, there should be a UTF-8 coding declaration so SciTE will correctly display the file. See test/examples/cpp/130NonAsciiKeyword.cxx.

The styling test results in this pull request appear to be from before the new feature: examples/rust/Issue268.rs.styled doesn't contain any style 24 or 25 but running TestLexers produces these styles.

@nyamatongwe nyamatongwe added the rust Caused by the rust lexer label Nov 28, 2024
nyamatongwe pushed a commit that referenced this pull request Nov 30, 2024
nyamatongwe pushed a commit that referenced this pull request Nov 30, 2024
@nyamatongwe nyamatongwe added the committed Issue fixed in repository but not in release label Nov 30, 2024
@nyamatongwe nyamatongwe removed the committed Issue fixed in repository but not in release label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Caused by the rust lexer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust lexer lacks handling for C string and raw C string literals

2 participants