diff options
| author | Syndamia <kamen@syndamia.com> | 2023-11-23 16:38:01 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2023-11-23 16:38:01 +0200 |
| commit | 6afd6f91b8c15a29653e73917e753147c23d0473 (patch) | |
| tree | 983601538ecc1b8472f7f09a88a93f8f324a8634 /preproc.awk | |
| parent | 80b01cc3fde8ca45cb57b4794baafbd227b5c319 (diff) | |
| download | csma-6afd6f91b8c15a29653e73917e753147c23d0473.tar csma-6afd6f91b8c15a29653e73917e753147c23d0473.tar.gz csma-6afd6f91b8c15a29653e73917e753147c23d0473.zip | |
[preproc] Fixed no substitution when there are stuff after a macro name on the start of a line
Diffstat (limited to 'preproc.awk')
| -rw-r--r-- | preproc.awk | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/preproc.awk b/preproc.awk index b574edf..c9bcb07 100644 --- a/preproc.awk +++ b/preproc.awk @@ -163,18 +163,20 @@ stage2 && macroNameOnly { } stage2 && /^[[:blank:]]*<[^>]*>/ { - match($0, /<[^>]*>/) # If we found a definition if ($0 ~ "{") { macroName = "" depth = gsub("{", "{") - gsub("}", "}") + next } - # Macro name could begin a potential definition, with a "{" on a new line - else { + # If there isn't anything nonblank after the macro name then it might + # be the name of a potential definition, with a "{" on another line + else if (match($0, /<[^>]*>[[:blank:]]*[^[:blank:]]/) == 0) { + match($0, /<[^>]*>/) macroName = substr($0, RSTART, RLENGTH) macroNameOnly = 1 + next } - next } # Outside definition |
