Skip to content

Commit

Permalink
fix compilation with latest v
Browse files Browse the repository at this point in the history
  • Loading branch information
StunxFS committed Feb 5, 2025
1 parent 9d0c69c commit 4403313
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions compiler/context/mod.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@ const stack = []&CContext{}

pub fn push(ctx &CContext) {
unsafe {
stack << ctx
mut s := &stack
s << ctx
}
}

pub fn get() &CContext {
if stack == [] {
panic('empty CContext stack')
panic('context.get: empty CContext stack')
}
return stack.last()
}

pub fn pop() {
if stack == [] {
panic('empty CContext stack')
panic('context.pop: empty CContext stack')
}
unsafe {
_ = stack.pop()
mut s := &stack
_ = s.pop()
}
}

Expand Down

0 comments on commit 4403313

Please sign in to comment.