head 1.15; access; symbols netbsd-11-0-RELEASE:1.15 netbsd-11-0-RC7:1.15 netbsd-11-0-RC6:1.15 netbsd-11-0-RC5:1.15 netbsd-11-0-RC4:1.15 netbsd-11-0-RC3:1.15 netbsd-11-0-RC2:1.15 netbsd-11-0-RC1:1.15 perseant-exfatfs-base-20250801:1.15 netbsd-11:1.15.0.2 netbsd-11-base:1.15 netbsd-10-1-RELEASE:1.8 perseant-exfatfs-base-20240630:1.9 perseant-exfatfs:1.9.0.2 perseant-exfatfs-base:1.9 netbsd-10-0-RELEASE:1.8 netbsd-10-0-RC6:1.8 netbsd-10-0-RC5:1.8 netbsd-10-0-RC4:1.8 netbsd-10-0-RC3:1.8 netbsd-10-0-RC2:1.8 netbsd-10-0-RC1:1.8 netbsd-10:1.8.0.2 netbsd-10-base:1.8 cjep_sun2x-base1:1.6 cjep_sun2x:1.6.0.4 cjep_sun2x-base:1.6 cjep_staticlib_x-base1:1.6 cjep_staticlib_x:1.6.0.2 cjep_staticlib_x-base:1.6; locks; strict; comment @# @; 1.15 date 2025.06.28.22.39.28; author rillig; state Exp; branches; next 1.14; commitid CDDpACH2g2jV3I0G; 1.14 date 2025.03.30.09.51.50; author rillig; state Exp; branches; next 1.13; commitid veGmSzVhPiW2G4PF; 1.13 date 2024.08.07.05.48.45; author rillig; state Exp; branches; next 1.12; commitid 47ynnDNk34RkTQkF; 1.12 date 2024.08.07.05.37.11; author rillig; state Exp; branches; next 1.11; commitid mde95flOZSqSQQkF; 1.11 date 2024.08.06.17.46.01; author rillig; state Exp; branches; next 1.10; commitid aC6PdWQrVs87VMkF; 1.10 date 2024.07.06.21.21.10; author rillig; state Exp; branches; next 1.9; commitid LsFFr28ufjag6PgF; 1.9 date 2023.06.01.20.56.35; author rillig; state Exp; branches 1.9.2.1; next 1.8; commitid j3tIvMRlxolKQhrE; 1.8 date 2022.01.07.19.30.17; author rillig; state Exp; branches; next 1.7; commitid hjUxyIjFvzoiMJnD; 1.7 date 2021.12.12.08.36.21; author rillig; state Exp; branches; next 1.6; commitid c8APVLaBsQWHZkkD; 1.6 date 2021.01.22.00.12.01; author rillig; state Exp; branches; next 1.5; commitid dn6ro0QYjaafBEEC; 1.5 date 2020.11.15.14.07.53; author rillig; state Exp; branches; next 1.4; commitid 9mJf8QxpSpxVpZvC; 1.4 date 2020.11.10.20.44.18; author rillig; state Exp; branches; next 1.3; commitid cg0PkjqsCDIEMnvC; 1.3 date 2020.11.10.19.36.50; author rillig; state Exp; branches; next 1.2; commitid 9oeUktk3qhnvpnvC; 1.2 date 2020.11.08.21.40.13; author rillig; state Exp; branches; next 1.1; commitid eqcNg08ClV7S98vC; 1.1 date 2020.08.20.17.45.47; author rillig; state Exp; branches; next ; commitid lI6ajHLKaFDRqPkC; 1.9.2.1 date 2025.08.02.05.58.31; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.15 log @make: consistently use double quotes in error messages Previously, some error messages used single quotes, very few used backticks or parentheses, most already used double quotes. While here, reword a few error messages to be clearer or more consistent with related error messages. @ text @make: cond-func.mk:37: Missing ")" after argument "A" for "defined" make: cond-func.mk:53: Missing ")" after argument "A" for "defined" make: cond-func.mk:57: Missing ")" after argument "A" for "defined" make: cond-func.mk:91: Unknown operator "&" make: cond-func.mk:107: A plain function name is parsed as defined(...). make: cond-func.mk:115: A plain function name is parsed as defined(...). make: cond-func.mk:126: Symbols may start with a function name. make: cond-func.mk:132: Symbols may start with a function name. make: cond-func.mk:138: Missing ")" after argument "" for "defined" make: cond-func.mk:145: Missing ")" after argument "${:UVARNAME}.param" for "defined" make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 @ 1.14 log @make: use '"filename" line 123' for locations instead of 'filename:123' The format 'filename:123' is commonly used for identifying a location in a file. Text editors recognize it and allow quick navigation through it. The previous format was specific to make and would have required custom support in editors. The new format was already used in stack traces, except for the first line. Now all lines use the same format. @ text @d1 4 a4 4 make: cond-func.mk:37: Missing ')' after argument 'A' for 'defined' make: cond-func.mk:53: Missing ')' after argument 'A' for 'defined' make: cond-func.mk:57: Missing ')' after argument 'A' for 'defined' make: cond-func.mk:91: Unknown operator '&' d9 2 a10 2 make: cond-func.mk:138: Missing ')' after argument '' for 'defined' make: cond-func.mk:145: Missing ')' after argument '${:UVARNAME}.param' for 'defined' @ 1.13 log @make: in erroneous conditions, report the non-expanded text In a condition, when a function call expression is missing its closing parenthesis, there's no point in having the expanded argument text in the error message. When parsing a bare word in a condition, the trailing space was included in that word, which was inconsistent, as the leading space was not included either. Removing the trailing space from the word reduces the cases where a multiple-inclusion guard steps in, but only in an edge case that is irrelevant in practice. @ text @d1 10 a10 10 make: "cond-func.mk" line 37: Missing ')' after argument 'A' for 'defined' make: "cond-func.mk" line 53: Missing ')' after argument 'A' for 'defined' make: "cond-func.mk" line 57: Missing ')' after argument 'A' for 'defined' make: "cond-func.mk" line 91: Unknown operator '&' make: "cond-func.mk" line 107: A plain function name is parsed as defined(...). make: "cond-func.mk" line 115: A plain function name is parsed as defined(...). make: "cond-func.mk" line 126: Symbols may start with a function name. make: "cond-func.mk" line 132: Symbols may start with a function name. make: "cond-func.mk" line 138: Missing ')' after argument '' for 'defined' make: "cond-func.mk" line 145: Missing ')' after argument '${:UVARNAME}.param' for 'defined' @ 1.12 log @tests/make: demonstrate unintended parsing of words in conditions A word is not supposed to include its trailing space, as it doesn't contain its leading space either. @ text @d10 1 a10 1 make: "cond-func.mk" line 146: Missing ')' after argument 'VARNAME.param' for 'defined' @ 1.11 log @make: add details to error messages about missing ')' @ text @d10 1 @ 1.10 log @make: error out on conditions containing the operators '&' and '|' These abbreviated variants of the '&&' and '||' operators were never documented, so error out in non-lint mode as well. @ text @d1 3 a3 3 make: "cond-func.mk" line 37: Missing closing parenthesis for defined() make: "cond-func.mk" line 53: Missing closing parenthesis for defined() make: "cond-func.mk" line 57: Missing closing parenthesis for defined() d9 1 a9 1 make: "cond-func.mk" line 138: Missing closing parenthesis for defined() @ 1.9 log @tests/make: force line-based diagnostics to be listed in the tests This way, contradictions between the intended output and the actual output are closer together and have a better chance of being spotted. @ text @d4 6 a9 6 make: "cond-func.mk" line 98: The empty variable is never defined. make: "cond-func.mk" line 108: A plain function name is parsed as defined(...). make: "cond-func.mk" line 116: A plain function name is parsed as defined(...). make: "cond-func.mk" line 127: Symbols may start with a function name. make: "cond-func.mk" line 133: Symbols may start with a function name. make: "cond-func.mk" line 139: Missing closing parenthesis for defined() @ 1.9.2.1 log @Sync with HEAD @ text @d1 9 a9 10 make: cond-func.mk:37: Missing ")" after argument "A" for "defined" make: cond-func.mk:53: Missing ")" after argument "A" for "defined" make: cond-func.mk:57: Missing ")" after argument "A" for "defined" make: cond-func.mk:91: Unknown operator "&" make: cond-func.mk:107: A plain function name is parsed as defined(...). make: cond-func.mk:115: A plain function name is parsed as defined(...). make: cond-func.mk:126: Symbols may start with a function name. make: cond-func.mk:132: Symbols may start with a function name. make: cond-func.mk:138: Missing ")" after argument "" for "defined" make: cond-func.mk:145: Missing ")" after argument "${:UVARNAME}.param" for "defined" @ 1.8 log @tests/make: fix documentation in cond-func.mk @ text @d1 9 a9 9 make: "cond-func.mk" line 36: Missing closing parenthesis for defined() make: "cond-func.mk" line 51: Missing closing parenthesis for defined() make: "cond-func.mk" line 54: Missing closing parenthesis for defined() make: "cond-func.mk" line 94: The empty variable is never defined. make: "cond-func.mk" line 103: A plain function name is parsed as defined(...). make: "cond-func.mk" line 110: A plain function name is parsed as defined(...). make: "cond-func.mk" line 120: Symbols may start with a function name. make: "cond-func.mk" line 125: Symbols may start with a function name. make: "cond-func.mk" line 131: Missing closing parenthesis for defined() @ 1.7 log @make: generate more specific error message on malformed conditional @ text @d5 5 a9 5 make: "cond-func.mk" line 102: A plain function name is parsed as !empty(...). make: "cond-func.mk" line 109: A plain function name is parsed as !empty(...). make: "cond-func.mk" line 119: Symbols may start with a function name. make: "cond-func.mk" line 124: Symbols may start with a function name. make: "cond-func.mk" line 130: Missing closing parenthesis for defined() @ 1.6 log @make(1): remove "warning" from missing closing parenthesis This only affects the diagnostics for parse errors that involve a missing closing parenthesis. Whether or not this is a parse error is still the same. It may look redundant to pass both the CondParser and the parsing position pp to the functions, but that's necessary since during parsing, not every code path updates the main parsing position immediately. @ text @d9 1 a9 1 make: "cond-func.mk" line 130: Malformed conditional (defined() @ 1.5 log @make(1): clean up some tests Fix some mistakes in comments. Improve some comments to be easier understandable. Inline variables that are irrelevant for the test at hand (RUN, MAKE_CMD). Remove references to functions and constants that have since been removed or renamed. @ text @d1 3 a3 6 make: "cond-func.mk" line 36: warning: Missing closing parenthesis for defined() make: "cond-func.mk" line 36: Malformed conditional (!defined(A B)) make: "cond-func.mk" line 51: warning: Missing closing parenthesis for defined() make: "cond-func.mk" line 51: Malformed conditional (!defined(A&B)) make: "cond-func.mk" line 54: warning: Missing closing parenthesis for defined() make: "cond-func.mk" line 54: Malformed conditional (!defined(A|B)) @ 1.4 log @make(1): add tests for parsing conditionals, document a parsing bug @ text @d1 12 a12 12 make: "cond-func.mk" line 34: warning: Missing closing parenthesis for defined() make: "cond-func.mk" line 34: Malformed conditional (!defined(A B)) make: "cond-func.mk" line 49: warning: Missing closing parenthesis for defined() make: "cond-func.mk" line 49: Malformed conditional (!defined(A&B)) make: "cond-func.mk" line 52: warning: Missing closing parenthesis for defined() make: "cond-func.mk" line 52: Malformed conditional (!defined(A|B)) make: "cond-func.mk" line 92: The empty variable is never defined. make: "cond-func.mk" line 100: A plain function name is parsed as !empty(...). make: "cond-func.mk" line 107: A plain function name is parsed as !empty(...). make: "cond-func.mk" line 117: Symbols may start with a function name. make: "cond-func.mk" line 122: Symbols may start with a function name. make: "cond-func.mk" line 128: Malformed conditional (defined() @ 1.3 log @make(1): add tests for edge cases in parsing conditionals @ text @d12 1 @ 1.2 log @make(1): add test for function argument with unbalanced braces @ text @d7 5 @ 1.1 log @make(1): add test for parsing functions in .if conditions @ text @d1 6 a6 6 make: "cond-func.mk" line 29: warning: Missing closing parenthesis for defined() make: "cond-func.mk" line 29: Malformed conditional (!defined(A B)) make: "cond-func.mk" line 44: warning: Missing closing parenthesis for defined() make: "cond-func.mk" line 44: Malformed conditional (!defined(A&B)) make: "cond-func.mk" line 47: warning: Missing closing parenthesis for defined() make: "cond-func.mk" line 47: Malformed conditional (!defined(A|B)) @