Open hutou opened 2 years ago
I'm not sure if this is the same issue but running /bar/
in the interpreter produces this:
undefined reference to `pcre2_compile_8' (Crystal::Loader::LoadError)
from D:\a\crystal\crystal\src\compiler\crystal\loader.cr:76 in 'find_symbol'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1885 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1283 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1497 in 'get_const_index_and_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1469 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:161 in 'compile'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\interpreter.cr:232 in 'interpret'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\repl.cr:25 in 'run'
from D:\a\crystal\crystal\src\compiler\crystal\command.cr:55 in 'run'
from D:\a\crystal\crystal\src\compiler\crystal.cr:11 in '__crystal_main'
from D:\a\crystal\crystal\src\crystal\main.cr:130 in 'main'
from D:\a\crystal\crystal\src\crystal\system\win32\wmain.cr:37 in 'wmain'
from D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 in '__scrt_common_main_seh'
from C:\WINDOWS\System32\KERNEL32.DLL +75133 in 'BaseThreadInitThunk'
from C:\WINDOWS\SYSTEM32\ntdll.dll +372520 in 'RtlUserThreadStart'
Running /bar/
again produces this:
Unhandled case: enum value outside of defined enum members (Exception)
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\interpreter.cr:354 in 'interpret'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\interpreter.cr:252 in 'interpret'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\repl.cr:25 in 'run'
from D:\a\crystal\crystal\src\compiler\crystal\command.cr:55 in 'run'
from D:\a\crystal\crystal\src\compiler\crystal.cr:11 in '__crystal_main'
from D:\a\crystal\crystal\src\crystal\main.cr:130 in 'main'
from D:\a\crystal\crystal\src\crystal\system\win32\wmain.cr:37 in 'wmain'
from D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 in '__scrt_common_main_seh'
from C:\WINDOWS\System32\KERNEL32.DLL +75133 in 'BaseThreadInitThunk'
from C:\WINDOWS\SYSTEM32\ntdll.dll +372520 in 'RtlUserThreadStart'
Similarly, "foo" =~ /bar/
produces this:
undefined reference to `pcre2_match_data_create_from_pattern_8' (Crystal::Loader::LoadError)
from D:\a\crystal\crystal\src\compiler\crystal\loader.cr:76 in 'find_symbol'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1885 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2028 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1283 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1305 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1293 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\syntax\visitor.cr:27 in 'accept'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:244 in 'compile_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:2103 in 'create_compiled_def'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:1898 in 'visit'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\compiler.cr:161 in 'compile'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\interpreter.cr:232 in 'interpret'
from D:\a\crystal\crystal\src\compiler\crystal\interpreter\repl.cr:25 in 'run'
from D:\a\crystal\crystal\src\compiler\crystal\command.cr:55 in 'run'
from D:\a\crystal\crystal\src\compiler\crystal.cr:11 in '__crystal_main'
from D:\a\crystal\crystal\src\crystal\main.cr:130 in 'main'
from D:\a\crystal\crystal\src\crystal\system\win32\wmain.cr:37 in 'wmain'
from D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 in '__scrt_common_main_seh'
from C:\WINDOWS\System32\KERNEL32.DLL +75133 in 'BaseThreadInitThunk'
from C:\WINDOWS\SYSTEM32\ntdll.dll +372520 in 'RtlUserThreadStart'
However, this behaviour is inconsistent. Sometimes the interpreter will exit without warning, other times it repeats the enum exception. Sometimes it crashes altogether:
In my application, which consists of a dozen files totalling about 5000 lines, I use regular expression tests in various places (about 40). The compilation proceeds normally. When I try to run it under the interpreter (from I3oris], I get the following error message:
I do not use the
$~
syntax in the source code.