caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Allsopp <dra-news@metastack.com>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: RE: [Caml-list] character syntax error '^M'
Date: Tue, 6 Aug 2013 10:52:45 +0000	[thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D9CCABBA52@Remus.metastack.local> (raw)
In-Reply-To: <520009B7.8040307@libertysurf.fr>

William R wrote:
> On 08/05/2013 07:38 PM, David Allsopp wrote:
> Use \r or \x0d? http://caml.inria.fr/pub/docs/manual-ocaml/lex.html
> 
> On 5 Aug 2013, at 18:34, "r.3@libertysurf.fr" <r.3@libertysurf.fr> wrote:
> Dear list,
> 
> I got a new error with trunk version of ocaml.
> 
> I have in a module a code that appears like that in emacs (which is used to convert files from dos to unix) :
> String.get s (String.length s -1) = '^M'
> The thing is that '^M' is actually the return character of windows (RET)

This is not strictly true. The return *sequence* of Windows is \r\n (0x0d followed by 0x0a). It's logical only if you imagine you're on a typewriter...

> This works with ocaml 4.00, but now, with trunk version of ocaml, it tells
> me this is a "syntax error".

The support for '^M' was removed as part of PR#5598 (http://caml.inria.fr/mantis/view.php?id=5598) in R12420 for parsing/lexer.mll. I'm not very good at interpreting subversion changelogs (for branches), but it looks like the fix may have only been applied to trunk (by mistake?) as it's certainly not in 4.00 or 4.00.1. However, I think looking at it that 4.01 does contain that patch (i.e. behaves the same way as trunk).


David


  reply	other threads:[~2013-08-06 10:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <51ECF4EB.1060301@libertysurf.fr>
2013-07-22  9:07 ` [Caml-list] which ocaml build system r.3
2013-07-22 15:11   ` Ashish Agarwal
2013-07-23 13:39   ` Marek Kubica
2013-07-25 21:45     ` Martin DeMello
2013-07-26  1:10       ` Francois Berenger
2013-07-26  5:01         ` Malcolm Matalka
2013-07-26  5:46           ` Adrien Nader
2013-07-26  6:49             ` rixed
2013-07-26  7:07               ` David Allsopp
2013-07-26  4:49       ` Gabriel Scherer
2013-08-05 17:34         ` [Caml-list] character syntax error '^M' r.3
2013-08-05 17:38           ` David Allsopp
2013-08-05 20:23             ` William R
2013-08-06 10:52               ` David Allsopp [this message]
2013-07-27  9:51       ` [Caml-list] which ocaml build system Goswin von Brederlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E51C5B015DBD1348A1D85763337FB6D9CCABBA52@Remus.metastack.local \
    --to=dra-news@metastack.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).