]> Repositorios git - scryer-prolog.git/commitdiff
ENHANCED: support full layout text sequence (also comments) in integers with underscores
authorMarkus Triska <[email protected]>
Wed, 8 Dec 2021 09:42:19 +0000 (10:42 +0100)
committerMarkus Triska <[email protected]>
Wed, 8 Dec 2021 09:42:19 +0000 (10:42 +0100)
Example:

    ?- X = 1_/**/2.
    %@    X = 12.

Following the comment in https://github.com/mthom/scryer-prolog/pull/1112#issuecomment-981540485

crates/prolog_parser/src/lexer.rs

index 210722c686cd490ec22b133d91054f3db81fd5c7..8be50d36a53615cfc38803c8c15eaf3e0ce210f9 100644 (file)
@@ -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)