caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Max Skaller <skaller@ozemail.com.au>
To: Brian Rogoff <bpr@best.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] petty complaints
Date: Mon, 09 Apr 2001 15:23:11 +1000	[thread overview]
Message-ID: <3AD1473F.F485C3A9@ozemail.com.au> (raw)
In-Reply-To: <Pine.BSF.4.21.0104012033020.11923-100000@shell5.ba.best.com>

Brian Rogoff wrote:

>     Another unrelated trifling question concerns the syntax of numerical
> literals. Would it be possible to allow a la Ada the insertion of _s in
> a numerical literal so instead of 1000000,10000000,and 100000000 we could
> write 1_000_000, 10_000_000, 100_000_000? Of course, as in Ada, you could
> allow wrongly positioned or superfluous _s (1_00_00_______0) but I think
> this trivial change can make reading numbers a bit nicer.

	I use the following lexer rules: note that the special
handling of 0 prefixed decimal numbers is to allow warnings
to be given for C heads that think 077 is octal :-)

(* integers *)
let bin_lit  = '0' ('b' | 'B') (underscore? bindigit) +
let oct_lit  = '0' ('o' | 'O') (underscore? octdigit) +
let dec_lit  = '0' ('d' | 'D') (underscore? digit) +
let nz_dec_lit  = nzdigit (underscore? digit) *
let z_dec_lit  = '0' (underscore? digit) *
let hex_lit  = '0' ('x' | 'X') (underscore? hexdigit)  +

(* floats *)
let decimal_string = digit (underscore? digit) *
let fixed_literal = decimal_string ? '.' decimal_string | 
  decimal_string '.' decimal_string?
let exponent = 'E' ('+'|'-')? decimal_string
let floating_literal = fixed_literal exponent? | decimal_string exponent

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  parent reply	other threads:[~2001-04-09 15:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-02  4:26 Brian Rogoff
2001-04-02 13:32 ` Xavier Leroy
2001-04-02 15:24   ` Brian Rogoff
2001-04-02 20:17   ` Chris Hecker
2001-04-02 19:45     ` Brian Rogoff
2001-04-09  5:23 ` John Max Skaller [this message]
2001-04-09 15:34 ` Christian Lindig
2001-04-09 16:01   ` Brian Rogoff
2001-04-09 16:24   ` David McClain
2001-04-09 16:29   ` Pierre Weis
2001-04-10 22:25     ` Marcin 'Qrczak' Kowalczyk
2001-04-24 15:23 [Caml-list] Petty complaints Brian Rogoff
2001-04-25  6:55 ` Fabrice Le Fessant
2001-04-25  7:00   ` Fabrice Le Fessant

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=3AD1473F.F485C3A9@ozemail.com.au \
    --to=skaller@ozemail.com.au \
    --cc=bpr@best.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).