-
-
Notifications
You must be signed in to change notification settings - Fork 125
Rebuild 05AB1E using binaries and libraries from the Erlang and Elixir images, fixing the parsing of multi-line strings #2109
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
Open
Yewzir
wants to merge
27
commits into
code-golf:master
Choose a base branch
from
Yewzir:osabie
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.
Conversation
This file contains hidden or 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
|
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. |
|
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. |
I'm adjusting a few things so that all builders are tagged correctly and the new slave also ends up in the base image.
That is to say: more or less. This fully displays multi-line command line arguments, so some progress has been made. Unfortunately, this isn't the solution yet, as it leads to the same problem as with Stax: each line is treated as a separate argument. I believe executing an empty source file should also fully display the first command line argument. That would solve the problem.
This also works the same way for single-line string input. However, it breaks the sample code because the action under "Accessing arguments" constantly displays the triple quotes. I don't know the language well enough yet, and I wouldn't know how to repeat `I,I,I,I,I,I,I,` the required number of times. I've tried a few things, but it's making me far too nervous at the moment. With something similar to what it does for numeric values, absolutely nothing seems to work. So far, changes in `play.go` have also failed every time, so I'm leaving it as is for now.
1.14.0
Command-line arguments containing Unicode characters are not yet supported. Almost.
Yewzir
commented
Dec 27, 2025
Comment on lines
39
to
75
| const char* table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | ||
|
|
||
| ERR_AND_EXIT("write"); | ||
| for (int i = 2; i < argc; i++) { | ||
| int len = strlen(argv[i]); | ||
|
|
||
| char* arg, *str; | ||
|
|
||
| if (!(arg = str = malloc((len + 2) / 3 * 4 + 1))) | ||
| ERR_AND_EXIT("malloc"); | ||
|
|
||
| int j, chunk; | ||
|
|
||
| for (j = 0; j + 2 < len; j += 3) { | ||
| chunk = argv[i][j] << 16 | argv[i][j+1] << 8 | argv[i][j+2]; | ||
|
|
||
| *str++ = table[chunk >> 18 & 63]; | ||
| *str++ = table[chunk >> 12 & 63]; | ||
| *str++ = table[chunk >> 6 & 63]; | ||
| *str++ = table[chunk & 63]; | ||
| } | ||
|
|
||
| if (j < len) { | ||
| chunk = argv[i][j] << 16 | (j + 1 < len) * argv[i][j+1] << 8; | ||
|
|
||
| *str++ = table[chunk >> 18 & 63]; | ||
| *str++ = table[chunk >> 12 & 63]; | ||
| *str++ = j + 1 < len ? table[chunk >> 6 & 63] : '='; | ||
| *str++ = '='; | ||
| } | ||
|
|
||
| *str = 0; | ||
|
|
||
| if (!write(fd, arg, strlen(arg)) || !write(fd, "\n", sizeof(char))) | ||
| ERR_AND_EXIT("write"); | ||
|
|
||
| free(arg); | ||
| } |
Contributor
Author
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.
For example, the arguments from the Hexdump hole.
Hello, World!
0
1
2
3
4
5
6
7
8
9
["In mathematics and computing, the hexadecimal (also base 16 or simply hex)
numeral system is a positional numeral system that represents numbers using a
radix (base) of 16. Unlike the decimal system representing numbers using 10
symbols, hexadecimal uses 16 distinct symbols, most often the symbols "0"-"9"
to represent values 0 to 9, and "A"-"F" (or alternatively "a"-"f") to represent
values from 10 to 15.
Software developers and system designers widely use hexadecimal numbers because
they provide a human-friendly representation of binary-coded values. Each
hexadecimal digit represents four bits (binary digits), also known as a nibble
(or nybble). For example, an 8-bit byte can have values ranging from 00000000 to
11111111 in binary form, which can be conveniently represented as 00 to FF in
hexadecimal.", "Code Golf", " !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~", "Lorem ipsum dolor sit amet,
consectetur adipiscing elit
", "multi-
line
string", "Code Golf is a game designed to let you show off your code-fu by solving problems in the least number of characters.", "0123456789abcdef"]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.