Skip to content

Commit

Permalink
[ agda ] let in
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed May 16, 2019
1 parent c8c5954 commit d3c1267
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/org/ice1000/tt/psi/agda/parser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.intellij.psi.tree.TokenSet
import org.ice1000.tt.AgdaFile
import org.ice1000.tt.AgdaLanguage
import org.ice1000.tt.psi.LayoutLexer
import org.ice1000.tt.psi.LetIn
import org.ice1000.tt.psi.State

class AgdaElementType(debugName: String) : IElementType(debugName, AgdaLanguage.INSTANCE)
Expand Down Expand Up @@ -67,7 +68,8 @@ fun agdaLayoutLexer() = LayoutLexer(
AgdaTypes.LAYOUT_SEP,
AgdaTypes.LAYOUT_END,
NON_CODE,
LAYOUT_CREATOR
LAYOUT_CREATOR,
LetIn(AgdaTypes.KW_LET, AgdaTypes.KW_IN)
) { it: List<LayoutLexer.Token> ->
if (it.any { it.elementType == AgdaTypes.KW_MODULE }) State.Normal
else State.WaitingForLayout
Expand Down
4 changes: 2 additions & 2 deletions src/org/ice1000/tt/psi/layout.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class LayoutLexer(
private val nonCodeTokens: TokenSet,
/*TokenSet.create(LET, OF)*/
private val layoutCreatingTokens: TokenSet,
private val initialState: (List<Token>) -> State = { WaitingForLayout },
private val letInTokens: LetIn? = null
private val letInTokens: LetIn? = null,
private val initialState: (List<Token>) -> State = { WaitingForLayout }
) : LexerBase() {
private val tokens = ArrayList<Token>(40)
private var currentTokenIndex = 0
Expand Down

0 comments on commit d3c1267

Please sign in to comment.