Changeset 98373 in vbox
- Timestamp:
- Feb 1, 2023 9:44:12 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155615
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bldprogs/scmrw.cpp
r98368 r98373 2602 2602 static bool scmKmkTailComment(KMKPARSER *pParser, const char *pchLine, size_t cchLine, size_t offSrc, char **ppszDst) 2603 2603 { 2604 /* Wind back offSrc to the first blank space (not all callers can do this). */ 2605 Assert(offSrc <= cchLine); 2606 while (offSrc > 0 && RT_C_IS_SPACE(pchLine[offSrc - 1])) 2607 offSrc--; 2604 2608 size_t const offSrcStart = offSrc; 2605 2609 … … 2626 2630 2627 2631 *ppszDst = pszDst = (char *)mempcpy(pszDst, &pchLine[offSrc], cchLine - offSrc); 2628 return cchLine - offSrcStart != (size_t)(pszDst - &pParser->szBuf[offDst]) 2629 || memcmp(&pParser->szBuf[offDst], &pchLine[offSrcStart], cchLine - offSrcStart) != 0; 2632 return false; /*dummy*/ 2630 2633 } 2631 2634 … … 2634 2637 pParser->iLine, offSrc, cchLine - offSrc, &pchLine[offSrc]); 2635 2638 *ppszDst = (char *)mempcpy(pszDst, &pchLine[offSrcStart], cchLine - offSrcStart); 2636 return false; 2639 return false; /*dummy*/ 2637 2640 } 2638 2641 … … 2640 2643 /** 2641 2644 * Deals with: ifeq, ifneq, if1of and ifn1of 2645 * 2646 * @returns dummy (false) to facility return + call. 2642 2647 */ 2643 2648 static bool scmKmkHandleIfParentheses(KMKPARSER *pParser, size_t offToken, KMKTOKEN enmToken, size_t cchToken, bool fElse) … … 2680 2685 pszDst += cchToken; 2681 2686 2682 size_t offSrc = offToken + cchToken; 2683 bool fModified = offSrc != (size_t)(pszDst - &pParser->szBuf[0]) 2684 || memcmp(pchLine, pszDst, offSrc) != 0; 2687 size_t offSrc = offToken + cchToken; 2685 2688 2686 2689 /* … … 2691 2694 else 2692 2695 { 2693 fModified = true;2694 2696 while (offSrc < cchLine && RT_C_IS_BLANK(pchLine[offSrc])) 2695 2697 offSrc++; … … 2702 2704 2703 2705 /* 2704 * There shall be no blanks after the opening parenthesis. 2705 */ 2706 if (RT_C_IS_SPACE(pchLine[offSrc])) 2707 { 2708 fModified = true; 2709 while (offSrc < cchLine && RT_C_IS_BLANK(pchLine[offSrc])) 2710 offSrc++; 2711 } 2706 * Skip spaces after the opening parenthesis. 2707 */ 2708 while (offSrc < cchLine && RT_C_IS_BLANK(pchLine[offSrc])) 2709 offSrc++; 2712 2710 2713 2711 /* … … 2725 2723 size_t cchCopy = offSrc - offSrcStart; 2726 2724 while (cchCopy > 0 && RT_C_IS_BLANK(pchLine[offSrcStart + cchCopy - 1])) 2727 {2728 fModified = true;2729 2725 cchCopy--; 2730 }2731 2726 2732 2727 pszDst = (char *)mempcpy(pszDst, &pchLine[offSrcStart], cchCopy); … … 2749 2744 } 2750 2745 while (offSrc < cchLine && RT_C_IS_BLANK(pchLine[offSrc])) 2751 {2752 fModified = true;2753 2746 offSrc++; 2754 }2755 2747 2756 2748 if (pchLine[offSrc] != ')') … … 2763 2755 size_t cchCopy = offSrc - offSrcStart; 2764 2756 while (cchCopy > 0 && RT_C_IS_BLANK(pchLine[offSrcStart + cchCopy - 1])) 2765 {2766 fModified = true;2767 2757 cchCopy--; 2768 }2769 2758 2770 2759 pszDst = (char *)mempcpy(pszDst, &pchLine[offSrcStart], cchCopy); … … 2780 2769 */ 2781 2770 if (offSrc < cchLine) 2782 fModified |=scmKmkTailComment(pParser, pchLine, cchLine, offSrc, &pszDst);2771 scmKmkTailComment(pParser, pchLine, cchLine, offSrc, &pszDst); 2783 2772 2784 2773 /* … … 2787 2776 *pszDst = '\0'; 2788 2777 ScmStreamPutLine(pParser->pOut, pParser->szBuf, pszDst - pParser->szBuf, pParser->enmEol); 2789 return f Modified;2778 return false; /* dummy */ 2790 2779 } 2791 2780 … … 2793 2782 /** 2794 2783 * Deals with: if, ifdef and ifndef 2784 * 2785 * @returns dummy (false) to facility return + call. 2795 2786 */ 2796 2787 static bool scmKmkHandleIfSpace(KMKPARSER *pParser, size_t offToken, KMKTOKEN enmToken, size_t cchToken, bool fElse) … … 2857 2848 pszDst += cchToken; 2858 2849 2859 size_t offSrc = offToken + cchToken; 2860 bool fModified = offSrc != (size_t)(pszDst - &pParser->szBuf[0]) 2861 || memcmp(pchLine, pszDst, offSrc) != 0; 2850 size_t offSrc = offToken + cchToken; 2862 2851 2863 2852 /* … … 2868 2857 while (offSrc < cchLine && RT_C_IS_BLANK(pchLine[offSrc])) 2869 2858 { 2870 fModified |= pchLine[offSrc] != ' ';2871 2859 cchSpaces++; 2872 2860 offSrc++; … … 2881 2869 if (enmToken != kKmkToken_if) 2882 2870 { 2883 fModified |= cchSpaces != 1;2884 2885 2871 size_t const offSrcStart = offSrc; 2886 2872 offSrc = scmKmkSkipExpString(pchLine, cchLine, offSrc, ' ', '\t'); /** @todo probably not entirely correct */ … … 2898 2884 /* Single line expression: Just assume the expression goes up to the 2899 2885 EOL or comment hash. Strip and copy as-is for now. */ 2900 fModified |= cchSpaces != 1;2901 2902 2886 const char *pchSrcHash = (const char *)memchr(&pchLine[offSrc], '#', cchLine - offSrc); 2903 2887 size_t cchExpr = pchSrcHash ? pchSrcHash - &pchLine[offSrc] : cchLine - offSrc; … … 2937 2921 "Bogus multi-line 'if' expression! Extra lines must start with operator (cchMaxLeadWord=%u).", 2938 2922 cchMaxLeadWord); 2939 fModified |= cchSpaces != cchMaxLeadWord + 1;2940 2923 memset(pszDst, ' ', cchMaxLeadWord); 2941 2924 pszDst += cchMaxLeadWord; … … 2975 2958 *pszDst = '\0'; 2976 2959 size_t cchDst = (size_t)(pszDst - pParser->szBuf); 2977 fModified |= cchDst != cchLine2978 || memcmp(pParser->szBuf, pchLine, cchLine) != 0;2979 2960 ScmStreamPutLine(pParser->pOut, pParser->szBuf, cchDst, pParser->enmEol); 2980 2961 … … 3029 3010 { 3030 3011 char * const pszDstSrc = pszDst; 3031 fModified |=scmKmkTailComment(pParser, pchLine, cchLine, offSrc, &pszDst);3012 scmKmkTailComment(pParser, pchLine, cchLine, offSrc, &pszDst); 3032 3013 *pszDst = '\0'; 3033 3014 … … 3046 3027 */ 3047 3028 ScmStreamPutLine(pParser->pOut, pParser->szBuf, pszDst - pParser->szBuf, pParser->enmEol); 3048 return f Modified;3029 return false; /* dummy */ 3049 3030 } 3050 3031 … … 3052 3033 /** 3053 3034 * Deals with: else 3035 * 3036 * @returns dummy (false) to facility return + call. 3054 3037 */ 3055 3038 static bool scmKmkHandleElse(KMKPARSER *pParser, size_t offToken) … … 3116 3099 3117 3100 offSrc = offToken + 4; 3118 bool fModified = offSrc != (size_t)(pszDst - &pParser->szBuf[0])3119 || memcmp(pchLine, pszDst, offSrc) != 0;3120 3101 3121 3102 /* … … 3123 3104 */ 3124 3105 if (offSrc < cchLine) 3125 fModified |=scmKmkTailComment(pParser, pchLine, cchLine, offSrc, &pszDst);3106 scmKmkTailComment(pParser, pchLine, cchLine, offSrc, &pszDst); 3126 3107 3127 3108 /* … … 3130 3111 *pszDst = '\0'; 3131 3112 ScmStreamPutLine(pParser->pOut, pParser->szBuf, pszDst - pParser->szBuf, pParser->enmEol); 3132 return f Modified;3113 return false; /* dummy */ 3133 3114 } 3134 3115 … … 3136 3117 /** 3137 3118 * Deals with: endif 3119 * 3120 * @returns dummy (false) to facility return + call. 3138 3121 */ 3139 3122 static bool scmKmkHandleEndif(KMKPARSER *pParser, size_t offToken) … … 3176 3159 pszDst = (char *)mempcpy(&pszDst[cchIndent], RT_STR_TUPLE("endif")); 3177 3160 3178 size_t offSrc = offToken + 5; 3179 bool fModified = offSrc != (size_t)(pszDst - &pParser->szBuf[0]) 3180 || memcmp(pchLine, pszDst, offSrc) != 0; 3161 size_t offSrc = offToken + 5; 3181 3162 3182 3163 /* … … 3184 3165 */ 3185 3166 if (offSrc < cchLine) 3186 fModified |=scmKmkTailComment(pParser, pchLine, cchLine, offSrc, &pszDst);3167 scmKmkTailComment(pParser, pchLine, cchLine, offSrc, &pszDst); 3187 3168 3188 3169 /* … … 3191 3172 *pszDst = '\0'; 3192 3173 ScmStreamPutLine(pParser->pOut, pParser->szBuf, pszDst - pParser->szBuf, pParser->enmEol); 3193 return f Modified;3174 return false; /* dummy */ 3194 3175 } 3195 3176 … … 3207 3188 ScmStreamPutLine(pParser->pOut, pParser->pchLine, pParser->cchLine, pParser->enmEol); 3208 3189 } 3209 return false; 3190 return false; /* dummy */ 3210 3191 } 3211 3192 … … 3213 3194 /** 3214 3195 * For dealing with a directive w/o special formatting rules (yet). 3196 * 3197 * @returns dummy (false) to facility return + call. 3215 3198 */ 3216 3199 static bool scmKmkHandleSimple(KMKPARSER *pParser, size_t offToken, bool fIndentIt = true) … … 3227 3210 ScmStreamPutEol(pParser->pOut, pParser->enmEol); 3228 3211 3229 bool fModified = cchIndent != offToken3230 || !memcmp(pchLine, g_szSpaces, cchIndent);3231 3232 3212 /* 3233 3213 * Check for line continuation and output concatenated lines. 3234 3214 */ 3235 3215 scmKmkPassThruLineContinuationLines(pParser); 3236 return f Modified;3216 return false; /* dummy */ 3237 3217 } 3238 3218 … … 3267 3247 3268 3248 3249 /** 3250 * @returns dummy (false) to facility return + call. 3251 */ 3269 3252 static bool scmKmkHandleAssignment2(KMKPARSER *pParser, size_t offVarStart, size_t offVarEnd, KMKASSIGNTYPE enmType, 3270 3253 size_t offAssignOp, unsigned fFlags) … … 3328 3311 Assert(iSubLine + 1 < cLines); 3329 3312 pParser->pchLine = pchLine = ScmStreamGetLine(pParser->pIn, &pParser->cchLine, &pParser->enmEol); 3330 AssertReturn(pchLine, true);3313 AssertReturn(pchLine, false /*dummy*/); 3331 3314 cchLine = pParser->cchLine; 3332 3315 iSubLine++; … … 3391 3374 * Skip space till we hit the value or comment. 3392 3375 */ 3393 size_t cchSpaces = 0;3394 3376 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3395 cchSpaces++,offLine++;3377 offLine++; 3396 3378 3397 3379 /** @todo this block can probably be merged into the final loop below. */ 3398 3380 unsigned cPendingEols = 0; 3399 bool fModified = false;3400 3381 unsigned const iSubLineStart1 = iSubLine; 3401 3382 while (iSubLine + 1 < cLines && offLine + 1 == cchLine && pchLine[offLine] == '\\') 3402 3383 { 3403 3384 pParser->pchLine = pchLine = ScmStreamGetLine(pParser->pIn, &pParser->cchLine, &pParser->enmEol); 3404 AssertReturn(pchLine, f Modified);3385 AssertReturn(pchLine, false /*dummy*/); 3405 3386 cchLine = pParser->cchLine; 3406 3387 iSubLine++; … … 3415 3396 cPendingEols = 1; 3416 3397 3417 /* Deal withindent/whitespace. */3398 /* Skip indent/whitespace. */ 3418 3399 offLine = 0; 3419 if ( memcmp(pchLine, g_szSpaces, cchIndent) == 03420 && pchLine[cchIndent] == '\t')3421 offLine = cchIndent + 1;3422 cchSpaces = 0;3423 3400 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3424 cchSpaces++, offLine++; 3425 fModified |= cchSpaces != 0 && pchLine[offLine] != '#'; 3426 } 3427 fModified |= iSubLine > iSubLineStart1 + 1; 3401 offLine++; 3402 } 3428 3403 3429 3404 /* … … 3440 3415 *pszDst = '\0'; 3441 3416 ScmStreamPutLine(pParser->pOut, pParser->szBuf, pszDst - pParser->szBuf, pParser->enmEol); 3442 return f Modified || cPendingEols > 0;3417 return false; /* dummy */ 3443 3418 } 3444 3419 … … 3454 3429 else 3455 3430 { 3456 fModified |= cPendingEols > 2;3457 3431 cPendingEols = RT_MIN(2, cPendingEols); /* reduce to two, i.e. only one empty separator line */ 3458 3432 do … … 3478 3452 Assert(offValueEnd > offLine); 3479 3453 3480 fModified |= !pchHash && offValueEnd != cchLine - (iSubLine + 1 < cLines ? 2 : 0);3481 3482 3454 /* Append the value part we found. */ 3483 3455 pszDst = (char *)mempcpy(pszDst, &pchLine[offLine], offValueEnd - offLine); … … 3493 3465 { 3494 3466 if (cPendingEols == 0) 3495 scmKmkTailComment(pParser, pchLine, cchLine, offLine - cchSpaces, &pszDst);3467 scmKmkTailComment(pParser, pchLine, cchLine, offLine, &pszDst); 3496 3468 size_t const cchDst = (size_t)(pszDst - pParser->szBuf); 3497 3469 *pszDst = '\0'; 3498 3470 ScmStreamPutLine(pParser->pOut, pParser->szBuf, cchDst, pParser->enmEol); 3499 fModified |= cPendingEols > 03500 || cchLine != cchDst3501 || memcmp(pParser->szBuf, pchLine, cchLine) != 0;3502 3471 3503 3472 if (cPendingEols > 1) … … 3507 3476 ScmStreamPutLine(pParser->pOut, pchLine, cchLine, pParser->enmEol); 3508 3477 scmKmkPassThruLineContinuationLines(pParser); 3509 return f Modified;3478 return false; /* dummy */ 3510 3479 } 3511 3480 … … 3522 3491 { 3523 3492 pParser->pchLine = pchLine = ScmStreamGetLine(pParser->pIn, &pParser->cchLine, &pParser->enmEol); 3524 AssertReturn(pchLine, f Modified);3493 AssertReturn(pchLine, false /*dummy*/); 3525 3494 cchLine = pParser->cchLine; 3526 3495 iSubLine++; … … 3539 3508 /* Deal with indent/whitespace. */ 3540 3509 offLine = 0; 3541 if ( memcmp(pchLine, g_szSpaces, cchIndent) == 03542 && pchLine[cchIndent] == '\t')3543 offLine = cchIndent + 1;3544 cchSpaces = 0;3545 3510 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3546 cchSpaces++, offLine++; 3547 fModified |= cchSpaces != 0 && pchLine[offLine] != '#'; 3511 offLine++; 3548 3512 } 3549 fModified |= iSubLine > iSubLineStart2 + 1;3550 3513 } 3551 3514 } … … 3557 3520 * 3558 3521 * This is a bit involved. Sigh. 3522 * 3523 * @returns dummy (false) to facility return + call. 3559 3524 */ 3560 3525 static bool scmKmkHandleRule(KMKPARSER *pParser, size_t offFirstWord, bool fDoubleColon, size_t offColon) … … 3582 3547 * Indent it. 3583 3548 */ 3584 bool fModified = offFirstWord != cchIndent3585 || memcmp(pchLine, g_szSpaces, cchIndent) != 0;3586 3549 ScmStreamWrite(pOut, g_szSpaces, cchIndent); 3587 3550 size_t offLine = offFirstWord; … … 3604 3567 3605 3568 /* Skip whitespace (if any). */ 3606 size_t cchSpaces = 0;3607 3569 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3608 {3609 fModified |= pchLine[offLine] != ' ';3610 cchSpaces++;3611 3570 offLine++; 3612 }3613 3571 3614 3572 /* Have we reached the colon already? */ 3615 3573 if (offLine >= offColon) 3616 3574 { 3617 fModified |= cchSpaces != 0;3618 3619 3575 Assert(pchLine[offLine] == ':'); 3620 3576 Assert(!fDoubleColon || pchLine[offLine + 1] == ':'); … … 3630 3586 if (offLine + 1 == cchLine && pchLine[offLine] == '\\') 3631 3587 { 3632 fModified |= cchSpaces > 1;3633 3634 3588 /* Get the next input line. */ 3635 3589 for (;;) … … 3638 3592 Assert(iSubLine + 1 < cLines); 3639 3593 pParser->pchLine = pchLine = ScmStreamGetLine(pParser->pIn, &pParser->cchLine, &pParser->enmEol); 3640 AssertReturn(pchLine, f Modified);3594 AssertReturn(pchLine, false /*dummy*/); 3641 3595 cchLine = pParser->cchLine; 3642 3596 iSubLine++; … … 3651 3605 offLine = 0; 3652 3606 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3653 {3654 fModified |= pchLine[offLine] != ' ';3655 3607 offLine++; 3656 }3657 fModified |= offLine == cchIndent3658 || memcmp(pchLine, g_szSpaces, cchIndent) != 0;3659 3608 3660 3609 /* Just drop empty lines. */ 3661 3610 if (offLine + 1 == cchLine && pchLine[offLine] == '\\') 3662 {3663 fModified = true;3664 3611 continue; 3665 }3666 3612 3667 3613 /* Complete the current line and emit indent, unless we reached the colon: */ 3668 3614 if (offLine >= offColon) 3669 3615 { 3670 fModified = true;3671 3616 Assert(pchLine[offLine] == ':'); 3672 3617 Assert(!fDoubleColon || pchLine[offLine + 1] == ':'); … … 3688 3633 } 3689 3634 else 3690 {3691 fModified |= cchSpaces != 1;3692 3635 ScmStreamPutCh(pOut, ' '); 3693 }3694 3636 enmCtx = kKmkWordCtx_TargetFile; 3695 3637 } … … 3700 3642 */ 3701 3643 /* Skip spaces - there should be exactly one. */ 3702 fModified |= pchLine[offLine] != ' '; 3703 if (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3644 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3704 3645 offLine++; 3705 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine]))3706 {3707 fModified = true;3708 offLine++;3709 }3710 3646 3711 3647 /* Deal with new lines: */ … … 3716 3652 Assert(iSubLine + 1 < cLines); 3717 3653 pParser->pchLine = pchLine = ScmStreamGetLine(pParser->pIn, &pParser->cchLine, &pParser->enmEol); 3718 AssertReturn(pchLine, f Modified);3654 AssertReturn(pchLine, false /*dummy*/); 3719 3655 cchLine = pParser->cchLine; 3720 3656 iSubLine++; … … 3724 3660 /* Skip leading spaces. */ 3725 3661 offLine = 0; 3726 if (memcmp(pchLine, g_szSpaces, cchIndent) == 0 && pchLine[cchIndent] == '\t' && pchLine[cchIndent + 1] == '\t')3727 offLine += cchIndent + 2;3728 3662 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3729 {3730 fModified = true;3731 3663 offLine++; 3732 }3733 3664 3734 3665 /* Just drop empty lines. */ 3735 3666 if (offLine + 1 == cchLine && pchLine[offLine] == '\\') 3736 {3737 fModified = true;3738 3667 continue; 3739 }3740 3668 } 3741 3669 … … 3746 3674 { 3747 3675 ScmStreamPutEol(pOut, pParser->enmEol); 3748 return f Modified;3676 return false /*dummy*/; 3749 3677 } 3750 3678 … … 3753 3681 * (Pattern rules will also end up here, but we'll just ignore that for now.) 3754 3682 */ 3755 /** @todo fModified isn't updated right here. */3756 3683 enmCtx = kKmkWordCtx_DepFileOrAssignment; 3757 3684 for (;;) … … 3780 3707 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3781 3708 { 3782 fModified |= pchLine[offLine] != ' ';3783 3709 cchSpaces++; 3784 3710 offLine++; … … 3788 3714 if (iSubLine + 1 < cLines && offLine + 1 == cchLine && pchLine[offLine] == '\\') 3789 3715 { 3790 fModified |= cchSpaces > 1;3791 3792 3716 /* Get the next input line. */ 3793 3717 unsigned cEmptyLines = 0; … … 3796 3720 Assert(iSubLine + 1 < cLines); 3797 3721 pParser->pchLine = pchLine = ScmStreamGetLine(pParser->pIn, &pParser->cchLine, &pParser->enmEol); 3798 AssertReturn(pchLine, f Modified);3722 AssertReturn(pchLine, false /*dummy*/); 3799 3723 cchLine = pParser->cchLine; 3800 3724 iSubLine++; … … 3804 3728 /* Skip leading spaces. */ 3805 3729 offLine = 0; 3806 if (memcmp(pchLine, g_szSpaces, cchIndent) == 0 && pchLine[cchIndent] == '\t' && pchLine[cchIndent + 1] == '\t')3807 offLine += cchIndent + 2;3808 3730 while (offLine < cchLine && RT_C_IS_SPACE(pchLine[offLine])) 3809 {3810 fModified = true;3811 3731 offLine++; 3812 }3813 3732 3814 3733 /* Just drop empty lines, we'll re-add one of them afterward if we find more dependencies. */ … … 3822 3741 break; 3823 3742 } 3824 cchSpaces = 1; 3825 } 3826 3827 if (offLine < cchLine) 3828 fModified |= cchSpaces != 1; 3829 else 3743 } 3744 3745 if (offLine >= cchLine) 3830 3746 { 3831 3747 /* End of input. */ … … 3833 3749 Assert(iSubLine + 1 == cLines); 3834 3750 ScmStreamPutEol(pOut, pParser->enmEol); 3835 return f Modified;3751 return false; /* dummmy */ 3836 3752 } 3837 3753 enmCtx = kKmkWordCtx_DepFile; … … 4014 3930 * Rewrite a kBuild makefile. 4015 3931 * 4016 * @returns Modification state.3932 * @returns kScmMaybeModified or kScmUnmodified. 4017 3933 * @param pIn The input stream. 4018 3934 * @param pOut The output stream. … … 4046 3962 * Iterate the file. 4047 3963 */ 4048 bool fModified = false;4049 3964 const char *pchLine; 4050 3965 while ((Parser.pchLine = pchLine = ScmStreamGetLine(pIn, &Parser.cchLine, &Parser.enmEol)) != NULL) … … 4096 4011 case kKmkToken_if1of: 4097 4012 case kKmkToken_ifn1of: 4098 fModified |=scmKmkHandleIfParentheses(&Parser, offLine, enmToken, cchWord, false /*fElse*/);4013 scmKmkHandleIfParentheses(&Parser, offLine, enmToken, cchWord, false /*fElse*/); 4099 4014 continue; 4100 4015 … … 4102 4017 case kKmkToken_ifndef: 4103 4018 case kKmkToken_if: 4104 fModified |=scmKmkHandleIfSpace(&Parser, offLine, enmToken, cchWord, false /*fElse*/);4019 scmKmkHandleIfSpace(&Parser, offLine, enmToken, cchWord, false /*fElse*/); 4105 4020 continue; 4106 4021 4107 4022 case kKmkToken_else: 4108 fModified |=scmKmkHandleElse(&Parser, offLine);4023 scmKmkHandleElse(&Parser, offLine); 4109 4024 continue; 4110 4025 4111 4026 case kKmkToken_endif: 4112 fModified |=scmKmkHandleEndif(&Parser, offLine);4027 scmKmkHandleEndif(&Parser, offLine); 4113 4028 continue; 4114 4029 … … 4120 4035 case kKmkToken_includedep_queue: 4121 4036 case kKmkToken_includedep_flush: 4122 fModified |=scmKmkHandleSimple(&Parser, offLine);4037 scmKmkHandleSimple(&Parser, offLine); 4123 4038 continue; 4124 4039 4125 4040 /* Others: */ 4126 4041 case kKmkToken_define: 4127 fModified |=scmKmkHandleDefine(&Parser, offLine);4042 scmKmkHandleDefine(&Parser, offLine); 4128 4043 continue; 4129 4044 case kKmkToken_endef: 4130 fModified |=scmKmkHandleEndef(&Parser, offLine);4045 scmKmkHandleEndef(&Parser, offLine); 4131 4046 continue; 4132 4047 4133 4048 case kKmkToken_override: 4134 4049 case kKmkToken_local: 4135 fModified |=scmKmkHandleAssignKeyword(&Parser, offLine, enmToken, cchWord, true /*fMustBeAssignment*/);4050 scmKmkHandleAssignKeyword(&Parser, offLine, enmToken, cchWord, true /*fMustBeAssignment*/); 4136 4051 continue; 4137 4052 4138 4053 case kKmkToken_export: 4139 fModified |=scmKmkHandleAssignKeyword(&Parser, offLine, enmToken, cchWord, false /*fMustBeAssignment*/);4054 scmKmkHandleAssignKeyword(&Parser, offLine, enmToken, cchWord, false /*fMustBeAssignment*/); 4140 4055 continue; 4141 4056 4142 4057 case kKmkToken_unexport: 4143 4058 case kKmkToken_undefine: 4144 fModified |=scmKmkHandleSimple(&Parser, offLine);4059 scmKmkHandleSimple(&Parser, offLine); 4145 4060 break; 4146 4061 … … 4158 4073 if (scmKmkIsLineWithContinuation(pchLine, cchLine)) 4159 4074 Parser.cchTotalLine = scmKmkLineContinuationPeek(&Parser, &Parser.cLines, NULL); 4160 fModified |=scmKmkHandleAssignmentOrRule(&Parser, offLine);4075 scmKmkHandleAssignmentOrRule(&Parser, offLine); 4161 4076 continue; 4162 4077 } … … 4180 4095 } 4181 4096 4182 return fModified ? kScmModified : kScmUnmodified;4097 return kScmMaybeModified; /* Make the caller check */ 4183 4098 } 4184 4099
Note:
See TracChangeset
for help on using the changeset viewer.