Merge pull request #1141 from triska/layout_text_sequence

ENHANCED: Support also comments in integers with underscores
This commit is contained in:
Mark Thom
2021-12-13 19:09:37 -07:00
committed by GitHub

View File

@@ -564,11 +564,8 @@ impl<'a, R: Read> Lexer<'a, R> {
if c == '_' { if c == '_' {
self.skip_char()?; self.skip_char()?;
self.scan_for_layout()?;
c = self.lookahead_char()?; c = self.lookahead_char()?;
while layout_char!(c) {
self.skip_char()?;
c = self.lookahead_char()?;
}
if decimal_digit_char!(c) { if decimal_digit_char!(c) {
Ok(c) Ok(c)
@@ -791,7 +788,7 @@ impl<'a, R: Read> Lexer<'a, R> {
let cr = self.lookahead_char(); let cr = self.lookahead_char();
match cr { match cr {
Ok(c) if layout_char!(c) || new_line_char!(c) => { Ok(c) if layout_char!(c) => {
self.skip_char()?; self.skip_char()?;
layout_inserted = true; layout_inserted = true;
} }