[m-rev.] for review: treat '\r' as whitespace

Peter Ross peter.ross at miscrit.be
Mon Mar 19 20:46:37 AEDT 2001


Hi,

For anyone to review.

===================================================================


Estimated hours taken: 0.5
Branches: main, release

library/lexer.m:
    Fix a bug where the lexer library wasn't treating '\r' as a
    whitespace character.


Index: lexer.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/lexer.m,v
retrieving revision 1.34
diff -u -r1.34 lexer.m
--- lexer.m	2000/03/28 03:40:38	1.34
+++ lexer.m	2001/03/19 09:43:19
@@ -280,7 +280,7 @@
 		lexer__get_context(Context),
 		{ Token = eof }
 	; { Result = ok(Char) },
-		( { Char = ' ' ; Char = '\t' ; Char = '\n' } ->
+		( { Char = ' ' ; Char = '\r' ; Char = '\t' ; Char = '\n' } ->
 			lexer__get_token_2(Token, Context)
 		; { char__is_upper(Char) ; Char = '_' } ->
 			lexer__get_context(Context),
@@ -331,7 +331,7 @@
 lexer__string_get_token(String, Len, Token, Context) -->
 	=(Posn0),
 	( lexer__string_read_char(String, Len, Char) ->
-		( { Char = ' ' ; Char = '\t' ; Char = '\n' } ->
+		( { Char = ' ' ; Char = '\r' ; Char = '\t' ; Char = '\n' } ->
 			lexer__string_get_token_2(String, Len, Token, Context)
 		; { char__is_upper(Char) ; Char = '_' } ->
 			lexer__string_get_variable(String, Len, Posn0,
@@ -400,7 +400,7 @@
 		lexer__get_context(Context),
 		{ Token = eof }
 	; { Result = ok(Char) },
-		( { Char = ' ' ; Char = '\t' ; Char = '\n' } ->
+		( { Char = ' ' ; Char = '\r' ; Char = '\t' ; Char = '\n' } ->
 			lexer__get_token_2(Token, Context)
 		; { char__is_upper(Char) ; Char = '_' } ->
 			lexer__get_context(Context),
@@ -448,7 +448,7 @@
 lexer__string_get_token_2(String, Len, Token, Context) -->
 	=(Posn0),
 	( lexer__string_read_char(String, Len, Char) ->
-		( { Char = ' ' ; Char = '\t' ; Char = '\n' } ->
+		( { Char = ' ' ; Char = '\r' ; Char = '\t' ; Char = '\n' } ->
 			lexer__string_get_token_2(String, Len, Token, Context)
 		; { char__is_upper(Char) ; Char = '_' } ->
 			lexer__string_get_variable(String, Len, Posn0,
@@ -582,6 +582,7 @@
 
 lexer__whitespace_after_dot(' ').
 lexer__whitespace_after_dot('\t').
+lexer__whitespace_after_dot('\r').
 lexer__whitespace_after_dot('\n').
 lexer__whitespace_after_dot('%').
 

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list