Permalink
Browse files

[feature] rules: Added Rule.int64.

  • Loading branch information...
1 parent ae07ee1 commit c974d0e7373a96c386aac630274c2fc3949672c9 @nrs135 nrs135 committed Dec 3, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/stdlib/core/parser/rules.opa
@@ -212,6 +212,11 @@ Rule =
integer = parser sign="-"? val=natural -> Option.switch(_ -> -1, 1, sign) * val
/**
+ * Same as Rule.integer except for 64-bit integers.
+ */
+ int64 = parser sign="-"? val=([0-9]+) -> Int64.of_string(Option.switch(_ -> "-", "", sign) ^ Text.to_string(val))
+
+ /**
* A parser for byte (integer between 0 and 255
*/
byte = parser

0 comments on commit c974d0e

Please sign in to comment.