diff --git a/src/vm/wren_compiler.c b/src/vm/wren_compiler.c index c6a968c0..d7496ac5 100644 --- a/src/vm/wren_compiler.c +++ b/src/vm/wren_compiler.c @@ -3420,12 +3420,9 @@ void definition(Compiler* compiler) ObjFn* wrenCompile(WrenVM* vm, ObjModule* module, const char* source, bool isExpression, bool printErrors) { - // Skip potential UTF-8 BOM - if (strncmp(source, "\xEF\xBB\xBF", 3) == 0) - { - source += 3; - } - + // Skip the UTF-8 BOM if there is one. + if (strncmp(source, "\xEF\xBB\xBF", 3) == 0) source += 3; + Parser parser; parser.vm = vm; parser.module = module; diff --git a/test/regression/520.wren b/test/language/bom.wren similarity index 100% rename from test/regression/520.wren rename to test/language/bom.wren