fix CRLF handling in match grammar

svn: r7922
This commit is contained in:
Matthew Flatt 2007-12-07 20:14:15 +00:00
parent 812618c6cc
commit b7a7de9000

View File

@ -137,7 +137,8 @@ ooo ::= *** @zero or more; *** is literal
(define re:or-prod "^( +) [|] (.*[^ ])( +)[@](.*)$")
(define re:eng-prod "^([^ ]*)( +):== (.*)$")
(define lines (regexp-split "\n" (substring grammar 1 (sub1 (string-length grammar)))))
(define lines (let ([lines (regexp-split "\r?\n" grammar)])
(reverse (cdr (reverse (cdr lines))))))
(define spacer (hspace 1))
@ -191,5 +192,8 @@ ooo ::= *** @zero or more; *** is literal
(table-line spacer
-or-
(fixup-rhs val)
(fixup-meaning meaning))))]))
(fixup-meaning meaning))))]
[else (error 'make-match-grammar
"non-matching line: ~e"
line)]))
lines)))