Permalink
Browse files

Branches: master, 13.05.

Make the calculator example handle CRLF line endings.

samples/calculator.m;
	As above.
  • Loading branch information...
1 parent 55efd52 commit dfce89d9999d2ddb4884b0884e7c50980452e070 @juliensf juliensf committed Jul 26, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 samples/calculator.m
View
@@ -76,7 +76,7 @@
fullexpr(X) -->
expr(X),
- ['\n'].
+ newline.
:- pred expr(expr::out, list(char)::in, list(char)::out) is semidet.
@@ -134,6 +134,11 @@
[Char],
{ char.is_digit(Char) }.
+:- pred newline(list(char)::in, list(char)::out) is semidet.
+
+newline --> ['\n'].
+newline --> ['\r'], ['\n'].
+
%-----------------------------------------------------------------------------%
:- end_module calculator.
%-----------------------------------------------------------------------------%

0 comments on commit dfce89d

Please sign in to comment.