diff --git a/lexers/haxe.go b/lexers/haxe.go index 6e23938da..9a72de865 100644 --- a/lexers/haxe.go +++ b/lexers/haxe.go @@ -630,7 +630,9 @@ func haxePreProcMutator(state *LexerState) error { state.Stack = stack[len(stack)-1] } case "end": - stack = stack[:len(stack)-1] + if len(stack) > 0 { + stack = stack[:len(stack)-1] + } } if proc == "if" || proc == "elseif" {