Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[camlp4] long integer literals #2413

Closed
vicuna opened this issue Apr 5, 2004 · 2 comments
Closed

[camlp4] long integer literals #2413

vicuna opened this issue Apr 5, 2004 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Apr 5, 2004

Original bug ID: 2413
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Bonjour,

le lexer de camlp4 refuse les entiers longs (int32, int64, nativeint)
en notation hexa, octale ou binaire alors que celui d'ocaml les
accepte. Ci-joint un patch corrigeant ça.

$ ledit ocaml
Objective Caml version 3.07+2

0x0l ;;

  • : int32 = 0l

#load "camlp4o.cma" ;;

    Camlp4 Parsing version 3.07+2

0x0l ;;

This expression is not a function, it cannot be applied

--
Olivier


--- plexer.ml.1.17. 2003-11-24 22:37:48.000000000 +0100
+++ plexer.ml 2004-04-05 17:28:59.000000000 +0200
@@ -88,6 +88,9 @@
parser
[ [: d = kind; s :] -> digits_under kind (store len d) s
| [: `'_'; s :] -> digits_under kind len s

  • | [: `'l' :] -> ("INT32", get_buff len)
  • | [: `'L' :] -> ("INT64", get_buff len)
  • | [: 'n' :] -> ("NATIVEINT", get_buff len) | [: :] -> ("INT", get_buff len) ] and octal = parser [ [: ('0'..'7' as d) :] -> d ]
    and hexa = parser [ [: `('0'..'9' | 'a'..'f' | 'A'..'F' as d) :] -> d ]


@vicuna
Copy link
Author

vicuna commented Apr 13, 2004

Comment author: administrator

Bonjour,

le lexer de camlp4 refuse les entiers longs (int32, int64, nativeint)
en notation hexa, octale ou binaire alors que celui d'ocaml les
accepte. Ci-joint un patch corrigeant ça.

Merci pour le rapport de bug et pour le patch, que j'ai integre dans
la version de travail.

-- Damien

@vicuna
Copy link
Author

vicuna commented Apr 13, 2004

Comment author: administrator

patched DD 2004-04-13

@vicuna vicuna closed this as completed Apr 13, 2004
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant