diff --git a/src/com/reason/lang/reason/RmlParser.java b/src/com/reason/lang/reason/RmlParser.java index 962fb041f..766c20c59 100644 --- a/src/com/reason/lang/reason/RmlParser.java +++ b/src/com/reason/lang/reason/RmlParser.java @@ -255,14 +255,17 @@ private void parseComma(@NotNull PsiBuilder builder, ParserState state) { if (state.isCurrentResolution(functionBody)) { // a function is part of something else, close it first state.popEnd().popEnd(); + } else if (state.isCurrentResolution(modulePath)) { + state.complete().popEnd(); } if (state.isCurrentResolution(functionParameterNamedSignatureItem)) { state.complete(). popEndUntilResolution(functionParameterNamed).popEnd(). advance(). - add(mark(builder, functionParameter, functionParameter, m_types.C_FUN_PARAM)); + add(mark(builder, functionParameter, m_types.C_FUN_PARAM)); } + if (state.isCurrentResolution(signatureItem) && !state.isCurrentContext(recordSignature)) { state.popEnd(); state.advance(); @@ -651,7 +654,7 @@ private void parseLIdent(@NotNull PsiBuilder builder, ParserState state) { state.complete(); state.setPreviousComplete(); } else if (state.isCurrentResolution(functionParameters)) { - state.add(mark(builder, state.currentContext(), functionParameter, m_types.C_FUN_PARAM).complete()); + state.add(mark(builder, functionParameter, m_types.C_FUN_PARAM).complete()); } else if (state.isCurrentResolution(external)) { // EXTERNAL ... state.updateCurrentResolution(externalNamed); diff --git a/tests/com/reason/lang/reason/FunctionCallTest.java b/tests/com/reason/lang/reason/FunctionCallTest.java index 0e81bde60..c51a086ae 100644 --- a/tests/com/reason/lang/reason/FunctionCallTest.java +++ b/tests/com/reason/lang/reason/FunctionCallTest.java @@ -37,4 +37,10 @@ public void testCall3() { assertEmpty(callParams.getParameterList()); } + public void testIssue120() { + PsiLet e = first(letExpressions(parseCode("let _ = f(x == U.I, 1)"))); + + PsiFunctionCallParams params = PsiTreeUtil.findChildOfType(e, PsiFunctionCallParams.class); + assertSize(2, params.getParameterList()); + } }