Skip to content

Commit

Permalink
Fixed ESCT/L/E
Browse files Browse the repository at this point in the history
.../p:Platform="Any CPU"
    CPU"" was unexpected at this time.
  • Loading branch information
3F committed Feb 12, 2024
1 parent ee5a002 commit 4b72654
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frontend.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ if not defined __p_call set args=%args:^=^^%
:: # hMSBuild ^^ - ^^

:: PARSER NOTE: keep \r\n because `&` requires enableDelayedExpansion
set esc=%args:!=L% ::&:
set esc=%esc:^=T% ::&:
set esc=%args:!= L % ::&:
set esc=%esc:^= T % ::&:
setlocal enableDelayedExpansion

:: https://github.com/3F/hMSBuild/issues/7
Expand Down Expand Up @@ -374,9 +374,9 @@ set /a "idx+=1" & if %idx% LSS !amax! goto loopargs

:: We don't need double quotes (e.g. set "msbargs=...") because this should already
:: contain special symbols inside "..." (e.g. /p:prop="...").
set msbargs=%msbargs:T=^% ::&:
set msbargs=%msbargs:L=^!% ::&:
set msbargs=!msbargs:E==! ::&:
set msbargs=%msbargs: T =^% ::&:
set msbargs=%msbargs: L =^!% ::&:
set msbargs=!msbargs: E ==! ::&:

:_msbargs
call :dbgprint "Arguments: " msbargs
Expand Down Expand Up @@ -723,7 +723,7 @@ exit /B 0

call :nqa %1 !_ieqargs! %3 & exit /B 0

) else set _ieqargs=%%aE%%b
) else set _ieqargs=%%a E %%b
)
goto _eqp
:nqa
Expand Down Expand Up @@ -755,9 +755,9 @@ exit /B 0

:: data from %..% below should not contain double quotes, thus we need to protect this:

set "_vl=%_vl:T=^%" ::&:
set "_vl=%_vl:L=^!%" ::&:
set _vl=!_vl:E==! ::&:
set "_vl=%_vl: T =^%" ::&:
set "_vl=%_vl: L =^!%" ::&:
set _vl=!_vl: E ==! ::&:

set %2=!_vl!
exit /B 0
Expand Down
47 changes: 47 additions & 0 deletions tests/keysAndLogicTests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,53 @@ set "exec=%~3" & set "wdir=%~4"
::_____________________________________________________


::_______ ------ ______________________________________

call a startTest "-debug /p:Platform=`Any CPU` " 1 || goto x
call a findInStreamOrFail "Arguments:" 4,n || goto x
call a msgOrFailAt !n! "/p:Platform" || goto x
call a msgOrFailAt !n! "`Any CPU`" || goto x
call a completeTest
::_____________________________________________________


::_______ ------ ______________________________________

call a startTest "-debug -only-path /p:Platform=`Any CPU` " || goto x
call a msgOrFailAt 1 "non-handled key: /p:Platform" || goto x
call a msgOrFailAt 2 "non-handled key: " || goto x
call a msgOrFailAt 3 "non-handled key: `Any CPU`" || goto x
call a completeTest
::_____________________________________________________


::_______ ------ ______________________________________

call a startTest "-debug /p:Configuration=`Public Release` " 1 || goto x
call a findInStreamOrFail "Arguments:" 4,n || goto x
call a msgOrFailAt !n! "/p:Configuration" || goto x
call a msgOrFailAt !n! "`Public Release`" || goto x
call a completeTest
::_____________________________________________________


::_______ ------ ______________________________________

call a startTest "-debug /p:Configuration=`Public Release` /p:Platform=`Any CPU`" 1 || goto x
call a msgOrFailAt 1 "non-handled key: /p:Configuration" || goto x
call a msgOrFailAt 2 "non-handled key: " || goto x
call a msgOrFailAt 3 "non-handled key: `Public Release`" || goto x
call a msgOrFailAt 4 "non-handled key: /p:Platform" || goto x
call a msgOrFailAt 5 "non-handled key: " || goto x
call a msgOrFailAt 6 "non-handled key: `Any CPU`" || goto x
call a findInStreamOrFail "Arguments:" 7,n || goto x
call a msgOrFailAt !n! "/p:Configuration" || goto x
call a msgOrFailAt !n! "`Public Release` /p:Platform" || goto x
call a msgOrFailAt !n! "`Any CPU`" || goto x
call a completeTest
::_____________________________________________________


:::::::::::::
call :cleanup

Expand Down

0 comments on commit 4b72654

Please sign in to comment.