rust/compiler/rustc_lexer/src
Nicholas Nethercote 37d9ea745b Improve scan_escape.
`scan_escape` currently has a fast path (for when the first char isn't
'\\') and a slow path.

This commit changes `scan_escape` so it only handles the slow path, i.e.
the actual escaping code. The fast path is inlined into the two call
sites.

This change makes the code faster, because there is no function call
overhead on the fast path. (`scan_escape` is a big function and doesn't
get inlined.)

This change also improves readability, because it removes a bunch of
mode checks on the the fast paths.
2022-02-24 17:01:01 +11:00
..
unescape Warn when an escaped newline skips multiple lines 2021-08-11 11:35:08 +02:00
cursor.rs Replace nth_char(0) with next() in cursor.first() 2021-12-01 19:14:10 +01:00
lib.rs Auto merge of #91393 - Julian-Wollersberger:lexer_optimization, r=petrochenkov 2021-12-03 13:20:14 +00:00
tests.rs Move lexer unit tests to rustc_lexer 2020-08-30 19:53:36 +02:00
unescape.rs Improve scan_escape. 2022-02-24 17:01:01 +11:00