-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add support for binary integer values #236
Open
cozzyd
wants to merge
8
commits into
hyperrealm:master
Choose a base branch
from
cozzyd:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
70105ba
Add support for binary integer values
cozzyd 280d306
tests for binary and hex integers
cozzyd 506f9dd
don't accidentally define YYDEBUG
cozzyd be9c7bf
spacing fixes
cozzyd b7ff49a
Make all integer parsing consistent
cozzyd 50b4445
add tests for automatic bin/hex enlargement
cozzyd b80e6de
first pass at updated docs
cozzyd 85bdd4a
typo in version
cozzyd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -404,6 +404,7 @@ application: | |
bigint = 9223372036854775807L; | ||
columns = [ "Last Name", "First Name", "MI" ]; | ||
bitmask = 0x1FC3; // hex | ||
bitmask2 = 0b1011; // binary | ||
umask = 0027; // octal. Range limited to that of "int" | ||
@}; | ||
@}; | ||
|
@@ -509,24 +510,26 @@ The last element in a list may be followed by a comma, which will be ignored. | |
@comment node-name, next, previous, up | ||
@section Integer Values | ||
|
||
Integers can be represented in one of two ways: as a series of one or | ||
more decimal digits (@samp{0} - @samp{9}), with an optional leading | ||
sign character (@samp{+} or @samp{-}); or as a hexadecimal value | ||
consisting of the characters @samp{0x} followed by a series of one or | ||
more hexadecimal digits (@samp{0} - @samp{9}, @samp{A} - @samp{F}, | ||
@samp{a} - @samp{f}). Additionally, octal notation integers (that is, | ||
those having a leading zero with non-zero value) are also allowed. | ||
Integers can be represented in one of two ways: as a series of one or more | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/one of two/the following/ |
||
decimal digits (@samp{0} - @samp{9}), with an optional leading sign character | ||
(@samp{+} or @samp{-}); as a hexadecimal value consisting of the characters | ||
@samp{0x} followed by a series of one or more hexadecimal digits (@samp{0} - | ||
@samp{9}, @samp{A} - @samp{F}, @samp{a} - @samp{f}); or (as of version 1.7.4 of | ||
the library) as a binary value consisting of the characters @samp{0b} followed | ||
by a series of @samp{0}s or @samp{1}s. Additionally, octal notation integers | ||
(that is, those having a leading zero with non-zero value) are also allowed. | ||
|
||
@node 64-bit Integer Values, Floating Point Values, Integer Values, Configuration Files | ||
@comment node-name, next, previous, up | ||
@section 64-bit Integer Values | ||
|
||
Long long (64-bit) integers are represented identically to integers, | ||
except that an `L' character is appended to indicate a 64-bit | ||
value. For example, @samp{0L} indicates a 64-bit integer value 0. As | ||
of version 1.5 of the library, the trailing `L' is optional; if the | ||
integer value exceeds the range of a 32-bit integer, it will | ||
automatically be interpreted as a 64-bit integer. | ||
Long long (64-bit) integers are represented identically to integers, except | ||
that an `L' character is appended to indicate a 64-bit value. For example, | ||
@samp{0L} indicates a 64-bit integer value 0. As of version 1.5 of the | ||
library, the trailing `L' is optional; if the integer value exceeds the range | ||
of a 32-bit integer, it will automatically be interpreted as a 64-bit integer. | ||
As of version 1.7.4 of the library this behavior is extended to hexadecimal | ||
(and binary) integers as well. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need for parens around 'and binary' |
||
|
||
The @i{integer} and @i{64-bit integer} setting types are interchangeable to the | ||
extent that a conversion between the corresponding native types would not | ||
|
@@ -2464,6 +2467,8 @@ directives are not part of the grammar, so they are not included here. | |
<boolean> | ||
| <integer> | ||
| <integer64> | ||
| <bin> | ||
| <bin64> | ||
| <hex> | ||
| <hex64> | ||
| <float> | ||
|
@@ -2501,6 +2506,10 @@ Terminals are defined below as regular expressions: | |
@code{[-+]?[0-9]+} | ||
@item @code{<integer64>} @tab | ||
@code{[-+]?[0-9]+L(L)?} | ||
@item @code{<bin>} @tab | ||
@code{0[bB][01]+} | ||
@item @code{<bin64>} @tab | ||
@code{0[bB][01]+L(L)?} | ||
@item @code{<hex>} @tab | ||
@code{0[Xx][0-9A-Fa-f]+} | ||
@item @code{<hex64>} @tab | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the C++ section of the documentation; there's a 'format' enum there as well