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

Char literal for byte type #1317

Merged
merged 2 commits into from
Jul 5, 2018
Merged

Conversation

evgenykochetkov
Copy link
Contributor

@evgenykochetkov evgenykochetkov commented Jul 3, 2018

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.

Copy link
Member

@nkrkv nkrkv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@evgenykochetkov evgenykochetkov force-pushed the feat-char-literal-for-byte-type branch from 7523be5 to 2e3c3c0 Compare July 5, 2018 09:17
@evgenykochetkov
Copy link
Contributor Author

Added missing tests for xod-project's getTypeFromLiteral 😬

Copy link
Member

@nkrkv nkrkv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! 👍

@evgenykochetkov
Copy link
Contributor Author

@nkrkv does the addition to data types reference look ok? I have some doubts about it.

Copy link
Member

@nkrkv nkrkv left a 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

@@ -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>
Copy link
Member

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

</tr>
<tr>
<td class="right aligned"><code>'\n'</code></td>
<td>Escaped character</td>
Copy link
Member

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.

@evgenykochetkov evgenykochetkov force-pushed the feat-char-literal-for-byte-type branch 3 times, most recently from 5f2ccd3 to bc21a8a Compare July 5, 2018 15:30
Copy link
Contributor

@brusherru brusherru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@evgenykochetkov evgenykochetkov merged commit 5ea35aa into master Jul 5, 2018
@evgenykochetkov evgenykochetkov deleted the feat-char-literal-for-byte-type branch July 5, 2018 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants