mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
Merge branch 'master' of https://github.com/jclc/wren into jclc-master
This commit is contained in:
@ -3420,6 +3420,12 @@ 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;
|
||||
}
|
||||
|
||||
Parser parser;
|
||||
parser.vm = vm;
|
||||
parser.module = module;
|
||||
@ -3447,7 +3453,7 @@ ObjFn* wrenCompile(WrenVM* vm, ObjModule* module, const char* source,
|
||||
nextToken(&parser);
|
||||
|
||||
int numExistingVariables = module->variables.count;
|
||||
|
||||
|
||||
Compiler compiler;
|
||||
initCompiler(&compiler, &parser, NULL, false);
|
||||
ignoreNewlines(&compiler);
|
||||
|
||||
2
test/regression/520.wren
Normal file
2
test/regression/520.wren
Normal file
@ -0,0 +1,2 @@
|
||||
// This file should have a UTF-8 byte order mark
|
||||
System.print("ok") // expect: ok
|
||||
Reference in New Issue
Block a user