aboutsummaryrefslogtreecommitdiff
path: root/src/server/documents.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2020-12-18 15:09:30 +0100
committerDanielGavin <danielgavin5@hotmail.com>2020-12-18 15:09:30 +0100
commitbf9e093d9f4f0d5aaa6cd14d751a3ba6f775bf00 (patch)
tree96179b015b114ca0ac56b63d68d425dd11108d22 /src/server/documents.odin
parent53887066c915c0e332871c867beb500fd8b407e9 (diff)
fixed crash after updating Odin
Diffstat (limited to 'src/server/documents.odin')
-rw-r--r--src/server/documents.odin6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/documents.odin b/src/server/documents.odin
index 7e9aa67..bf8a04f 100644
--- a/src/server/documents.odin
+++ b/src/server/documents.odin
@@ -386,9 +386,15 @@ parse_document :: proc(document: ^Document, config: ^common.Config) -> ([] Parse
context.allocator = common.scratch_allocator(document.allocator);
+ //have to cheat the parser since it really wants to parse an entire package with the new changes...
+ pkg := new(ast.Package);
+ pkg.kind = .Normal;
+ pkg.fullpath = document.uri.path;
+
document.ast = ast.File {
fullpath = document.uri.path,
src = document.text[:document.used_text],
+ pkg = pkg,
};
parser.parse_file(&p, &document.ast);