File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change
1
+ Write-Output " -- Compiling Lemon parser..."
2
+ $LemonSrc = Join-Path - Path ' ./parser' - ChildPath ' lemon.c'
3
+ $LemonBin = Join-Path - Path ' ./parser' - ChildPath ' lemon.exe'
4
+
5
+ if ($IsWindows ) {
6
+ & cl / Fe${LemonExe} ${LemonSrc}
7
+ }
8
+ else {
9
+ $LemonBin = Join-Path - Path ' ./parser' - ChildPath ' lemon'
10
+ & gcc ${LemonSrc} - o ${LemonBin}
11
+ }
12
+ & ${LemonBin} - x
13
+
14
+ Write-Output " -- Cleanup initial file state..."
15
+
16
+ $AutoFiles = " ./parser/zephir.c" ,
17
+ " ./parser/zephir.h" ,
18
+ " ./parser/parser.c" ,
19
+ " ./parser/scanner.c"
20
+
21
+ foreach ($GeneratedFile in $AutoFiles ) {
22
+ if (Test-Path - Path $GeneratedFile ) {
23
+ Remove-Item $GeneratedFile
24
+ }
25
+ }
26
+
27
+ Write-Output " -- Run re2c..."
28
+ & re2c - o (Join-Path - Path ' ./parser' - ChildPath ' scanner.c' ) (Join-Path - Path ' ./parser' - ChildPath ' scanner.re' )
29
+
30
+ Write-Output " -- Generating zephir.c file with lemon parser..."
31
+ & ${LemonBin} - s (Join-Path - Path ' ./parser' - ChildPath ' zephir.lemon' )
32
+
33
+ Write-Output " -- Generating parser.c file..."
34
+ $ParserC = Join-Path - Path ' ./parser' - ChildPath ' parser.c'
35
+ $ZephirC = Join-Path - Path ' ./parser' - ChildPath ' zephir.c'
36
+ $BaseC = Join-Path - Path ' ./parser' - ChildPath ' base.c'
37
+ Set-Content - Path ${ParserC} - Value ' #include <php.h>'
38
+ Get-Content ${ParserC} , ${ZephirC} , ${BaseC} | Set-Content ${ParserC}
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ jobs:
117
117
shell : cmd
118
118
run : |
119
119
call C:\tools\php-sdk\bin\phpsdk_setvars.bat
120
- call .\.ci\build-win32.bat
120
+ powershell.exe -File .\.ci\lemon-parser.ps1
121
121
# CD parser
122
122
# DEL zephir.c zephir.h parser.c scanner.c
123
123
# re2c -o scanner.c scanner.re
You can’t perform that action at this time.
0 commit comments