diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-06-25 15:02:05 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2025-06-25 15:02:05 +0200 |
| commit | 077dba63ee6cd73ccd71af71dfca6e691b5feb89 (patch) | |
| tree | 792947582c8c646d1cdc8fb7852f8f0bdc5334b3 | |
| parent | c5f8b85e9a3534329d48dfac87eb7cf709323d22 (diff) | |
Grow stack size on windows binaries. Support foreign import with when correctly.
| -rw-r--r-- | build.bat | 10 | ||||
| -rw-r--r-- | ci.bat | 4 | ||||
| -rw-r--r-- | src/server/ast.odin | 22 |
3 files changed, 27 insertions, 9 deletions
@@ -2,11 +2,11 @@ setlocal enabledelayedexpansion if "%1" == "test" ( - odin test tests -collection:src=src -debug -define:ODIN_TEST_THREADS=1 -define:ODIN_TEST_TRACK_MEMORY=false + odin test tests -collection:src=src -debug -define:ODIN_TEST_THREADS=1 -define:ODIN_TEST_TRACK_MEMORY=false -extra-linker-flags:"/STACK:4000000,2000000" ) else if "%1" == "single_test" ( - odin test tests -collection:src=src -define:ODIN_TEST_NAMES=%2 -define:ODIN_TEST_TRACK_MEMORY=false -debug + odin test tests -collection:src=src -define:ODIN_TEST_NAMES=%2 -define:ODIN_TEST_TRACK_MEMORY=false -debug -extra-linker-flags:"/STACK:4000000,2000000" ) else if "%1" == "debug" ( - odin build src\ -show-timings -microarch:native -collection:src=src -out:ols.exe -o:minimal -no-bounds-check -use-separate-modules -debug + odin build src\ -show-timings -microarch:native -collection:src=src -out:ols.exe -o:minimal -no-bounds-check -use-separate-modules -debug -extra-linker-flags:"/STACK:4000000,2000000" ) else ( - odin build src\ -show-timings -microarch:native -collection:src=src -out:ols.exe -o:speed -no-bounds-check -) + odin build src\ -show-timings -microarch:native -collection:src=src -out:ols.exe -o:speed -no-bounds-check -extra-linker-flags:"/STACK:4000000,2000000" +) @@ -7,10 +7,10 @@ if "%1" == "CI" ( rem odin test tests -collection:src=src -define:ODIN_TEST_THREADS=1 rem if %errorlevel% neq 0 exit /b 1 - odin build src\ -collection:src=src -out:ols.exe -o:speed + odin build src\ -collection:src=src -out:ols.exe -o:speed -extra-linker-flags:"/STACK:4000000,2000000" call "tools/odinfmt/tests.bat" if %errorlevel% neq 0 exit /b 1 ) else ( - odin build src\ -collection:src=src -out:ols.exe -o:speed -no-bounds-check + odin build src\ -collection:src=src -out:ols.exe -o:speed -no-bounds-check -extra-linker-flags:"/STACK:4000000,2000000" )
\ No newline at end of file diff --git a/src/server/ast.odin b/src/server/ast.odin index 73c84cc..9780537 100644 --- a/src/server/ast.odin +++ b/src/server/ast.odin @@ -377,6 +377,16 @@ collect_when_stmt :: proc( for stmt in block.stmts { if when_stmt, ok := stmt.derived.(^ast.When_Stmt); ok { collect_when_stmt(exprs, file, file_tags, when_stmt, skip_private) + } else if foreign_decl, ok := stmt.derived.(^ast.Foreign_Block_Decl); ok { + if foreign_decl.body == nil { + continue + } + + if foreign_block, ok := foreign_decl.body.derived.(^ast.Block_Stmt); ok { + for foreign_stmt in foreign_block.stmts { + collect_value_decl(exprs, file, file_tags, foreign_stmt, skip_private) + } + } } else { collect_value_decl(exprs, file, file_tags, stmt, skip_private) } @@ -392,11 +402,19 @@ collect_when_stmt :: proc( for stmt in block.stmts { if when_stmt, ok := stmt.derived.(^ast.When_Stmt); ok { collect_when_stmt(exprs, file, file_tags, when_stmt, skip_private) + } else if foreign_decl, ok := stmt.derived.(^ast.Foreign_Block_Decl); ok { + if foreign_decl.body != nil { + if foreign_block, ok := foreign_decl.body.derived.(^ast.Block_Stmt); ok { + for foreign_stmt in foreign_block.stmts { + collect_value_decl(exprs, file, file_tags, foreign_stmt, skip_private) + } + } + } } else { collect_value_decl(exprs, file, file_tags, stmt, skip_private) } - } - } + } + } return } else_stmt = else_when.else_stmt |