Skip to content

Commit 912d929

Browse files
azizkprincemaple
authored andcommitted
Elixir: fixed last_assignment_clause_pop
1 parent 2cd9592 commit 912d929

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

syntaxes/Elixir.sublime-syntax

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ contexts:
345345
- include: parameters
346346

347347
id_or_operator_call_param_pop:
348-
- match: ({{member}}){{no_key_suffix}}
348+
- match: ({{member}}){{no_suffix_then_arguments}}
349349
scope: variable.function.elixir
350350
set:
351351
- include: arguments_paren_param_pop
@@ -2847,6 +2847,10 @@ contexts:
28472847
- match: (?=(?><-|->|=(?![>~=]))(?!:))
28482848
fail: last_assignment_clause
28492849
- include: if_argument_end_pop
2850+
- match: \s*\n
2851+
push:
2852+
- include: comments
2853+
- include: if_non_space_pop
28502854
- include: arguments_ws_rest_pop
28512855

28522856
case_macro_call:

tests/syntax_test_function_calls.ex

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,38 @@ for CE.source(
788788
# ^^^^^^^^^^^^^^^^ variable.other
789789
# ^^^ constant.other.keyword
790790

791+
with {:ok, user} <- fetch_user(id),
792+
get_account(user.name, user.email),
793+
# ^^^^^ variable.other.member
794+
# ^^^^ variable.other
795+
# ^^^^ variable.other.member
796+
# ^^^^ variable.other
797+
# ^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments
798+
# ^^^^^^^^^^^ variable.function
799+
account = get_account(user.name),
800+
name =
801+
# ^ keyword.operator.match
802+
# ^^^^ variable.parameter
803+
user.name,
804+
account =
805+
# ^ keyword.operator.match
806+
# ^^^^^^^ variable.parameter
807+
get_account(user.name, user.email),
808+
# ^^^^^ variable.other.member
809+
# ^^^^ variable.other
810+
# ^ punctuation.separator.arguments
811+
# ^^^^ variable.other.member
812+
# ^^^^ variable.other
813+
# ^^^^^^^^^^^ variable.function
814+
email =
815+
# ^ keyword.operator.match
816+
# ^^^^^ variable.parameter
817+
user.email do
818+
# ^^^^^ variable.other.member
819+
# ^ punctuation.accessor.dot
820+
# ^^^^ variable.other
821+
end
822+
791823
case variable do
792824
a..b -> identifier
793825
# ^^^^^^^^^^ -variable.parameter

0 commit comments

Comments
 (0)