Rename module highlight token (#16)

* Rename module highlight token

* Fix CRLF in scanner lookahead
This commit is contained in:
Jonatan Kłosko 2021-12-15 23:29:48 +01:00 committed by GitHub
parent de3ec57591
commit 1b3ecf7765
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 33 additions and 30 deletions

View File

@ -62,11 +62,11 @@
(float)
] @number
(alias) @type
(alias) @module
(call
target: (dot
left: (atom) @type))
left: (atom) @module))
(char) @constant

View File

@ -56,7 +56,10 @@ bool is_inline_whitespace(int32_t c) {
}
bool is_newline(int32_t c) {
return c == '\n';
// Note: this implies \r\n is treated as two line breaks,
// but in our case it's fine, since multiple line breaks
// make no difference
return c == '\n' || c == '\r';
}
bool is_digit(int32_t c) {

View File

@ -43,7 +43,7 @@ end
&Set.put(&1, &2)
# <- operator
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
@ -55,7 +55,7 @@ end
&( Set.put(&1, &1) )
#<- operator
#^ punctuation.bracket
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket

View File

@ -1,5 +1,5 @@
Path.expand("..", __DIR__)
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
@ -35,7 +35,7 @@ hd([1,2])
# ^ punctuation.bracket
Kernel.spawn(fn -> :ok end)
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
@ -46,12 +46,12 @@ Kernel.spawn(fn -> :ok end)
# ^ punctuation.bracket
IO.ANSI.black
# ^ type
# ^ module
# ^ operator
# ^ function
Kernel.-(number)
# ^ type
# ^ module
# ^ operator
# ^ operator
# ^ punctuation.bracket
@ -59,7 +59,7 @@ Kernel.-(number)
# ^ punctuation.bracket
Enum.map([1, 2], fn x ->
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
@ -81,7 +81,7 @@ end)
# ^ punctuation.bracket
:erlang.abs(-1)
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket

View File

@ -160,8 +160,8 @@
%Long.Module.Name{name: "Silly"}
# <- punctuation
# ^ type
# ^ type
# ^ module
# ^ module
# ^ punctuation.bracket
# ^ string.special.symbol
# ^ string
@ -169,7 +169,7 @@
%Long.Module.Name{s | height: {192, :cm}}
# <- punctuation
# ^ type
# ^ module
# ^ punctuation.bracket
# ^ variable
# ^ operator
@ -185,7 +185,7 @@
# ^ string
# ^ punctuation.special
# ^ punctuation
# ^ type
# ^ module
# ^ punctuation.bracket
# ^ variable
# ^ operator

View File

@ -5,7 +5,7 @@ _018OP
# ^ comment.unused
A__0
# ^ type
# ^ module
__MODULE__ ; __STACKTRACE__
# ^ constant.builtin

View File

@ -139,14 +139,14 @@ end
raise RuntimeError, message: "This is not an error"
# ^ keyword
# ^ type
# ^ module
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ string
import Kernel, except: [spawn: 1, +: 2, /: 2, Unless: 2]
# ^ keyword
# ^ type
# ^ module
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ punctuation.bracket
@ -165,11 +165,11 @@ import Kernel, except: [spawn: 1, +: 2, /: 2, Unless: 2]
alias Long.Module.Name, as: N0men123_and4
# ^ keyword
# ^ type
# ^ module
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ type
# ^ module
use Bitwise
# ^ keyword
# ^ type
# ^ module

View File

@ -1,7 +1,7 @@
defmodule Long.Module.Name do
# ^ keyword
# ^ type
# ^ type
# ^ module
# ^ module
# ^ keyword
@moduledoc "Simple doc"
@ -80,7 +80,7 @@ defmodule Long.Module.Name do
# ^ attribute
# ^ variable
# ^ operator
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
@ -256,7 +256,7 @@ defmodule Long.Module.Name do
# ^ punctuation.bracket
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ type
# ^ module
defmacro meta_function(name) do
# ^ keyword
@ -297,7 +297,7 @@ end
defprotocol Useless do
# ^ keyword
# ^ type
# ^ module
# ^ keyword
def func(this)
# ^ keyword
@ -310,10 +310,10 @@ end
defimpl Useless, for: Atom do
# ^ keyword
# ^ type
# ^ module
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ type
# ^ module
# ^ keyword
end
# <- keyword

View File

@ -75,10 +75,10 @@ y = true and false
"hello" |> String.upcase |> String.downcase()
# ^ string
# ^ operator
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ operator
# ^ type
# ^ module
# ^ operator
# ^ function