-
Notifications
You must be signed in to change notification settings - Fork 119
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
Char literal for byte type #1317
Conversation
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.
👍
7523be5
to
2e3c3c0
Compare
Added missing tests for |
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.
Cool! 👍
@nkrkv does the addition to data types reference look ok? I have some doubts about it. |
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.
OK, made a proposal
docs/reference/data-types/README.md
Outdated
@@ -279,6 +279,14 @@ In some inputs IDE or CLI can normalize almost valid literals like lower-cased | |||
<td class="right aligned"><code>006d</code></td> | |||
<td>The leading zeros are allowed but may be omitted</td> | |||
</tr> | |||
<tr> | |||
<td class="right aligned"><code>'a'</code></td> | |||
<td>A character surrounded by single quotation marks</td> |
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.
Maybe:
A character surrounded by single quotes is translated to a byte value equal to its ASCII code
docs/reference/data-types/README.md
Outdated
</tr> | ||
<tr> | ||
<td class="right aligned"><code>'\n'</code></td> | ||
<td>Escaped character</td> |
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.
A backslashed character specifies a [control ASCII character](https://en.wikipedia.org/wiki/Control_character) like line feed, carriage return, tab, etc.
5f2ccd3
to
bc21a8a
Compare
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.
👍
Now in addition to hex, dec and bin literals, you can bind chars into
byte
inputs in the form'a'
or'\n'
. Should be very handy for processing strings.