3 ms·
Already looking forward to `grep`ing warning emojis in output. What's next? Poop emoji for errors?
by wiseowise 2y ago
Already looking forward to `grep`ing warning emojis in output.
What's next? Poop emoji for errors?
- johnisgood 2y agoI do not want any emojis from my compiler's output, heck, in my terminal in general. Please, do not make it the default behavior. (BTW my terminal does not even support emojis.)
- aseipp 2y agoWhy wouldn't you just keep search for the "warning:" or "error:" anchor, like people (and editors) have been doing forever? Even if that wasn't true it's not like searching for emojis is hard anyway. If it takes longer than 2 seconds for you to open a picker then you should ask for a refund for your computer.
- db48x 2y agoWhy would you grep for the emoji? The actual pattern you want to match is the standard format of the error message that proceeds it, which hasn’t changed in eons: my $line = "infinite-loop-linked-list.c:30:10: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop]"; grammar gcc { token filename { <-[:]>+ }; token linenumber { \d+ }; token colnumber { \d+ }; token severity { info|warning|error }; token message { .* $$ }; regex diagnostic { <filename> [\:] <linenumber> [\:] <colnumber> [\:]\s <severity> [\:]\s <message> }; token TOP { <diagnostic> }; } say gcc.parse($line); which when run produces the obvious output: 「infinite-loop-linked-list.c:30:10: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop]」 diagnostic => 「infinite-loop-linked-list.c:30:10: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop]」 filename => 「infinite-loop-linked-list.c」 linenumber => 「30」 colnumber => 「10」 severity => 「warning」 message => 「infinite loop [CWE-835] [-Wanalyzer-infinite-loop]」 I’ll leave handling filenames containing colons as an exercise for the reader. The emoji just focus the reader’s eye on the most critical line of the explanation.
- OptionOfT 2y agoSame with their ‘’ quotation marks. I've had cases where I was searching for "'something'", and it didn't find anything, because it was printed as "‘something’".