From 7357885bbcb3df685b8bbb633b62ab21bc3509d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Wed, 29 Sep 2021 19:32:23 +0200 Subject: [PATCH] Add highlighting tests --- test/highlight/anonymous.ex | 66 +++++++ test/highlight/calls.ex | 81 ++++++++ test/highlight/data_structures.ex | 200 +++++++++++++++++++ test/highlight/identifiers.ex | 15 ++ test/highlight/kernel.ex | 175 ++++++++++++++++ test/highlight/literals.ex | 173 ++++++++++++++++ test/highlight/module.ex | 319 ++++++++++++++++++++++++++++++ test/highlight/operators.ex | 67 +++++++ 8 files changed, 1096 insertions(+) create mode 100644 test/highlight/anonymous.ex create mode 100644 test/highlight/calls.ex create mode 100644 test/highlight/data_structures.ex create mode 100644 test/highlight/identifiers.ex create mode 100644 test/highlight/kernel.ex create mode 100644 test/highlight/literals.ex create mode 100644 test/highlight/module.ex create mode 100644 test/highlight/operators.ex diff --git a/test/highlight/anonymous.ex b/test/highlight/anonymous.ex new file mode 100644 index 0000000..a6056fa --- /dev/null +++ b/test/highlight/anonymous.ex @@ -0,0 +1,66 @@ +fn x, y, z -> +# <- keyword +# ^ variable +# ^ punctuation.delimiter +# ^ variable +# ^ punctuation.delimiter +# ^ variable +# ^ operator + fn(a, b, c) -> + # <- keyword + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.delimiter + # ^ variable + # ^ punctuation.delimiter + # ^ variable + # ^ punctuation.bracket + # ^ operator + &(x + y - z * a / &1 + b + div(&2, c)) + #<- operator + #^ punctuation.bracket + # ^ variable + # ^ operator + # ^ variable + # ^ operator + # ^ variable + # ^ operator + # ^ variable + # ^ operator + # ^ operator + # ^ operator + # ^ variable + # ^ operator + # ^ function + # ^ punctuation.bracket + # ^ operator + # ^ punctuation.delimiter + # ^ variable + # ^ punctuation.bracket + # ^ punctuation.bracket + end +end + +&Set.put(&1, &2) +# <- operator +# ^ type +# ^ operator +# ^ function +# ^ punctuation.bracket +# ^ operator +# ^ punctuation.delimiter +# ^ operator +# ^ punctuation.bracket + +&( Set.put(&1, &1) ) +#<- operator +#^ punctuation.bracket +# ^ type +# ^ operator +# ^ function +# ^ punctuation.bracket +# ^ operator +# ^ punctuation.delimiter +# ^ operator +# ^ punctuation.bracket +# ^ punctuation.bracket diff --git a/test/highlight/calls.ex b/test/highlight/calls.ex new file mode 100644 index 0000000..cc0a144 --- /dev/null +++ b/test/highlight/calls.ex @@ -0,0 +1,81 @@ +Path.expand("..", __DIR__) +# ^ type +# ^ operator +# ^ function +# ^ punctuation.bracket +# ^ string +# ^ punctuation.delimiter +# ^ constant.builtin +# ^ punctuation.bracket + +func.(1) +# ^ variable +# ^ operator +# ^ punctuation.bracket +# ^ number +# ^ punctuation.bracket + +arg |> func +# ^ variable +# ^ operator +# ^ function + +func 1 +# ^ function +# ^ number + +hd([1,2]) +# <- function +# ^ punctuation.bracket +# ^ punctuation.bracket +# ^ number +# ^ punctuation.delimiter +# ^ number +# ^ punctuation.bracket +# ^ punctuation.bracket + +Kernel.spawn(fn -> :ok end) +# ^ type +# ^ operator +# ^ function +# ^ punctuation.bracket +# ^ keyword +# ^ operator +# ^ string.special.symbol +# ^ keyword +# ^ punctuation.bracket + +IO.ANSI.black +# ^ type +# ^ operator +# ^ function + +Kernel.-(number) +# ^ type +# ^ operator +# ^ operator +# ^ punctuation.bracket +# ^ variable +# ^ punctuation.bracket + +Enum.map([1, 2], fn x -> +# ^ type +# ^ operator +# ^ function +# ^ punctuation.bracket +# ^ punctuation.bracket +# ^ number +# ^ punctuation.delimiter +# ^ number +# ^ punctuation.bracket +# ^ punctuation.delimiter +# ^ keyword +# ^ variable +# ^ operator + x * 2 + # <- variable + # ^ operator + # ^ number +end) +# <- keyword +# ^ punctuation.bracket diff --git a/test/highlight/data_structures.ex b/test/highlight/data_structures.ex new file mode 100644 index 0000000..bbf4722 --- /dev/null +++ b/test/highlight/data_structures.ex @@ -0,0 +1,200 @@ +<<1, 2, 3>> +# <- punctuation.bracket +# ^ number +# ^ punctuation.delimiter +# ^ number +# ^ punctuation.delimiter +# ^ number +# ^ punctuation.bracket + +<< header :: size(8), data :: binary >> +# <- punctuation.bracket +# ^ variable +# ^ operator +# ^ function +# ^ punctuation.bracket +# ^ number +# ^ punctuation.bracket +# ^ punctuation.delimiter +# ^ variable +# ^ operator +# ^ variable +# ^ punctuation.bracket + +<<"hello"::binary, c :: utf8, x::[4, unit(2)]>> = "helloâ„¢1" +# <- punctuation.bracket +# ^ string +# ^ operator +# ^ variable +# ^ punctuation.delimiter +# ^ variable +# ^ operator +# ^ variable +# ^ punctuation.delimiter +# ^ variable +# ^ operator +# ^ punctuation.bracket +# ^ number +# ^ punctuation.delimiter +# ^ function +# ^ punctuation.bracket +# ^ number +# ^ punctuation.bracket +# ^ punctuation.bracket +# ^ punctuation.bracket +# ^ operator +# ^ string + +[1, :a, 'hello'] ++ [2, 3] +# <- punctuation.bracket +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ punctuation.delimiter +# ^ string +# ^ punctuation.bracket +# ^ operator +# ^ punctuation.bracket +# ^ number +# ^ punctuation.delimiter +# ^ number +# ^ punctuation.bracket + +[:head | [?t, ?a]] +# <- punctuation.bracket +# ^ string.special.symbol +# ^ operator +# ^ punctuation.bracket +# ^ constant +# ^ punctuation.delimiter +# ^ constant +# ^ punctuation.bracket +# ^ punctuation.bracket + +{:one, 2.0, "three"} +# <- punctuation.bracket +# ^ string.special.symbol +# ^ punctuation.delimiter +# ^ number +# ^ punctuation.delimiter +# ^ string +# ^ punctuation.bracket + +[option: "value", key: :word] +# <- punctuation.bracket +# ^ string.special.symbol +# ^ string +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ string.special.symbol +# ^ punctuation.bracket + +[++: "operator", ~~~: :&&&] +# <- punctuation.bracket +# ^ string.special.symbol +# ^ string +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ string.special.symbol +# ^ punctuation.bracket + +[...: 1, <<>>: 2, %{}: 3, %: 4, {}: 5] +# <- punctuation.bracket +# ^ string.special.symbol +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ number +# ^ punctuation.bracket + +["this is an atom too": 1, "so is #{1} this": 2] +# <- punctuation.bracket +# ^ string.special.symbol +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ punctuation.special +# ^ number +# ^ punctuation.special +# ^ number +# ^ punctuation.bracket + +%{shortcut: "syntax"} +#<- punctuation +#^ punctuation.bracket +# ^ string.special.symbol +# ^ string +# ^ punctuation.bracket + +%{map | "update" => "me"} +#<- punctuation +#^ punctuation.bracket +# ^ variable +# ^ operator +# ^ string +# ^ operator +# ^ string +# ^ punctuation.bracket + +%{ 12 => 13, :weird => ['thing'] } +#<- punctuation +#^ punctuation.bracket +# ^ number +# ^ operator +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ operator +# ^ punctuation.bracket +# ^ string +# ^ punctuation.bracket +# ^ punctuation.bracket + +%Long.Module.Name{name: "Silly"} +# <- punctuation +# ^ type +# ^ type +# ^ punctuation.bracket +# ^ string.special.symbol +# ^ string +# ^ punctuation.bracket + +%Long.Module.Name{s | height: {192, :cm}} +# <- punctuation +# ^ type +# ^ punctuation.bracket +# ^ variable +# ^ operator +# ^ string.special.symbol +# ^ punctuation.bracket +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ punctuation.bracket +# ^ punctuation.bracket + +".. #{%Long.Module.Name{s | height: {192, :cm}}} .." +# ^ string +# ^ punctuation.special +# ^ punctuation +# ^ type +# ^ punctuation.bracket +# ^ variable +# ^ operator +# ^ string.special.symbol +# ^ punctuation.bracket +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ punctuation.bracket +# ^ punctuation.bracket +# ^ punctuation.special +# ^ string diff --git a/test/highlight/identifiers.ex b/test/highlight/identifiers.ex new file mode 100644 index 0000000..dd50826 --- /dev/null +++ b/test/highlight/identifiers.ex @@ -0,0 +1,15 @@ +abc_123 +# ^ variable + +_018OP +# ^ comment.unused + +A__0 +# ^ type + +__MODULE__ ; __STACKTRACE__ +# ^ constant.builtin +# ^ constant.builtin + +__OTHER__ +# ^ comment.unused diff --git a/test/highlight/kernel.ex b/test/highlight/kernel.ex new file mode 100644 index 0000000..b2ac98a --- /dev/null +++ b/test/highlight/kernel.ex @@ -0,0 +1,175 @@ +for x <- 1..10, x < 5, do: {x, x} +# <- keyword +# ^ variable +# ^ operator +# ^ number +# ^ operator +# ^ number +# ^ punctuation.delimiter +# ^ variable +# ^ operator +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ punctuation.bracket +# ^ variable +# ^ punctuation.delimiter +# ^ variable +# ^ punctuation.bracket + +for << <> <- pixels >> do +# <- keyword +# ^ punctuation.bracket +# ^ punctuation.bracket +# ^ variable +# ^ operator +# ^ number +# ^ punctuation.delimiter +# ^ variable +# ^ operator +# ^ number +# ^ punctuation.delimiter +# ^ variable +# ^ operator +# ^ number +# ^ punctuation.delimiter +# ^ variable +# ^ operator +# ^ function +# ^ punctuation.bracket +# ^ number +# ^ punctuation.bracket +# ^ punctuation.bracket +# ^ operator +# ^ variable +# ^ punctuation.bracket +# ^ keyword +end +# <- keyword + +if :this do +# <- keyword +# ^ string.special.symbol +# ^ keyword + :that + # ^ string.special.symbol +else +# <- keyword + :otherwise + # ^ string.special.symbol +end +# <- keyword + +receive do +# ^ keyword +# ^ keyword + {:EXIT, _} -> :done + # <- punctuation.bracket + # ^ string.special.symbol + # ^ punctuation.delimiter + # ^ comment.unused + # ^ punctuation.bracket + # ^ operator + # ^ string.special.symbol + { ^pid, :_ } -> nil + # <- punctuation.bracket + # ^ operator + # ^ variable + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ punctuation.bracket + # ^ operator + # ^ constant + after 100 -> :no_luck + # ^ keyword + # ^ number + # ^ operator + # ^ string.special.symbol +end +# <- keyword + +case __ENV__.line do +# ^ keyword +# ^ constant.builtin +# ^ operator +# ^ function +# ^ keyword + x when is_integer(x) -> x + # <- variable + # ^ keyword + # ^ function + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ operator + # ^ variable + x when x in 1..12 -> -x + # <- variable + # ^ keyword + # ^ variable + # ^ keyword + # ^ number + # ^ operator + # ^ number + # ^ operator + # ^ operator + # ^ variable +end +# <- keyword + +cond do +# <- keyword +# ^ keyword + false -> "too bad" + # ^ constant + # ^ operator + # ^ string + 4 > 5 -> "oops" + # <- number + # ^ operator + # ^ number + # ^ operator + # ^ string + true -> nil + # ^ constant + # ^ operator + # ^ constant +end +# <- keyword + +raise RuntimeError, message: "This is not an error" +# ^ keyword +# ^ type +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ string + +import Kernel, except: [spawn: 1, +: 2, /: 2, Unless: 2] +# ^ keyword +# ^ type +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ punctuation.bracket +# ^ string.special.symbol +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ number +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ number +# ^ punctuation.bracket + +alias Long.Module.Name, as: N0men123_and4 +# ^ keyword +# ^ type +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ type + +use Bitwise +# ^ keyword +# ^ type diff --git a/test/highlight/literals.ex b/test/highlight/literals.ex new file mode 100644 index 0000000..c7a361b --- /dev/null +++ b/test/highlight/literals.ex @@ -0,0 +1,173 @@ +1234 ; 01234 +# ^ number +# ^ punctuation.delimiter +# ^ number + +1.23 ; 1.23e10 ; 1.23e-10 +# ^ number +# ^ number +# ^ number + +0xab ; 0o171 ; 0b01001 +# ^ number +# ^ number +# ^ number + +100_000_000 ; 0b1111_0000 +# ^ number +# ^ number + +?a ; ?1 ; ?\n ; ?\s ; ?\c ; ? ; ?, +# <- constant +# ^ constant +# ^ constant +# ^ constant +# ^ constant +# ^ constant +# ^ constant +# ^ constant + +true ; false ; nil +# ^ constant +# ^ constant +# ^ constant + +:this ; :that +# ^ string.special.symbol +# ^ string.special.symbol + +:'complex atom' +# ^ string.special.symbol + +:"with' \" 'quotes \u0301" +# ^ string.special.symbol +# ^ string.escape +# ^ string.escape +# ^ string.special.symbol +# ^ string.escape +# ^ string.escape + +:"with #{1 + 1} interpol" +# ^ punctuation.special +# ^ number +# ^ operator +# ^ number +# ^ punctuation.special + +:... ; :<<>> ; :%{} ; :% ; :{} +# ^ string.special.symbol +# ^ string.special.symbol +# ^ string.special.symbol +# ^ string.special.symbol +# ^ string.special.symbol + +:++ ; :-- ; :* ; :~~~ ; ::: +# ^ string.special.symbol +# ^ string.special.symbol +# ^ string.special.symbol +# ^ string.special.symbol +# ^ string.special.symbol + +:% ; :. ; :<- +# <- string.special.symbol +# ^ string.special.symbol +# ^ string.special.symbol + +"simple string" +# ^ string +# ^ string + +"with \x{ff} code" +# ^ string +# ^ string.escape +# ^ string.escape +# ^ string + +"with \7 \016 \t \\s" +# ^ string +# ^ string.escape +# ^ string.escape +# ^ string +# ^ string.escape +# ^ string +# ^ string.escape +# ^ string + +"with #{inspect "inner"} interpolation" +# ^ string +# ^ punctuation.special +# ^ function +# ^ string +# ^ punctuation.special +# ^ string + +"Multiline + string" +# <- string +# ^ string + +""" +Heredoc +""" +# ^ string + +'charlist' +# ^ string + +~s(string sigil #{1}) +# <- string +# ^ string +# ^ string +# ^ number + +~S/string #{1}/ +# ^ string + +~r/x?/iu +# <- string.regex +# ^ string.regex +# ^ string.regex + +~R{noescapes\}[a-z]*} +# ^ string.regex +# ^ string.escape +# ^ string.regex + +~w(hello #{ ["has" <> "123", '\c\d', "\123 interpol" | []] } world)s +#<- string.special +# ^ string.special +# ^ punctuation.special +# ^ punctuation.bracket +# ^ string +# ^ operator +# ^ string +# ^ punctuation.delimiter +# ^ string +# ^ string.escape +# ^ string.escape +# ^ string +# ^ punctuation.delimiter +# ^ string +# ^ string.escape +# ^ string +# ^ operator +# ^ punctuation.bracket +# ^ punctuation.bracket +# ^ punctuation.bracket +# ^ punctuation.special +# ^ string.special + +~w/yoo \\ \/ =)/ +# ^ string.special +# ^ string.escape +# ^ string.escape +# ^ string.special + +~W/yoo \\ \/ =)/ +# ^ string.special +# ^ string.special +# ^ string.escape +# ^ string.special + +~D/2020-01-01/d +# ^ string.special diff --git a/test/highlight/module.ex b/test/highlight/module.ex new file mode 100644 index 0000000..d85ef02 --- /dev/null +++ b/test/highlight/module.ex @@ -0,0 +1,319 @@ +defmodule Long.Module.Name do +# ^ keyword +# ^ type +# ^ type +# ^ keyword + + @moduledoc "Simple doc" + # <- comment.doc + # ^ comment.doc.__attribute__ + # ^ comment.doc + + @moduledoc false + # <- comment.doc + # ^ comment.doc.__attribute__ + # ^ comment.doc + + @moduledoc """ + Heredoc doc + """ + # ^ comment.doc + + @moduledoc ~S''' + Sigil doc + ''' + # ^ comment.doc + + @moduledoc "With #{1} interpolation" + # ^ punctuation.special + # ^ number + # ^ punctuation.special + + @typedoc "Type doc" + # <- comment.doc + + @doc "Type doc" + # <- comment.doc + + @doc """ + Multiline docstring + "with quotes" + and #{ inspect %{"interpolation" => "in" <> "action"} } + now with #{ {:a, 'tuple'} } + and #{ inspect { + :tuple, + %{ with: "nested #{ inspect %{ :interpolation => %{} } }" } + } } + """ + # <- comment.doc + + @spec func(type, integer()) :: :ok | :fail + # <- attribute + # ^ attribute + # ^ function + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.delimiter + # ^ function + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ operator + # ^ string.special.symbol + # ^ operator + # ^ string.special.symbol + + defstruct items: [] + # ^ keyword + # ^ string.special.symbol + # ^ punctuation.bracket + # ^ punctuation.bracket + + defexception [:message] + # ^ keyword + # ^ punctuation.bracket + # ^ string.special.symbol + # ^ punctuation.bracket + + @type item :: String.t() + # <- attribute + # ^ attribute + # ^ variable + # ^ operator + # ^ type + # ^ operator + # ^ function + # ^ punctuation.bracket + # ^ punctuation.bracket + + @attr "value" + # <- attribute + # ^ attribute + # ^ string + + @true + # ^ attribute + + @nil + # ^ attribute + + def f, do: nil + # ^ keyword + # ^ function + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ constant + + def f(x), do: x + # ^ keyword + # ^ function + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ variable + + def f(10), do: nil + # ^ keyword + # ^ function + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ constant + + def f(a, b \\ []), do: nil + # <- keyword + # ^ function + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.delimiter + # ^ variable + # ^ operator + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ constant + + def __before_compile__(_) do + # <- keyword + # ^ function + # ^ punctuation.bracket + # ^ comment.unused + # ^ punctuation.bracket + # ^ keyword + end + # <- keyword + + def with_guard(x) when x == 1 do: nil + # <- keyword + # ^ function + # ^ variable + # ^ keyword + # ^ variable + # ^ operator + # ^ number + # ^ keyword + # <- keyword + + def with_guard when is_integer(1), do: nil + # <- keyword + # ^ function + # ^ keyword + # ^ function + # ^ punctuation.bracket + # ^ number + # ^ punctuation.bracket + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ constant + + def x + y, do: nil + # ^ keyword + # ^ variable + # ^ operator + # ^ variable + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ constant + + def x |> y, do: nil + # ^ keyword + # ^ variable + # ^ operator + # ^ variable + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ constant + + def x and y, do: nil + # ^ keyword + # ^ variable + # ^ keyword + # ^ variable + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ constant + + def unquote(f)(x), do: nil + # ^ keyword + # ^ keyword + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ constant + + def unquote(name)(unquote_splicing(args)), do: nil + # ^ keyword + # ^ keyword + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ keyword + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ string.special.symbol + # ^ constant + + def(test(x), do: x) + # ^ keyword + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ variable + # ^ punctuation.bracket + + defguard is_something(one), do: one != nil + # ^ keyword + # ^ function + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ variable + # ^ operator + # ^ constant + + defdelegate empty?(list), to: Enum + # ^ keyword + # ^ function + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ punctuation.delimiter + # ^ string.special.symbol + # ^ type + + defmacro meta_function(name) do + # ^ keyword + # ^ function + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket + # ^ keyword + quote do + # ^ keyword + # ^ keyword + def unquote(:"#{name}_foo")() do + # ^ keyword + # ^ keyword + # ^ punctuation.bracket + # ^ string.special.symbol + # ^ punctuation.special + # ^ variable + # ^ punctuation.special + # ^ string.special.symbol + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ punctuation.bracket + # ^ keyword + unquote("yessir") + # ^ keyword + # ^ punctuation.bracket + # ^ string + # ^ punctuation.bracket + end + # <- keyword + end + # <- keyword + end + # <- keyword +end +# <- keyword + +defprotocol Useless do +# ^ keyword +# ^ type +# ^ keyword + def func(this) + # ^ keyword + # ^ function + # ^ punctuation.bracket + # ^ variable + # ^ punctuation.bracket +end +# <- keyword + +defimpl Useless, for: Atom do +# ^ keyword +# ^ type +# ^ punctuation.delimiter +# ^ string.special.symbol +# ^ type +# ^ keyword +end +# <- keyword diff --git a/test/highlight/operators.ex b/test/highlight/operators.ex new file mode 100644 index 0000000..96072f8 --- /dev/null +++ b/test/highlight/operators.ex @@ -0,0 +1,67 @@ +a ~>> b = bind(a, b) +# <- variable +# ^ operator +# ^ variable +# ^ operator +# ^ function +# ^ punctuation.bracket +# ^ variable +# ^ punctuation.delimiter +# ^ variable +# ^ punctuation.bracket + +a ~> b +# ^ operator + +a + b +# ^ operator + +... == !x && y || z +# <- variable +# ^ operator +# ^ operator +# ^ variable +# ^ operator +# ^ variable +# ^ operator +# ^ variable + +x = 1 + 2.0 * 3 +# <- variable +# ^ operator +# ^ number +# ^ operator +# ^ number +# ^ operator +# ^ number + +y = true and false +# <- variable +# ^ operator +# ^ constant +# ^ keyword +# ^ constant + +{ ^z, a } = {true, x} +# <- punctuation.bracket +# ^ operator +# ^ variable +# ^ punctuation.delimiter +# ^ variable +# ^ operator +# ^ punctuation.bracket +# ^ constant +# ^ punctuation.delimiter +# ^ variable +# ^ punctuation.bracket + +"hello" |> String.upcase |> String.downcase() +# ^ string +# ^ operator +# ^ type +# ^ operator +# ^ function +# ^ operator +# ^ type +# ^ operator +# ^ function