Skip to content

Commit

Permalink
fix parsing without module keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
atsky committed Feb 25, 2015
1 parent 9dc94e8 commit fabf5dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugin/src/org/jetbrains/haskell/parser/LexerState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ public fun getCachedTokens(builder: PsiBuilder): CachedTokens {
}

public fun newLexerState(tokens: CachedTokens): LexerState {
return LexerState(tokens, 0, 0, null, null)
if (tokens.tokens.firstOrNull() == HaskellLexerTokens.MODULE) {
return LexerState(tokens, 0, 0, null, null)
} else {
return LexerState(tokens, 0, 0, null, IntStack(0, null))
}
}

public class CachedTokens(val tokens: List<IElementType>,
Expand Down

0 comments on commit fabf5dd

Please sign in to comment.