Idiomatically determine all the characters that can be used for symbols: Difference between revisions
Content added Content deleted
(→{{header|AWK}}: fix indentation) |
(→{{header|AWK}}: fix the code) |
||
Line 21: | Line 21: | ||
function is_valid_identifier(id, rc) { |
function is_valid_identifier(id, rc) { |
||
fn = "is_valid_identifier.awk" |
fn = "is_valid_identifier.awk" |
||
printf("function unused(%s) {}\n", id, id) >fn |
printf("function unused(%s) { arr[%s] = 1 }\n", id, id, id) >fn |
||
printf("BEGIN { exit(0) }\n") >>fn |
|||
close(fn) |
close(fn) |
||
Line 49: | Line 49: | ||
length(bad2), length(good2), good2) |
length(bad2), length(good2), good2) |
||
exit(0) |
exit(0) |
||
⚫ | |||
} |
|||
⚫ | |||
<p>output:</p> |
<p>output:</p> |
||
<pre> |
<pre> |