aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2021-09-28 15:30:13 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2021-09-28 15:30:13 +0200
commitb99eb75908304d84fbc729ea4209642bb3d82a1c (patch)
tree06551c969a2e5ea0b10c70e431f5c781d04d54d4 /src/common
parent614d1130c9679e5e943b6be64221515198273cda (diff)
Fix incorrect handling of functions in when clauses using ODIN_OS
Diffstat (limited to 'src/common')
-rw-r--r--src/common/ast.odin3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/common/ast.odin b/src/common/ast.odin
index ceda09c..3589848 100644
--- a/src/common/ast.odin
+++ b/src/common/ast.odin
@@ -103,8 +103,7 @@ collect_globals :: proc(file: ast.File, skip_private := false) -> []GlobalExpr {
}
if ident != nil && basic_lit != nil {
-
- if ident.name == "ODIN_OS" && basic_lit.tok.text == ODIN_OS {
+ if ident.name == "ODIN_OS" && basic_lit.tok.text[1:len(basic_lit.tok.text)-1] == ODIN_OS {
if block, ok := when_decl.body.derived.(ast.Block_Stmt); ok {
for stmt in block.stmts {