From: Markus Triska Date: Wed, 8 Dec 2021 09:42:19 +0000 (+0100) Subject: ENHANCED: support full layout text sequence (also comments) in integers with underscores X-Git-Tag: v0.9.0~5^2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=f79b8a1ca5861ae6a7652301ed2b3faea4b0f0b4;p=scryer-prolog.git ENHANCED: support full layout text sequence (also comments) in integers with underscores Example: ?- X = 1_/**/2. %@ X = 12. Following the comment in https://github.com/mthom/scryer-prolog/pull/1112#issuecomment-981540485 --- diff --git a/crates/prolog_parser/src/lexer.rs b/crates/prolog_parser/src/lexer.rs index 210722c6..8be50d36 100644 --- a/crates/prolog_parser/src/lexer.rs +++ b/crates/prolog_parser/src/lexer.rs @@ -564,11 +564,8 @@ impl<'a, R: Read> Lexer<'a, R> { if c == '_' { self.skip_char()?; + self.scan_for_layout()?; c = self.lookahead_char()?; - while layout_char!(c) { - self.skip_char()?; - c = self.lookahead_char()?; - } if decimal_digit_char!(c) { Ok(c)