-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2038 from endersstocker/scope-elixir
Add scopes to Elixir tags
- Loading branch information
Showing
11 changed files
with
81 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
CallbackModule input.ex /^defmodule CallbackModule do$/;" module | ||
new_callback input.ex /^ @callback new_callback() :: integer$/;" callback | ||
old_callback input.ex /^ defcallback old_callback(info :: integer) :: integer$/;" callback | ||
new_callback input.ex /^ @callback new_callback() :: integer$/;" callback module:CallbackModule | ||
old_callback input.ex /^ defcallback old_callback(info :: integer) :: integer$/;" callback module:CallbackModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
ModuleError input.ex /^defmodule ModuleError do$/;" module | ||
ModuleError input.ex /^ defexception [:message]$/;" delegate | ||
ModuleError input.ex /^ defexception [:message]$/;" delegate module:ModuleError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FunctionModule input.ex /^defmodule FunctionModule do$/;" module | ||
one_liner_func input.ex /^ def one_liner_func, do: :baz$/;" function | ||
func_no_params input.ex /^ def func_no_params do$/;" function | ||
func_head input.ex /^ def func_head(string1, string2 \\\\ nil, separator \\\\ " ")$/;" function | ||
func_one_arity input.ex /^ def func_one_arity(string1, nil, _separator) do$/;" function | ||
normal_func input.ex /^ def normal_func(string1, string2, separator) do$/;" function | ||
private_func input.ex /^ defp private_func(a), do: a <> " alone"$/;" function | ||
private_func_no_params input.ex /^ defp private_func_no_params do$/;" function | ||
one_liner_func input.ex /^ def one_liner_func, do: :baz$/;" function module:FunctionModule | ||
func_no_params input.ex /^ def func_no_params do$/;" function module:FunctionModule | ||
func_head input.ex /^ def func_head(string1, string2 \\\\ nil, separator \\\\ " ")$/;" function module:FunctionModule | ||
func_one_arity input.ex /^ def func_one_arity(string1, nil, _separator) do$/;" function module:FunctionModule | ||
normal_func input.ex /^ def normal_func(string1, string2, separator) do$/;" function module:FunctionModule | ||
private_func input.ex /^ defp private_func(a), do: a <> " alone"$/;" function module:FunctionModule | ||
private_func_no_params input.ex /^ defp private_func_no_params do$/;" function module:FunctionModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
MacroModule input.ex /^defmodule MacroModule do$/;" module | ||
macro input.ex /^ defmacro macro(expr, opts) do$/;" macro | ||
macro_no_params input.ex /^ defmacro macro_no_params do$/;" macro | ||
private_macro input.ex /^ defmacrop private_macro(expr, opts) do$/;" macro | ||
private_macro_no_params input.ex /^ defmacrop private_macro_no_params do$/;" macro | ||
macro input.ex /^ defmacro macro(expr, opts) do$/;" macro module:MacroModule | ||
macro_no_params input.ex /^ defmacro macro_no_params do$/;" macro module:MacroModule | ||
private_macro input.ex /^ defmacrop private_macro(expr, opts) do$/;" macro module:MacroModule | ||
private_macro_no_params input.ex /^ defmacrop private_macro_no_params do$/;" macro module:MacroModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
RecordsModule input.ex /^defmodule RecordsModule do$/;" module | ||
user1 input.ex /^ Record.defrecord(:user1, name: "megan", age: "25")$/;" record | ||
user2 input.ex /^ Record.defrecordp :user2, name: "ivan", age: "23"$/;" record | ||
user1 input.ex /^ Record.defrecord(:user1, name: "megan", age: "25")$/;" record module:RecordsModule | ||
user2 input.ex /^ Record.defrecordp :user2, name: "ivan", age: "23"$/;" record module:RecordsModule |
38 changes: 19 additions & 19 deletions
38
Units/parser-elixir.r/elixir-sign-operators.d/expected.tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
OperatorModule input.ex /^defmodule OperatorModule do$/;" module | ||
+ input.ex /^ def a + b, do: max(a, b)$/;" operator | ||
- input.ex /^ def a - b, do: max(a, b)$/;" operator | ||
* input.ex /^ def a * b, do: max(a, b)$/;" operator | ||
/ input.ex /^ def a \/ b, do: max(a, b)$/;" operator | ||
= input.ex /^ def a = b, do: max(a, b)$/;" operator | ||
. input.ex /^ def a . b, do: max(a, b)$/;" operator | ||
| input.ex /^ def a | b, do: max(a, b)$/;" operator | ||
||| input.ex /^ def _ ||| b, do: max(a, b)$/;" operator | ||
&&& input.ex /^ def a &&& _, do: max(a, b)$/;" operator | ||
<<< input.ex /^ def a <<< b, do: max(a, b)$/;" operator | ||
>>> input.ex /^ defp a >>> b, do: max(a, b)$/;" operator | ||
<<~ input.ex /^ defp _ <<~ _, do: max(a, b)$/;" operator | ||
~>> input.ex /^ defp a ~>> b, do: max(a, b)$/;" operator | ||
<~ input.ex /^ defmacro a <~ b, do: max(a, b)$/;" operator | ||
~> input.ex /^ defmacro _ ~> b, do: max(a, b)$/;" operator | ||
<~> input.ex /^ defmacro a <~> _, do: max(a, b)$/;" operator | ||
<|> input.ex /^ defmacrop a <|> b, do: max(a, b)$/;" operator | ||
^^^ input.ex /^ defmacrop _ ^^^ _, do: max(a, b)$/;" operator | ||
~~~ input.ex /^ defmacrop a ~~~ b, do: max(a, b)$/;" operator | ||
+ input.ex /^ def a + b, do: max(a, b)$/;" operator module:OperatorModule | ||
- input.ex /^ def a - b, do: max(a, b)$/;" operator module:OperatorModule | ||
* input.ex /^ def a * b, do: max(a, b)$/;" operator module:OperatorModule | ||
/ input.ex /^ def a \/ b, do: max(a, b)$/;" operator module:OperatorModule | ||
= input.ex /^ def a = b, do: max(a, b)$/;" operator module:OperatorModule | ||
. input.ex /^ def a . b, do: max(a, b)$/;" operator module:OperatorModule | ||
| input.ex /^ def a | b, do: max(a, b)$/;" operator module:OperatorModule | ||
||| input.ex /^ def _ ||| b, do: max(a, b)$/;" operator module:OperatorModule | ||
&&& input.ex /^ def a &&& _, do: max(a, b)$/;" operator module:OperatorModule | ||
<<< input.ex /^ def a <<< b, do: max(a, b)$/;" operator module:OperatorModule | ||
>>> input.ex /^ defp a >>> b, do: max(a, b)$/;" operator module:OperatorModule | ||
<<~ input.ex /^ defp _ <<~ _, do: max(a, b)$/;" operator module:OperatorModule | ||
~>> input.ex /^ defp a ~>> b, do: max(a, b)$/;" operator module:OperatorModule | ||
<~ input.ex /^ defmacro a <~ b, do: max(a, b)$/;" operator module:OperatorModule | ||
~> input.ex /^ defmacro _ ~> b, do: max(a, b)$/;" operator module:OperatorModule | ||
<~> input.ex /^ defmacro a <~> _, do: max(a, b)$/;" operator module:OperatorModule | ||
<|> input.ex /^ defmacrop a <|> b, do: max(a, b)$/;" operator module:OperatorModule | ||
^^^ input.ex /^ defmacrop _ ^^^ _, do: max(a, b)$/;" operator module:OperatorModule | ||
~~~ input.ex /^ defmacrop a ~~~ b, do: max(a, b)$/;" operator module:OperatorModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
MyList input.ex /^defmodule MyList do$/;" module | ||
reverse input.ex /^ defdelegate reverse(list), to: Enum$/;" delegate | ||
other_reverse input.ex /^ defdelegate other_reverse(list), to: Enum, as: :reverse$/;" delegate | ||
Size input.ex /^defprotocol Size do$/;" protocol | ||
size input.ex /^ def size(data)$/;" function | ||
reverse input.ex /^ defdelegate reverse(list), to: Enum$/;" delegate module:MyList | ||
other_reverse input.ex /^ defdelegate other_reverse(list), to: Enum, as: :reverse$/;" delegate module:MyList | ||
Size input.ex /^defprotocol Size do$/;" protocol module:MyList | ||
size input.ex /^ def size(data)$/;" function module:MyList | ||
MyGuards input.ex /^defmodule Integer.MyGuards do$/;" module | ||
is_even input.ex /^ defguard is_even(value) when is_integer(value) and rem(value, 2) == 0$/;" guard | ||
is_odd input.ex /^ defguardp is_odd(value) when is_integer(value) and rem(value, 2) != 0$/;" guard | ||
Size input.ex /^defimpl Size, for: BitString do$/;" implementation | ||
size input.ex /^ def size(binary), do: byte_size(binary)$/;" function | ||
is_even input.ex /^ defguard is_even(value) when is_integer(value) and rem(value, 2) == 0$/;" guard module:MyGuards | ||
is_odd input.ex /^ defguardp is_odd(value) when is_integer(value) and rem(value, 2) != 0$/;" guard module:MyGuards | ||
Size input.ex /^defimpl Size, for: BitString do$/;" implementation module:MyGuards | ||
size input.ex /^ def size(binary), do: byte_size(binary)$/;" function module:MyGuards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TestModule input.ex /^defmodule TestModule do$/;" module | ||
good with spaces input.ex /^ test "good with spaces" do$/;" test | ||
good with parens input.ex /^ test("good with parens") do$/;" test | ||
good with spaces input.ex /^ test "good with spaces" do$/;" test module:TestModule | ||
good with parens input.ex /^ test("good with parens") do$/;" test module:TestModule |
12 changes: 6 additions & 6 deletions
12
Units/parser-elixir.r/elixir-word-operators.d/expected.tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
OperatorModule input.ex /^defmodule OperatorModule do$/;" module | ||
and input.ex /^ def a and b, do: max(a, b)$/;" operator | ||
or input.ex /^ def a or b, do: max(a, b)$/;" operator | ||
not input.ex /^ defp a not b, do: max(a, b)$/;" operator | ||
in input.ex /^ defmacro a in b, do: max(a, b)$/;" operator | ||
not in input.ex /^ defmacrop a not in b, do: max(a, b)$/;" operator | ||
when input.ex /^ defmacrop a when b, do: max(a, b)$/;" operator | ||
and input.ex /^ def a and b, do: max(a, b)$/;" operator module:OperatorModule | ||
or input.ex /^ def a or b, do: max(a, b)$/;" operator module:OperatorModule | ||
not input.ex /^ defp a not b, do: max(a, b)$/;" operator module:OperatorModule | ||
in input.ex /^ defmacro a in b, do: max(a, b)$/;" operator module:OperatorModule | ||
not in input.ex /^ defmacrop a not in b, do: max(a, b)$/;" operator module:OperatorModule | ||
when input.ex /^ defmacrop a when b, do: max(a, b)$/;" operator module:OperatorModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters