pax_global_header00006660000000000000000000000064144125076710014521gustar00rootroot0000000000000052 comment=5552bb08974cad96770220c86bc142e4c28a303c makeup_elixir-0.16.1/000077500000000000000000000000001441250767100144445ustar00rootroot00000000000000makeup_elixir-0.16.1/.formatter.exs000066400000000000000000000000761441250767100172510ustar00rootroot00000000000000[ inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"], ] makeup_elixir-0.16.1/.github/000077500000000000000000000000001441250767100160045ustar00rootroot00000000000000makeup_elixir-0.16.1/.github/workflows/000077500000000000000000000000001441250767100200415ustar00rootroot00000000000000makeup_elixir-0.16.1/.github/workflows/ci.yml000066400000000000000000000016521441250767100211630ustar00rootroot00000000000000name: CI on: pull_request: push: branches: - master jobs: test: runs-on: ubuntu-16.04 env: MIX_ENV: test strategy: fail-fast: false matrix: include: - pair: elixir: 1.6.6 otp: 19.3.6.13 - pair: elixir: 1.11.4 otp: 23.2.7 lint: lint steps: - uses: actions/checkout@v2 - uses: erlef/setup-elixir@v1 with: otp-version: ${{matrix.pair.otp}} elixir-version: ${{matrix.pair.elixir}} - name: Install Dependencies run: mix deps.get --only test - run: mix format --check-formatted if: ${{ matrix.lint }} - run: mix deps.get && mix deps.unlock --check-unused if: ${{ matrix.lint }} - run: mix deps.compile - run: mix compile --warnings-as-errors if: ${{ matrix.lint }} - run: mix test makeup_elixir-0.16.1/.gitignore000066400000000000000000000010111441250767100164250ustar00rootroot00000000000000# The directory Mix will write compiled artifacts to. /_build/ # If you run "mix test --cover", coverage assets end up here. /cover/ # The directory Mix downloads your dependencies sources to. /deps/ # Where 3rd-party dependencies like ExDoc output generated docs. /doc/ # Ignore .fetch files in case you like to edit your project deps locally. /.fetch # If the VM crashes, it generates a dump, let's ignore it too. erl_crash.dump # Also ignore archive artifacts (built via "mix archive.build"). *.ez .elixir_ls/**makeup_elixir-0.16.1/CHANGELOG.md000066400000000000000000000014461441250767100162620ustar00rootroot00000000000000# Changelog ## 0.16.1 (2023-04-03) * Relax NimbleParsec dependency ## 0.16.0 (2022-03-07) Export the `root` and `root_parsec` parsecs as combinators so that they can be used from other modules. This is backward-compatible with the previous version (it only adds some new exports to the module). This way, the `root` and `root_parsec` combinators can be used from other lexers (such as the `EExLexer` for examples). ## 0.15.2 (2021-10-13) * Highlight Erlang calls as modules. * Support digits as modifiers in sigils. * Support stepped ranges operators `..//`. ## 0.15.1 (2021-01-29) * Multiple bug fixes and update list of tokens. ## 0.15.0 (2020-10-02) * Added support for Unicode characters in identifiers (atoms and variables). * Improved handling of sigils. makeup_elixir-0.16.1/LICENSE000066400000000000000000000024631441250767100154560ustar00rootroot00000000000000Copyright (c) 2006-2021 by the respective authors (see AUTHORS file). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. makeup_elixir-0.16.1/README.md000066400000000000000000000010271441250767100157230ustar00rootroot00000000000000# MakeupElixir [![Build Status](https://github.com/elixir-makeup/makeup_elixir/workflows/CI/badge.svg)](https://github.com/elixir-makeup/makeup_elixir/actions) A [Makeup](https://github.com/elixir-makeup/makeup/) lexer for the Elixir language. ## Installation Add `makeup_elixir` to your list of dependencies in `mix.exs`: ```elixir def deps do [ {:makeup_elixir, "~> 0.14.0"} ] end ``` The lexer will be automatically registered in Makeup for the languages "elixir" and "iex" as well as the extensions ".ex" and ".exs". makeup_elixir-0.16.1/benchmarks/000077500000000000000000000000001441250767100165615ustar00rootroot00000000000000makeup_elixir-0.16.1/benchmarks/data/000077500000000000000000000000001441250767100174725ustar00rootroot00000000000000makeup_elixir-0.16.1/benchmarks/data/example_file.exs000066400000000000000000000103641441250767100226510ustar00rootroot00000000000000# Numbers 0b0101011 1234 ; 0x1A ; 0xbeef ; 0763 ; 0o123 3.14 ; 5.0e21 ; 0.5e-12 100_000_000 # these are not valid numbers 0b012 ; 0xboar ; 0o888 0B01 ; 0XAF ; 0O123 # Characters ?a ; ?1 ; ?\n ; ?\s ; ?\c ; ? ; ?, ?\x{12} ; ?\x{abcd} ?\x34 ; ?\xF # these show that only the first digit is part of the character ?\123 ; ?\12 ; ?\7 # Atoms :this ; :that :'complex atom' :"with' \"\" 'quotes" :" multi line ' \s \123 \xff atom" :... ; :<<>> ; :%{} ; :% ; :{} :++; :--; :*; :~~~; ::: :% ; :. ; :<- # Strings "Hello world" "Interspersed \x{ff} codes \7 \8 \65 \016 and \t\s\\s\z\+ \\ escapes" "Quotes ' inside \" \123 the \"\" \xF \\xF string \\\" end" "Multiline string" # Char lists 'this is a list' 'escapes \' \t \\\'' 'Multiline char list ' # Binaries <<1, 2, 3>> <<"hello"::binary, c :: utf8, x::[4, unit(2)]>> = "hello™1" # Sigils ~r/this + i\s "a" regex/ ~R'this + i\s "a" regex too' ~w(hello #{ ["has" <> "123", '\c\d', "\123 interpol" | []] } world)s ~W(hello #{no "123" \c\d \123 interpol} world)s ~s{Escapes terminators \{ and \}, but no {balancing} # outside of sigil here } ~S"No escapes \s\t\n and no #{interpolation}" :"atoms work #{"to" <> "o"}" # Operators x = 1 + 2.0 * 3 y = true and false; z = false or true ... = 144 ... == !x && y || z "hello" |> String.upcase |> String.downcase() {^z, a} = {true, x} # Free operators (added in 1.0.0) p ~>> f = bind(p, f) p1 ~> p2 = pair_right(p1, p2) p1 <~ p2 = pair_left(p1, p2) p1 <~> p2 = pair_both(p1, p2) p |~> f = map(p, f) p1 <|> p2 = either(p1, p2) # Lists, tuples, maps, keywords [1, :a, 'hello'] ++ [2, 3] [:head | [?t, ?a, ?i, ?l]] {:one, 2.0, "three"} [...: "this", <<>>: "is", %{}: "a keyword", %: "list", {}: "too"] ["this is an atom too": 1, "so is this": 2] [option: "value", key: :word] [++: "operator", ~~~: :&&&] map = %{shortcut: "syntax"} %{map | "update" => "me"} %{ 12 => 13, :weird => ['thing'] } # Comprehensions for x <- 1..10, x < 5, do: {x, x} pixels = "12345678" for << <> <- pixels >> do [r, {g, %{"b" => a}}] end # String interpolation "String #{inspect "interpolation"} is quite #{1+4+7} difficult" # Identifiers abc_123 = 1 _018OP = 2 A__0 == 3 # Modules defmodule Long.Module.Name do @moduledoc "Simple module docstring" @doc """ Multiline docstring "with quotes" and #{ inspect %{"interpolation" => "in" <> "action"} } now with #{ {:a, 'tuple'} } and #{ inspect { :tuple, %{ with: "nested #{ inspect %{ :interpolation => %{} } }" } } } """ defstruct [:a, :name, :height] @doc ~S''' No #{interpolation} of any kind. \000 \x{ff} \n #{\x{ff}} ''' def func(a, b \\ []), do: :ok @doc false def __before_compile__(_) do :ok end end # Structs defmodule Second.Module do s = %Long.Module.Name{name: "Silly"} %Long.Module.Name{s | height: {192, :cm}} ".. #{%Long.Module.Name{s | height: {192, :cm}}} .." end # Types, pseudo-vars, attributes defmodule M do @custom_attr :some_constant @before_compile Long.Module.Name @typedoc "This is a type" @type typ :: integer @typedoc """ Another type """ @opaque typtyp :: 1..10 @spec func(typ, typtyp) :: :ok | :fail def func(a, b) do a || b || :ok || :fail Path.expand("..", __DIR__) IO.inspect __ENV__ __NOTAPSEUDOVAR__ = 11 __MODULE__.func(b, a) end defmacro m() do __CALLER__ end end # Functions anon = fn x, y, z -> fn(a, b, c) -> &(x + y - z * a / &1 + b + div(&2, c)) end end &Set.put(&1, &2) ; & Set.put(&1, &2) ; &( Set.put(&1, &1) ) # Function calls anon.(1, 2, 3); self; hd([1,2,3]) Kernel.spawn(fn -> :ok end) IO.ANSI.black # Control flow if :this do :that else :otherwise end pid = self receive do {:EXIT, _} -> :done {^pid, :_} -> nil after 100 -> :no_luck end case __ENV__.line do x when is_integer(x) -> x x when x in 1..12 -> -x end cond do false -> "too bad" 4 > 5 -> "oops" true -> nil end # Lexical scope modifiers import Kernel, except: [spawn: 1, +: 2, /: 2, Unless: 2] alias Long.Module.Name, as: N0men123_and4 use Bitwise 4 &&& 5 2 <<< 3 # Protocols defprotocol Useless do def func1(this) def func2(that) end defimpl Useless, for: Atom do end # Exceptions defmodule NotAnError do defexception [:message] end raise NotAnError, message: "This is not an error" makeup_elixir-0.16.1/benchmarks/main.exs000066400000000000000000000022041441250767100202240ustar00rootroot00000000000000alias Makeup.Lexers.ElixirLexer alias Makeup.Formatters.HTML.HTMLFormatter # Test file taken from the Pygments' test suite source_path = "benchmarks/data/example_file.exs" # Read the file into a variable because we're not interested in the time it takes to read from disk. code = File.read!(source_path) # Get a list of tokens from the code above, so that we can test the HTML Formatter in isolation tokens = ElixirLexer.lex(code) Benchee.run(%{ "Lexer performance" => fn -> ElixirLexer.lex(code) end, "Formatter performance" => fn -> HTMLFormatter.format_as_binary(tokens) end, "Lexer + Formatter" => fn -> code |> ElixirLexer.lex() |> HTMLFormatter.format_as_binary() end, "Reading file from disk + Lexer + Formatter (end to end)" => fn -> source_path |> File.read!() |> ElixirLexer.lex() |> HTMLFormatter.format_as_binary() end, "Lexer compilation time" => fn -> Kernel.ParallelCompiler.compile(["lib/makeup/lexers/elixir_lexer.ex"]) end }, console: [ # Don't display comparisons because we're testing different things # Comparisons would be meaningless comparison: false ]) makeup_elixir-0.16.1/lib/000077500000000000000000000000001441250767100152125ustar00rootroot00000000000000makeup_elixir-0.16.1/lib/makeup/000077500000000000000000000000001441250767100164745ustar00rootroot00000000000000makeup_elixir-0.16.1/lib/makeup/lexers/000077500000000000000000000000001441250767100177765ustar00rootroot00000000000000makeup_elixir-0.16.1/lib/makeup/lexers/elixir_lexer.ex000066400000000000000000000446221441250767100230370ustar00rootroot00000000000000defmodule Makeup.Lexers.ElixirLexer do @moduledoc """ A `Makeup` lexer for the Elixir language. """ import NimbleParsec import Makeup.Lexer.Combinators import Makeup.Lexer.Groups import Makeup.Lexers.ElixirLexer.Helper @behaviour Makeup.Lexer ################################################################### # Step #1: tokenize the input (into a list of tokens) ################################################################### # We will often compose combinators into larger combinators. # Sometimes, the smaller combinator is useful on its own as a token, and sometimes it isn't. # We'll adopt the following "convention": # # 1. A combinator that ends with `_name` returns a string # 2. Other combinators will *usually* return a token # # Why this convention? Tokens can't be composed further, while raw strings can. # This way, we immediately know which of the combinators we can compose. # TODO: check we're following this convention # NOTE: if Elixir had a good static type system it would help us do the right thing here. whitespace = ascii_string([?\r, ?\s, ?\n, ?\f], min: 1) |> token(:whitespace) newlines = optional(ascii_string([?\s, ?\t, ?\r], min: 1)) |> choice([string("\r\n"), string("\n")]) |> optional(ascii_string([?\s, ?\n, ?\f, ?\r], min: 1)) |> token(:whitespace) any_char = utf8_char([]) |> token(:error) # Numbers digits = ascii_string([?0..?9], min: 1) bin_digits = ascii_string([?0..?1], min: 1) hex_digits = ascii_string([?0..?9, ?a..?f, ?A..?F], min: 1) oct_digits = ascii_string([?0..?7], min: 1) # Digits in an integer may be separated by underscores number_bin_part = with_optional_separator(bin_digits, "_") number_oct_part = with_optional_separator(oct_digits, "_") number_hex_part = with_optional_separator(hex_digits, "_") integer = with_optional_separator(digits, "_") # Tokens for the lexer number_bin = string("0b") |> concat(number_bin_part) |> token(:number_bin) number_oct = string("0o") |> concat(number_oct_part) |> token(:number_oct) number_hex = string("0x") |> concat(number_hex_part) |> token(:number_hex) # Base 10 number_integer = token(integer, :number_integer) # Floating point numbers float_scientific_notation_part = ascii_string([?e, ?E], 1) |> optional(string("-")) |> concat(integer) number_float = integer |> string(".") |> concat(integer) |> optional(float_scientific_notation_part) |> token(:number_float) variable_name = parsec({Makeup.Lexers.ElixirLexer.Variables, :variable_start_chars}) |> repeat(parsec({Makeup.Lexers.ElixirLexer.Variables, :variable_continue_chars})) |> optional(utf8_char([??, ?!])) variable = variable_name |> lexeme |> token(:name) # TODO: as above alias_part = ascii_string([?A..?Z], 1) |> optional(ascii_string([?a..?z, ?_, ?0..?9, ?A..?Z], min: 1)) module_name = alias_part |> concat(repeat(string(".") |> concat(alias_part))) module = token(module_name, :name_class) operator_name = word_from_list(~W( <<< >>> ||| &&& ^^^ ~~~ === !== ~>> <~> |~> <|> == != <= >= && || \\ <> ++ -- |> =~ -> <- ~> <~ :: .. = < > + - * / | . ^ & ! // )) operator = token(operator_name, :operator) # The lexer needs to test these before `>>` and `<<` bitshifts = word_from_list(~W(<<< >>>)) |> token(:operator) special_atom_name = word_from_list(~W(... <<>> %{} % {} ..//)) triple_dot = token("...", :name) map_arrow = token("=>", :punctuation) anon_function_arguments = string("&") |> concat(digits) |> token(:name_entity) normal_char = string("?") |> utf8_string([], 1) |> token(:string_char) escape_char = string("?\\") |> utf8_string([], 1) |> token(:string_char) special_atom = string(":") |> concat(special_atom_name) |> token(:string_symbol) attribute = string("@") |> concat(variable_name) |> token(:name_attribute) punctuation = word_from_list( [":", ";", ",", ".", "%"], :punctuation ) # Combinators that highlight elixir expressions surrounded by a pair of delimiters. # Most of the time, the delimiters can be described by symple characters, but the # combinator that parses a struct is more complex interpolation = many_surrounded_by(parsec(:root_element), "\#{", "}", :string_interpol) tuple = many_surrounded_by(parsec(:root_element), "{", "}") binary_inside_opaque_struct = many_surrounded_by(parsec(:root_element), "<<", ">>") # Only for the IEx lexer (it's not valid Elixir code): opaque_struct = many_surrounded_by( choice([ binary_inside_opaque_struct, parsec(:root_element) ]), token("#", :punctuation) |> concat(module) |> concat(token("<", :punctuation)), token(">", :punctuation) ) delimiters_punctuation = word_from_list( ~W( ( \) [ ] << >>), :punctuation ) map = many_surrounded_by(parsec(:root_element), "%{", "}") delimiter_pairs = [ delimiters_punctuation, tuple, map ] normal_atom_name = parsec({Makeup.Lexers.ElixirLexer.Atoms, :atom_start_chars}) |> repeat(parsec({Makeup.Lexers.ElixirLexer.Atoms, :atom_continue_chars})) |> optional(utf8_char([??, ?!])) normal_atom = string(":") |> choice([operator_name, normal_atom_name]) |> token(:string_symbol) unicode_char_in_string = string("\\u") |> ascii_string([?0..?9, ?a..?f, ?A..?F], 4) |> token(:string_escape) escaped_char = string("\\") |> utf8_string([], 1) |> token(:string_escape) # We must support iex prompts inside a string, sigil or heredoc. # For example: # # iex(1)> a = """ # ...(1)> line1 # ...(1)> line2 # ...(1)> """ # # Inside the string we don't expect the `iex>` prompt, only the `...>` prompt. iex_prompt_inside_string = string("\n...") |> optional(string("(") |> concat(digits) |> string(")")) |> string(">") |> optional(string(" ")) |> token(:generic_prompt, %{selectable: false}) combinators_inside_string = [ unicode_char_in_string, escaped_char, interpolation, iex_prompt_inside_string ] string_atom = choice([ string_like(":\"", "\"", combinators_inside_string, :string_symbol), string_like(":'", "'", combinators_inside_string, :string_symbol) ]) atom = choice([ special_atom, normal_atom, string_atom ]) string_keyword = choice([ string_like("\"", "\"", combinators_inside_string, :string_symbol), string_like("'", "'", combinators_inside_string, :string_symbol) ]) |> concat(token(string(":"), :punctuation)) normal_keyword = choice([operator_name, normal_atom_name]) |> token(:string_symbol) |> concat(token(string(":"), :punctuation)) keyword = choice([ normal_keyword, string_keyword ]) |> lookahead(whitespace) sigil_delimiters = [ {~S["""], ~S["""]}, {"'''", "'''"}, {"\"", "\""}, {"'", "'"}, {"/", "/"}, {"{", "}"}, {"[", "]"}, {"(", ")"}, {"<", ">"}, {"|", "|"} ] sigils_interpol = for {ldelim, rdelim} <- sigil_delimiters do sigil(ldelim, rdelim, [?a..?z], combinators_inside_string) end sigils_no_interpol = for {ldelim, rdelim} <- sigil_delimiters do sigil(ldelim, rdelim, [?A..?Z], [escape_delim(rdelim), iex_prompt_inside_string]) end all_sigils = sigils_interpol ++ sigils_no_interpol double_quoted_string_interpol = string_like("\"", "\"", combinators_inside_string, :string) single_quoted_string_interpol = string_like("'", "'", combinators_inside_string, :string_char) double_quoted_heredocs = string_like(~S["""], ~S["""], combinators_inside_string, :string) single_quoted_heredocs = string_like("'''", "'''", combinators_inside_string, :string_char) # `#PID<123.456.789>` pid = token("#", :punctuation) |> concat(token("PID", :name_class)) |> concat(token("<", :punctuation)) |> concat(number_integer) |> concat(token(".", :operator)) |> concat(number_integer) |> concat(token(".", :operator)) |> concat(number_integer) |> concat(token(">", :punctuation)) line = repeat(lookahead_not(ascii_char([?\n])) |> utf8_string([], 1)) inline_comment = string("#") |> concat(line) |> token(:comment_single) # An IEx prompt is supported in the normal Elixir lexer because false positives # would be extremely rare iex_prompt = choice([string("iex"), string("...")]) |> optional(string("(") |> concat(digits) |> string(")")) |> string(">") |> optional(string(" ")) |> token(:generic_prompt, %{selectable: false}) stacktrace = string("** (") # The rest of the line is part of the traceback |> concat(line) # All lines indented by 4 spaces are part of the traceback |> repeat(string("\n ") |> concat(line)) |> token(:generic_traceback) root_element_combinator = choice( [ # START of IEx-specific tokens # IEx prompt must come before names newlines |> choice([iex_prompt, stacktrace]), # a PID is a special kind of opaque struct pid, # Opaque struct (must come before inline comments) opaque_struct, # END of IEx-specific tokens whitespace, # Comments inline_comment, # Syntax sugar for keyword lists (must come before variables and strings) keyword, # Strings and sigils double_quoted_heredocs, single_quoted_heredocs, double_quoted_string_interpol, single_quoted_string_interpol ] ++ all_sigils ++ [ # Chars escape_char, normal_char, # Atoms atom, # Module attributes attribute, # Anonymous function arguments (must come before the operators) anon_function_arguments, # Bitwise operators must match first bitshifts # Matching delimiters ] ++ delimiter_pairs ++ [ # Triple dot (must come before operators) triple_dot, # Map arrow (must come before operators) map_arrow, # Operators operator, # Numbers number_bin, number_oct, number_hex, # Floats must come before integers number_float, number_integer, # Names variable, # Module names module, punctuation, # If we can't parse any of the above, we highlight the next character as an error # and proceed from there. # A lexer should always consume any string given as input. any_char ] ) # By default, don't inline the lexers. # Inlining them increases performance by ~20% # at the cost of doubling the compilation times... @inline false @doc false def __as_elixir_language__({ttype, meta, value}) do {ttype, Map.put(meta, :language, :elixir), value} end # Semi-public API: these two functions can be used by someone who wants to # embed an Elixir lexer into another lexer, but other than that, they are not # meant to be used by end-users. # @impl Makeup.Lexer defparsec( :root_element, root_element_combinator |> map({__MODULE__, :__as_elixir_language__, []}), inline: @inline, export_combinator: true ) # @impl Makeup.Lexer defparsec( :root, repeat(parsec(:root_element)), inline: @inline, export_combinator: true ) ################################################################### # Step #2: postprocess the list of tokens ################################################################### @def_like ~W[def defp defmacro defmacrop defguard defguardp defn defnp] @keyword_declaration @def_like ++ ~W[ defmodule defprotocol defdelegate defexception defstruct defimpl] @keyword ~W[ fn do end after else rescue catch with case cond for if unless try receive raise quote unquote unquote_splicing throw super] @operator_word ~W[not and or when in] @keyword_namespace ~W[import require use alias] @name_constant ~W[nil true false] @name_builtin_pseudo ~W[_ __MODULE__ __DIR__ __ENV__ __CALLER__] # The `postprocess/1` function will require a major redesign when we decide to support # custom `def`-like keywords supplied by the user. defp postprocess_helper([]), do: [] # In an expression such as: # # def a + b, do: nil # # the variable_name `a` is a parameter for the `+/2` operator. # It should not be highlighted as a function name. # for that, we must scan a little further (one additional token) for the operator. defp postprocess_helper([ {:name, attrs1, text1}, {:whitespace, _, _} = ws1, {:name, _, text2} = param, {:whitespace, _, _} = ws2, {:operator, _, _} = op | tokens ]) when text1 in @def_like and text2 != "unquote" do [{:keyword_declaration, attrs1, text1}, ws1, param, ws2, op | postprocess_helper(tokens)] end # The same as above without whitespace defp postprocess_helper([ {:name, attrs1, text1}, {:whitespace, _, _} = ws, {:name, _, text2} = param, {:operator, _, _} = op | tokens ]) when text1 in @def_like and text2 != "unquote" do [{:keyword_declaration, attrs1, text1}, ws, param, op | postprocess_helper(tokens)] end # If we're matching this branch, we already know that this is not an operator definition. # We can highlight the variable_name after the function name as a function name. defp postprocess_helper([ {:name, attrs1, text1}, {:whitespace, _, _} = ws, {:name, attrs2, text2} | tokens ]) when text1 in @def_like and text2 != "unquote" do [ {:keyword_declaration, attrs1, text1}, ws, {:name_function, attrs2, text2} | postprocess_helper(tokens) ] end # When calling functions from an erlang module, highlight the atom as a module. # # :crypto.strong_rand_bytes(4) defp postprocess_helper([ {:string_symbol, attrs1, [":" | _] = module}, {:operator, _, "."} = op, {:name, _, _} = text | tokens ]) do [{:name_class, attrs1, module}, op, text | postprocess_helper(tokens)] end defp postprocess_helper([{:name, attrs, text} | tokens]) when text in @keyword, do: [{:keyword, attrs, text} | postprocess_helper(tokens)] defp postprocess_helper([{:name, attrs, text} | tokens]) when text in @keyword_declaration, do: [{:keyword_declaration, attrs, text} | postprocess_helper(tokens)] defp postprocess_helper([{:name, attrs, text} | tokens]) when text in @operator_word, do: [{:operator_word, attrs, text} | postprocess_helper(tokens)] defp postprocess_helper([{:name, attrs, text} | tokens]) when text in @keyword_namespace, do: [{:keyword_namespace, attrs, text} | postprocess_helper(tokens)] defp postprocess_helper([{:name, attrs, text} | tokens]) when text in @name_constant, do: [{:name_constant, attrs, text} | postprocess_helper(tokens)] defp postprocess_helper([{:name, attrs, text} | tokens]) when text in @name_builtin_pseudo, do: [{:name_builtin_pseudo, attrs, text} | postprocess_helper(tokens)] # Unused variables defp postprocess_helper([{:name, attrs, "_" <> _name = text} | tokens]), do: [{:comment, attrs, text} | postprocess_helper(tokens)] # Otherwise, don't do anything with the current token and go to the next token. defp postprocess_helper([token | tokens]), do: [token | postprocess_helper(tokens)] # Public API @impl Makeup.Lexer def postprocess(tokens, _opts \\ []), do: postprocess_helper(tokens) ################################################################### # Step #3: highlight matching delimiters ################################################################### @impl Makeup.Lexer defgroupmatcher(:match_groups, do_end: [ open: [ [{:keyword, %{language: :elixir}, "do"}] ], middle: [ [{:keyword, %{language: :elixir}, "else"}], [{:keyword, %{language: :elixir}, "catch"}], [{:keyword, %{language: :elixir}, "rescue"}], [{:keyword, %{language: :elixir}, "after"}] ], close: [ [{:keyword, %{language: :elixir}, "end"}] ] ], fn_end: [ open: [[{:keyword, %{language: :elixir}, "fn"}]], close: [[{:keyword, %{language: :elixir}, "end"}]] ], parentheses: [ open: [[{:punctuation, %{language: :elixir}, "("}]], close: [[{:punctuation, %{language: :elixir}, ")"}]] ], list: [ open: [ [{:punctuation, %{language: :elixir}, "["}] ], close: [ [{:punctuation, %{language: :elixir}, "]"}] ] ], tuple: [ open: [ [{:punctuation, %{language: :elixir}, "{"}] ], close: [ [{:punctuation, %{language: :elixir}, "}"}] ] ], map: [ open: [ [{:punctuation, %{language: :elixir}, "%{"}] ], close: [ [{:punctuation, %{language: :elixir}, "}"}] ] ], struct: [ open: [ [ {:punctuation, %{language: :elixir}, "%"}, {:name_class, %{language: :elixir}, _}, {:punctuation, %{language: :elixir}, "{"} ] ], close: [ [{:punctuation, %{language: :elixir}, "}"}] ] ], opaque_struct: [ open: [ [ {:punctuation, %{language: :elixir}, "#"}, {:name_class, %{language: :elixir}, _}, {:punctuation, %{language: :elixir}, "<"} ] ], close: [ [{:punctuation, %{language: :elixir}, ">"}] ] ], binaries: [ open: [ [{:punctuation, %{language: :elixir}, "<<"}] ], close: [ [{:punctuation, %{language: :elixir}, ">>"}] ] ], interpolation: [ open: [ [{:string_interpol, %{language: :elixir}, "\#{"}] ], close: [ [{:string_interpol, %{language: :elixir}, "}"}] ] ] ) defp remove_initial_newline([{ttype, meta, text} | tokens]) do case to_string(text) do "\n" -> tokens "\n" <> rest -> [{ttype, meta, rest} | tokens] end end # Finally, the public API for the lexer @impl Makeup.Lexer def lex(text, opts \\ []) do group_prefix = Keyword.get(opts, :group_prefix, random_prefix(10)) {:ok, tokens, "", _, _, _} = root("\n" <> text) tokens |> remove_initial_newline() |> postprocess([]) |> match_groups(group_prefix) end end makeup_elixir-0.16.1/lib/makeup/lexers/elixir_lexer/000077500000000000000000000000001441250767100224715ustar00rootroot00000000000000makeup_elixir-0.16.1/lib/makeup/lexers/elixir_lexer/application.ex000066400000000000000000000005641441250767100253370ustar00rootroot00000000000000defmodule Makeup.Lexers.ElixirLexer.Application do @moduledoc false use Application alias Makeup.Registry alias Makeup.Lexers.ElixirLexer def start(_type, _args) do Registry.register_lexer(ElixirLexer, options: [], names: ["elixir", "iex"], extensions: ["ex", "exs"] ) Supervisor.start_link([], strategy: :one_for_one) end end makeup_elixir-0.16.1/lib/makeup/lexers/elixir_lexer/atoms.ex000066400000000000000000001377111441250767100241640ustar00rootroot00000000000000# Generated from lib/makeup/lexers/elixir_lexer/atoms.ex.exs, do not edit. # Generated at 2020-10-02 20:53:56Z. defmodule Makeup.Lexers.ElixirLexer.Atoms do @moduledoc false def atom_continue_chars__0( <>, acc, stack, context, comb__line, comb__offset ) when (x0 >= 48 and x0 <= 57) or (x0 >= 64 and x0 <= 90) or x0 === 95 or (x0 >= 97 and x0 <= 122) or x0 === 170 or x0 === 181 or x0 === 183 or x0 === 186 or (x0 >= 192 and x0 <= 214) or (x0 >= 216 and x0 <= 246) or (x0 >= 248 and x0 <= 705) or (x0 >= 710 and x0 <= 721) or (x0 >= 736 and x0 <= 740) or x0 === 748 or x0 === 750 or (x0 >= 768 and x0 <= 884) or (x0 >= 886 and x0 <= 887) or (x0 >= 890 and x0 <= 893) or x0 === 895 or (x0 >= 902 and x0 <= 906) or x0 === 908 or (x0 >= 910 and x0 <= 929) or (x0 >= 931 and x0 <= 1013) or (x0 >= 1015 and x0 <= 1153) or (x0 >= 1155 and x0 <= 1159) or (x0 >= 1162 and x0 <= 1327) or (x0 >= 1329 and x0 <= 1366) or x0 === 1369 or (x0 >= 1376 and x0 <= 1416) or (x0 >= 1425 and x0 <= 1469) or x0 === 1471 or (x0 >= 1473 and x0 <= 1474) or (x0 >= 1476 and x0 <= 1477) or x0 === 1479 or (x0 >= 1488 and x0 <= 1514) or (x0 >= 1519 and x0 <= 1522) or (x0 >= 1552 and x0 <= 1562) or (x0 >= 1568 and x0 <= 1641) or (x0 >= 1646 and x0 <= 1747) or (x0 >= 1749 and x0 <= 1756) or (x0 >= 1759 and x0 <= 1768) or (x0 >= 1770 and x0 <= 1788) or x0 === 1791 or (x0 >= 1808 and x0 <= 1866) or (x0 >= 1869 and x0 <= 1969) or (x0 >= 1984 and x0 <= 2037) or x0 === 2042 or x0 === 2045 or (x0 >= 2048 and x0 <= 2093) or (x0 >= 2112 and x0 <= 2139) or (x0 >= 2144 and x0 <= 2154) or (x0 >= 2208 and x0 <= 2228) or (x0 >= 2230 and x0 <= 2247) or (x0 >= 2259 and x0 <= 2273) or (x0 >= 2275 and x0 <= 2403) or (x0 >= 2406 and x0 <= 2415) or (x0 >= 2417 and x0 <= 2435) or (x0 >= 2437 and x0 <= 2444) or (x0 >= 2447 and x0 <= 2448) or (x0 >= 2451 and x0 <= 2472) or (x0 >= 2474 and x0 <= 2480) or x0 === 2482 or (x0 >= 2486 and x0 <= 2489) or (x0 >= 2492 and x0 <= 2500) or (x0 >= 2503 and x0 <= 2504) or (x0 >= 2507 and x0 <= 2510) or x0 === 2519 or (x0 >= 2524 and x0 <= 2525) or (x0 >= 2527 and x0 <= 2531) or (x0 >= 2534 and x0 <= 2545) or x0 === 2556 or x0 === 2558 or (x0 >= 2561 and x0 <= 2563) or (x0 >= 2565 and x0 <= 2570) or (x0 >= 2575 and x0 <= 2576) or (x0 >= 2579 and x0 <= 2600) or (x0 >= 2602 and x0 <= 2608) or (x0 >= 2610 and x0 <= 2611) or (x0 >= 2613 and x0 <= 2614) or (x0 >= 2616 and x0 <= 2617) or x0 === 2620 or (x0 >= 2622 and x0 <= 2626) or (x0 >= 2631 and x0 <= 2632) or (x0 >= 2635 and x0 <= 2637) or x0 === 2641 or (x0 >= 2649 and x0 <= 2652) or x0 === 2654 or (x0 >= 2662 and x0 <= 2677) or (x0 >= 2689 and x0 <= 2691) or (x0 >= 2693 and x0 <= 2701) or (x0 >= 2703 and x0 <= 2705) or (x0 >= 2707 and x0 <= 2728) or (x0 >= 2730 and x0 <= 2736) or (x0 >= 2738 and x0 <= 2739) or (x0 >= 2741 and x0 <= 2745) or (x0 >= 2748 and x0 <= 2757) or (x0 >= 2759 and x0 <= 2761) or (x0 >= 2763 and x0 <= 2765) or x0 === 2768 or (x0 >= 2784 and x0 <= 2787) or (x0 >= 2790 and x0 <= 2799) or (x0 >= 2809 and x0 <= 2815) or (x0 >= 2817 and x0 <= 2819) or (x0 >= 2821 and x0 <= 2828) or (x0 >= 2831 and x0 <= 2832) or (x0 >= 2835 and x0 <= 2856) or (x0 >= 2858 and x0 <= 2864) or (x0 >= 2866 and x0 <= 2867) or (x0 >= 2869 and x0 <= 2873) or (x0 >= 2876 and x0 <= 2884) or (x0 >= 2887 and x0 <= 2888) or (x0 >= 2891 and x0 <= 2893) or (x0 >= 2901 and x0 <= 2903) or (x0 >= 2908 and x0 <= 2909) or (x0 >= 2911 and x0 <= 2915) or (x0 >= 2918 and x0 <= 2927) or x0 === 2929 or (x0 >= 2946 and x0 <= 2947) or (x0 >= 2949 and x0 <= 2954) or (x0 >= 2958 and x0 <= 2960) or (x0 >= 2962 and x0 <= 2965) or (x0 >= 2969 and x0 <= 2970) or x0 === 2972 or (x0 >= 2974 and x0 <= 2975) or (x0 >= 2979 and x0 <= 2980) or (x0 >= 2984 and x0 <= 2986) or (x0 >= 2990 and x0 <= 3001) or (x0 >= 3006 and x0 <= 3010) or (x0 >= 3014 and x0 <= 3016) or (x0 >= 3018 and x0 <= 3021) or x0 === 3024 or x0 === 3031 or (x0 >= 3046 and x0 <= 3055) or (x0 >= 3072 and x0 <= 3084) or (x0 >= 3086 and x0 <= 3088) or (x0 >= 3090 and x0 <= 3112) or (x0 >= 3114 and x0 <= 3129) or (x0 >= 3133 and x0 <= 3140) or (x0 >= 3142 and x0 <= 3144) or (x0 >= 3146 and x0 <= 3149) or (x0 >= 3157 and x0 <= 3158) or (x0 >= 3160 and x0 <= 3162) or (x0 >= 3168 and x0 <= 3171) or (x0 >= 3174 and x0 <= 3183) or (x0 >= 3200 and x0 <= 3203) or (x0 >= 3205 and x0 <= 3212) or (x0 >= 3214 and x0 <= 3216) or (x0 >= 3218 and x0 <= 3240) or (x0 >= 3242 and x0 <= 3251) or (x0 >= 3253 and x0 <= 3257) or (x0 >= 3260 and x0 <= 3268) or (x0 >= 3270 and x0 <= 3272) or (x0 >= 3274 and x0 <= 3277) or (x0 >= 3285 and x0 <= 3286) or x0 === 3294 or (x0 >= 3296 and x0 <= 3299) or (x0 >= 3302 and x0 <= 3311) or (x0 >= 3313 and x0 <= 3314) or (x0 >= 3328 and x0 <= 3340) or (x0 >= 3342 and x0 <= 3344) or (x0 >= 3346 and x0 <= 3396) or (x0 >= 3398 and x0 <= 3400) or (x0 >= 3402 and x0 <= 3406) or (x0 >= 3412 and x0 <= 3415) or (x0 >= 3423 and x0 <= 3427) or (x0 >= 3430 and x0 <= 3439) or (x0 >= 3450 and x0 <= 3455) or (x0 >= 3457 and x0 <= 3459) or (x0 >= 3461 and x0 <= 3478) or (x0 >= 3482 and x0 <= 3505) or (x0 >= 3507 and x0 <= 3515) or x0 === 3517 or (x0 >= 3520 and x0 <= 3526) or x0 === 3530 or (x0 >= 3535 and x0 <= 3540) or x0 === 3542 or (x0 >= 3544 and x0 <= 3551) or (x0 >= 3558 and x0 <= 3567) or (x0 >= 3570 and x0 <= 3571) or (x0 >= 3585 and x0 <= 3642) or (x0 >= 3648 and x0 <= 3662) or (x0 >= 3664 and x0 <= 3673) or (x0 >= 3713 and x0 <= 3714) or x0 === 3716 or (x0 >= 3718 and x0 <= 3722) or (x0 >= 3724 and x0 <= 3747) or x0 === 3749 or (x0 >= 3751 and x0 <= 3773) or (x0 >= 3776 and x0 <= 3780) or x0 === 3782 or (x0 >= 3784 and x0 <= 3789) or (x0 >= 3792 and x0 <= 3801) or (x0 >= 3804 and x0 <= 3807) or x0 === 3840 or (x0 >= 3864 and x0 <= 3865) or (x0 >= 3872 and x0 <= 3881) or x0 === 3893 or x0 === 3895 or x0 === 3897 or (x0 >= 3902 and x0 <= 3911) or (x0 >= 3913 and x0 <= 3948) or (x0 >= 3953 and x0 <= 3972) or (x0 >= 3974 and x0 <= 3991) or (x0 >= 3993 and x0 <= 4028) or x0 === 4038 or (x0 >= 4096 and x0 <= 4169) or (x0 >= 4176 and x0 <= 4253) or (x0 >= 4256 and x0 <= 4293) or x0 === 4295 or x0 === 4301 or (x0 >= 4304 and x0 <= 4346) or (x0 >= 4348 and x0 <= 4680) or (x0 >= 4682 and x0 <= 4685) or (x0 >= 4688 and x0 <= 4694) or x0 === 4696 or (x0 >= 4698 and x0 <= 4701) or (x0 >= 4704 and x0 <= 4744) or (x0 >= 4746 and x0 <= 4749) or (x0 >= 4752 and x0 <= 4784) or (x0 >= 4786 and x0 <= 4789) or (x0 >= 4792 and x0 <= 4798) or x0 === 4800 or (x0 >= 4802 and x0 <= 4805) or (x0 >= 4808 and x0 <= 4822) or (x0 >= 4824 and x0 <= 4880) or (x0 >= 4882 and x0 <= 4885) or (x0 >= 4888 and x0 <= 4954) or (x0 >= 4957 and x0 <= 4959) or (x0 >= 4969 and x0 <= 4977) or (x0 >= 4992 and x0 <= 5007) or (x0 >= 5024 and x0 <= 5109) or (x0 >= 5112 and x0 <= 5117) or (x0 >= 5121 and x0 <= 5740) or (x0 >= 5743 and x0 <= 5759) or (x0 >= 5761 and x0 <= 5786) or (x0 >= 5792 and x0 <= 5866) or (x0 >= 5870 and x0 <= 5880) or (x0 >= 5888 and x0 <= 5900) or (x0 >= 5902 and x0 <= 5908) or (x0 >= 5920 and x0 <= 5940) or (x0 >= 5952 and x0 <= 5971) or (x0 >= 5984 and x0 <= 5996) or (x0 >= 5998 and x0 <= 6000) or (x0 >= 6002 and x0 <= 6003) or (x0 >= 6016 and x0 <= 6099) or x0 === 6103 or (x0 >= 6108 and x0 <= 6109) or (x0 >= 6112 and x0 <= 6121) or (x0 >= 6155 and x0 <= 6157) or (x0 >= 6160 and x0 <= 6169) or (x0 >= 6176 and x0 <= 6264) or (x0 >= 6272 and x0 <= 6314) or (x0 >= 6320 and x0 <= 6389) or (x0 >= 6400 and x0 <= 6430) or (x0 >= 6432 and x0 <= 6443) or (x0 >= 6448 and x0 <= 6459) or (x0 >= 6470 and x0 <= 6509) or (x0 >= 6512 and x0 <= 6516) or (x0 >= 6528 and x0 <= 6571) or (x0 >= 6576 and x0 <= 6601) or (x0 >= 6608 and x0 <= 6618) or (x0 >= 6656 and x0 <= 6683) or (x0 >= 6688 and x0 <= 6750) or (x0 >= 6752 and x0 <= 6780) or (x0 >= 6783 and x0 <= 6793) or (x0 >= 6800 and x0 <= 6809) or x0 === 6823 or (x0 >= 6832 and x0 <= 6845) or (x0 >= 6847 and x0 <= 6848) or (x0 >= 6912 and x0 <= 6987) or (x0 >= 6992 and x0 <= 7001) or (x0 >= 7019 and x0 <= 7027) or (x0 >= 7040 and x0 <= 7155) or (x0 >= 7168 and x0 <= 7223) or (x0 >= 7232 and x0 <= 7241) or (x0 >= 7245 and x0 <= 7293) or (x0 >= 7296 and x0 <= 7304) or (x0 >= 7312 and x0 <= 7354) or (x0 >= 7357 and x0 <= 7359) or (x0 >= 7376 and x0 <= 7378) or (x0 >= 7380 and x0 <= 7418) or (x0 >= 7424 and x0 <= 7673) or (x0 >= 7675 and x0 <= 7957) or (x0 >= 7960 and x0 <= 7965) or (x0 >= 7968 and x0 <= 8005) or (x0 >= 8008 and x0 <= 8013) or (x0 >= 8016 and x0 <= 8023) or x0 === 8025 or x0 === 8027 or x0 === 8029 or (x0 >= 8031 and x0 <= 8061) or (x0 >= 8064 and x0 <= 8116) or (x0 >= 8118 and x0 <= 8124) or x0 === 8126 or (x0 >= 8130 and x0 <= 8132) or (x0 >= 8134 and x0 <= 8140) or (x0 >= 8144 and x0 <= 8147) or (x0 >= 8150 and x0 <= 8155) or (x0 >= 8160 and x0 <= 8172) or (x0 >= 8178 and x0 <= 8180) or (x0 >= 8182 and x0 <= 8188) or (x0 >= 8255 and x0 <= 8256) or x0 === 8276 or x0 === 8305 or x0 === 8319 or (x0 >= 8336 and x0 <= 8348) or (x0 >= 8400 and x0 <= 8412) or x0 === 8417 or (x0 >= 8421 and x0 <= 8432) or x0 === 8450 or x0 === 8455 or (x0 >= 8458 and x0 <= 8467) or x0 === 8469 or (x0 >= 8472 and x0 <= 8477) or x0 === 8484 or x0 === 8486 or x0 === 8488 or (x0 >= 8490 and x0 <= 8505) or (x0 >= 8508 and x0 <= 8511) or (x0 >= 8517 and x0 <= 8521) or x0 === 8526 or (x0 >= 8544 and x0 <= 8584) or (x0 >= 11264 and x0 <= 11310) or (x0 >= 11312 and x0 <= 11358) or (x0 >= 11360 and x0 <= 11492) or (x0 >= 11499 and x0 <= 11507) or (x0 >= 11520 and x0 <= 11557) or x0 === 11559 or x0 === 11565 or (x0 >= 11568 and x0 <= 11623) or x0 === 11631 or (x0 >= 11647 and x0 <= 11670) or (x0 >= 11680 and x0 <= 11686) or (x0 >= 11688 and x0 <= 11694) or (x0 >= 11696 and x0 <= 11702) or (x0 >= 11704 and x0 <= 11710) or (x0 >= 11712 and x0 <= 11718) or (x0 >= 11720 and x0 <= 11726) or (x0 >= 11728 and x0 <= 11734) or (x0 >= 11736 and x0 <= 11742) or (x0 >= 11744 and x0 <= 11775) or (x0 >= 12293 and x0 <= 12295) or (x0 >= 12321 and x0 <= 12335) or (x0 >= 12337 and x0 <= 12341) or (x0 >= 12344 and x0 <= 12348) or (x0 >= 12353 and x0 <= 12438) or (x0 >= 12441 and x0 <= 12447) or (x0 >= 12449 and x0 <= 12538) or (x0 >= 12540 and x0 <= 12543) or (x0 >= 12549 and x0 <= 12591) or (x0 >= 12593 and x0 <= 12686) or (x0 >= 12704 and x0 <= 12735) or (x0 >= 12784 and x0 <= 12799) or (x0 >= 13312 and x0 <= 19903) or (x0 >= 19968 and x0 <= 40956) or (x0 >= 40960 and x0 <= 42124) or (x0 >= 42192 and x0 <= 42237) or (x0 >= 42240 and x0 <= 42508) or (x0 >= 42512 and x0 <= 42539) or (x0 >= 42560 and x0 <= 42607) or (x0 >= 42612 and x0 <= 42621) or (x0 >= 42623 and x0 <= 42737) or (x0 >= 42775 and x0 <= 42783) or (x0 >= 42786 and x0 <= 42888) or (x0 >= 42891 and x0 <= 42943) or (x0 >= 42946 and x0 <= 42954) or (x0 >= 42997 and x0 <= 43047) or x0 === 43052 or (x0 >= 43072 and x0 <= 43123) or (x0 >= 43136 and x0 <= 43205) or (x0 >= 43216 and x0 <= 43225) or (x0 >= 43232 and x0 <= 43255) or x0 === 43259 or (x0 >= 43261 and x0 <= 43309) or (x0 >= 43312 and x0 <= 43347) or (x0 >= 43360 and x0 <= 43388) or (x0 >= 43392 and x0 <= 43456) or (x0 >= 43471 and x0 <= 43481) or (x0 >= 43488 and x0 <= 43518) or (x0 >= 43520 and x0 <= 43574) or (x0 >= 43584 and x0 <= 43597) or (x0 >= 43600 and x0 <= 43609) or (x0 >= 43616 and x0 <= 43638) or (x0 >= 43642 and x0 <= 43714) or (x0 >= 43739 and x0 <= 43741) or (x0 >= 43744 and x0 <= 43759) or (x0 >= 43762 and x0 <= 43766) or (x0 >= 43777 and x0 <= 43782) or (x0 >= 43785 and x0 <= 43790) or (x0 >= 43793 and x0 <= 43798) or (x0 >= 43808 and x0 <= 43814) or (x0 >= 43816 and x0 <= 43822) or (x0 >= 43824 and x0 <= 43866) or (x0 >= 43868 and x0 <= 43881) or (x0 >= 43888 and x0 <= 44010) or (x0 >= 44012 and x0 <= 44013) or (x0 >= 44016 and x0 <= 44025) or (x0 >= 44032 and x0 <= 55203) or (x0 >= 55216 and x0 <= 55238) or (x0 >= 55243 and x0 <= 55291) or (x0 >= 63744 and x0 <= 64109) or (x0 >= 64112 and x0 <= 64217) or (x0 >= 64256 and x0 <= 64262) or (x0 >= 64275 and x0 <= 64279) or (x0 >= 64285 and x0 <= 64296) or (x0 >= 64298 and x0 <= 64310) or (x0 >= 64312 and x0 <= 64316) or x0 === 64318 or (x0 >= 64320 and x0 <= 64321) or (x0 >= 64323 and x0 <= 64324) or (x0 >= 64326 and x0 <= 64433) or (x0 >= 64467 and x0 <= 64829) or (x0 >= 64848 and x0 <= 64911) or (x0 >= 64914 and x0 <= 64967) or (x0 >= 65008 and x0 <= 65019) or (x0 >= 65024 and x0 <= 65039) or (x0 >= 65056 and x0 <= 65071) or (x0 >= 65075 and x0 <= 65076) or (x0 >= 65101 and x0 <= 65103) or (x0 >= 65136 and x0 <= 65140) or (x0 >= 65142 and x0 <= 65276) or (x0 >= 65296 and x0 <= 65305) or (x0 >= 65313 and x0 <= 65338) or x0 === 65343 or (x0 >= 65345 and x0 <= 65370) or (x0 >= 65382 and x0 <= 65470) or (x0 >= 65474 and x0 <= 65479) or (x0 >= 65482 and x0 <= 65487) or (x0 >= 65490 and x0 <= 65495) or (x0 >= 65498 and x0 <= 65500) or (x0 >= 65536 and x0 <= 65547) or (x0 >= 65549 and x0 <= 65574) or (x0 >= 65576 and x0 <= 65594) or (x0 >= 65596 and x0 <= 65597) or (x0 >= 65599 and x0 <= 65613) or (x0 >= 65616 and x0 <= 65629) or (x0 >= 65664 and x0 <= 65786) or (x0 >= 65856 and x0 <= 65908) or x0 === 66045 or (x0 >= 66176 and x0 <= 66204) or (x0 >= 66208 and x0 <= 66256) or x0 === 66272 or (x0 >= 66304 and x0 <= 66335) or (x0 >= 66349 and x0 <= 66378) or (x0 >= 66384 and x0 <= 66426) or (x0 >= 66432 and x0 <= 66461) or (x0 >= 66464 and x0 <= 66499) or (x0 >= 66504 and x0 <= 66511) or (x0 >= 66513 and x0 <= 66517) or (x0 >= 66560 and x0 <= 66717) or (x0 >= 66720 and x0 <= 66729) or (x0 >= 66736 and x0 <= 66771) or (x0 >= 66776 and x0 <= 66811) or (x0 >= 66816 and x0 <= 66855) or (x0 >= 66864 and x0 <= 66915) or (x0 >= 67072 and x0 <= 67382) or (x0 >= 67392 and x0 <= 67413) or (x0 >= 67424 and x0 <= 67431) or (x0 >= 67584 and x0 <= 67589) or x0 === 67592 or (x0 >= 67594 and x0 <= 67637) or (x0 >= 67639 and x0 <= 67640) or x0 === 67644 or (x0 >= 67647 and x0 <= 67669) or (x0 >= 67680 and x0 <= 67702) or (x0 >= 67712 and x0 <= 67742) or (x0 >= 67808 and x0 <= 67826) or (x0 >= 67828 and x0 <= 67829) or (x0 >= 67840 and x0 <= 67861) or (x0 >= 67872 and x0 <= 67897) or (x0 >= 67968 and x0 <= 68023) or (x0 >= 68030 and x0 <= 68031) or (x0 >= 68096 and x0 <= 68099) or (x0 >= 68101 and x0 <= 68102) or (x0 >= 68108 and x0 <= 68115) or (x0 >= 68117 and x0 <= 68119) or (x0 >= 68121 and x0 <= 68149) or (x0 >= 68152 and x0 <= 68154) or x0 === 68159 or (x0 >= 68192 and x0 <= 68220) or (x0 >= 68224 and x0 <= 68252) or (x0 >= 68288 and x0 <= 68295) or (x0 >= 68297 and x0 <= 68326) or (x0 >= 68352 and x0 <= 68405) or (x0 >= 68416 and x0 <= 68437) or (x0 >= 68448 and x0 <= 68466) or (x0 >= 68480 and x0 <= 68497) or (x0 >= 68608 and x0 <= 68680) or (x0 >= 68736 and x0 <= 68786) or (x0 >= 68800 and x0 <= 68850) or (x0 >= 68864 and x0 <= 68903) or (x0 >= 68912 and x0 <= 68921) or (x0 >= 69248 and x0 <= 69289) or (x0 >= 69291 and x0 <= 69292) or (x0 >= 69296 and x0 <= 69297) or (x0 >= 69376 and x0 <= 69404) or x0 === 69415 or (x0 >= 69424 and x0 <= 69456) or (x0 >= 69552 and x0 <= 69572) or (x0 >= 69600 and x0 <= 69622) or (x0 >= 69632 and x0 <= 69702) or (x0 >= 69734 and x0 <= 69743) or (x0 >= 69759 and x0 <= 69818) or (x0 >= 69840 and x0 <= 69864) or (x0 >= 69872 and x0 <= 69881) or (x0 >= 69888 and x0 <= 69940) or (x0 >= 69942 and x0 <= 69951) or (x0 >= 69956 and x0 <= 69959) or (x0 >= 69968 and x0 <= 70003) or x0 === 70006 or (x0 >= 70016 and x0 <= 70084) or (x0 >= 70089 and x0 <= 70092) or (x0 >= 70094 and x0 <= 70106) or x0 === 70108 or (x0 >= 70144 and x0 <= 70161) or (x0 >= 70163 and x0 <= 70199) or x0 === 70206 or (x0 >= 70272 and x0 <= 70278) or x0 === 70280 or (x0 >= 70282 and x0 <= 70285) or (x0 >= 70287 and x0 <= 70301) or (x0 >= 70303 and x0 <= 70312) or (x0 >= 70320 and x0 <= 70378) or (x0 >= 70384 and x0 <= 70393) or (x0 >= 70400 and x0 <= 70403) or (x0 >= 70405 and x0 <= 70412) or (x0 >= 70415 and x0 <= 70416) or (x0 >= 70419 and x0 <= 70440) or (x0 >= 70442 and x0 <= 70448) or (x0 >= 70450 and x0 <= 70451) or (x0 >= 70453 and x0 <= 70457) or (x0 >= 70459 and x0 <= 70468) or (x0 >= 70471 and x0 <= 70472) or (x0 >= 70475 and x0 <= 70477) or x0 === 70480 or x0 === 70487 or (x0 >= 70493 and x0 <= 70499) or (x0 >= 70502 and x0 <= 70508) or (x0 >= 70512 and x0 <= 70516) or (x0 >= 70656 and x0 <= 70730) or (x0 >= 70736 and x0 <= 70745) or (x0 >= 70750 and x0 <= 70753) or (x0 >= 70784 and x0 <= 70853) or x0 === 70855 or (x0 >= 70864 and x0 <= 70873) or (x0 >= 71040 and x0 <= 71093) or (x0 >= 71096 and x0 <= 71104) or (x0 >= 71128 and x0 <= 71133) or (x0 >= 71168 and x0 <= 71232) or x0 === 71236 or (x0 >= 71248 and x0 <= 71257) or (x0 >= 71296 and x0 <= 71352) or (x0 >= 71360 and x0 <= 71369) or (x0 >= 71424 and x0 <= 71450) or (x0 >= 71453 and x0 <= 71467) or (x0 >= 71472 and x0 <= 71481) or (x0 >= 71680 and x0 <= 71738) or (x0 >= 71840 and x0 <= 71913) or (x0 >= 71935 and x0 <= 71942) or x0 === 71945 or (x0 >= 71948 and x0 <= 71955) or (x0 >= 71957 and x0 <= 71958) or (x0 >= 71960 and x0 <= 71989) or (x0 >= 71991 and x0 <= 71992) or (x0 >= 71995 and x0 <= 72003) or (x0 >= 72016 and x0 <= 72025) or (x0 >= 72096 and x0 <= 72103) or (x0 >= 72106 and x0 <= 72151) or (x0 >= 72154 and x0 <= 72161) or (x0 >= 72163 and x0 <= 72164) or (x0 >= 72192 and x0 <= 72254) or x0 === 72263 or (x0 >= 72272 and x0 <= 72345) or x0 === 72349 or (x0 >= 72384 and x0 <= 72440) or (x0 >= 72704 and x0 <= 72712) or (x0 >= 72714 and x0 <= 72758) or (x0 >= 72760 and x0 <= 72768) or (x0 >= 72784 and x0 <= 72793) or (x0 >= 72818 and x0 <= 72847) or (x0 >= 72850 and x0 <= 72871) or (x0 >= 72873 and x0 <= 72886) or (x0 >= 72960 and x0 <= 72966) or (x0 >= 72968 and x0 <= 72969) or (x0 >= 72971 and x0 <= 73014) or x0 === 73018 or (x0 >= 73020 and x0 <= 73021) or (x0 >= 73023 and x0 <= 73031) or (x0 >= 73040 and x0 <= 73049) or (x0 >= 73056 and x0 <= 73061) or (x0 >= 73063 and x0 <= 73064) or (x0 >= 73066 and x0 <= 73102) or (x0 >= 73104 and x0 <= 73105) or (x0 >= 73107 and x0 <= 73112) or (x0 >= 73120 and x0 <= 73129) or (x0 >= 73440 and x0 <= 73462) or x0 === 73648 or (x0 >= 73728 and x0 <= 74649) or (x0 >= 74752 and x0 <= 74862) or (x0 >= 74880 and x0 <= 75075) or (x0 >= 77824 and x0 <= 78894) or (x0 >= 82944 and x0 <= 83526) or (x0 >= 92160 and x0 <= 92728) or (x0 >= 92736 and x0 <= 92766) or (x0 >= 92768 and x0 <= 92777) or (x0 >= 92880 and x0 <= 92909) or (x0 >= 92912 and x0 <= 92916) or (x0 >= 92928 and x0 <= 92982) or (x0 >= 92992 and x0 <= 92995) or (x0 >= 93008 and x0 <= 93017) or (x0 >= 93027 and x0 <= 93047) or (x0 >= 93053 and x0 <= 93071) or (x0 >= 93760 and x0 <= 93823) or (x0 >= 93952 and x0 <= 94026) or (x0 >= 94031 and x0 <= 94087) or (x0 >= 94095 and x0 <= 94111) or (x0 >= 94176 and x0 <= 94177) or (x0 >= 94179 and x0 <= 94180) or (x0 >= 94192 and x0 <= 94193) or (x0 >= 94208 and x0 <= 100_343) or (x0 >= 100_352 and x0 <= 101_589) or (x0 >= 101_632 and x0 <= 101_640) or (x0 >= 110_592 and x0 <= 110_878) or (x0 >= 110_928 and x0 <= 110_930) or (x0 >= 110_948 and x0 <= 110_951) or (x0 >= 110_960 and x0 <= 111_355) or (x0 >= 113_664 and x0 <= 113_770) or (x0 >= 113_776 and x0 <= 113_788) or (x0 >= 113_792 and x0 <= 113_800) or (x0 >= 113_808 and x0 <= 113_817) or (x0 >= 113_821 and x0 <= 113_822) or (x0 >= 119_141 and x0 <= 119_145) or (x0 >= 119_149 and x0 <= 119_154) or (x0 >= 119_163 and x0 <= 119_170) or (x0 >= 119_173 and x0 <= 119_179) or (x0 >= 119_210 and x0 <= 119_213) or (x0 >= 119_362 and x0 <= 119_364) or (x0 >= 119_808 and x0 <= 119_892) or (x0 >= 119_894 and x0 <= 119_964) or (x0 >= 119_966 and x0 <= 119_967) or x0 === 119_970 or (x0 >= 119_973 and x0 <= 119_974) or (x0 >= 119_977 and x0 <= 119_980) or (x0 >= 119_982 and x0 <= 119_993) or x0 === 119_995 or (x0 >= 119_997 and x0 <= 120_003) or (x0 >= 120_005 and x0 <= 120_069) or (x0 >= 120_071 and x0 <= 120_074) or (x0 >= 120_077 and x0 <= 120_084) or (x0 >= 120_086 and x0 <= 120_092) or (x0 >= 120_094 and x0 <= 120_121) or (x0 >= 120_123 and x0 <= 120_126) or (x0 >= 120_128 and x0 <= 120_132) or x0 === 120_134 or (x0 >= 120_138 and x0 <= 120_144) or (x0 >= 120_146 and x0 <= 120_485) or (x0 >= 120_488 and x0 <= 120_512) or (x0 >= 120_514 and x0 <= 120_538) or (x0 >= 120_540 and x0 <= 120_570) or (x0 >= 120_572 and x0 <= 120_596) or (x0 >= 120_598 and x0 <= 120_628) or (x0 >= 120_630 and x0 <= 120_654) or (x0 >= 120_656 and x0 <= 120_686) or (x0 >= 120_688 and x0 <= 120_712) or (x0 >= 120_714 and x0 <= 120_744) or (x0 >= 120_746 and x0 <= 120_770) or (x0 >= 120_772 and x0 <= 120_779) or (x0 >= 120_782 and x0 <= 120_831) or (x0 >= 121_344 and x0 <= 121_398) or (x0 >= 121_403 and x0 <= 121_452) or x0 === 121_461 or x0 === 121_476 or (x0 >= 121_499 and x0 <= 121_503) or (x0 >= 121_505 and x0 <= 121_519) or (x0 >= 122_880 and x0 <= 122_886) or (x0 >= 122_888 and x0 <= 122_904) or (x0 >= 122_907 and x0 <= 122_913) or (x0 >= 122_915 and x0 <= 122_916) or (x0 >= 122_918 and x0 <= 122_922) or (x0 >= 123_136 and x0 <= 123_180) or (x0 >= 123_184 and x0 <= 123_197) or (x0 >= 123_200 and x0 <= 123_209) or x0 === 123_214 or (x0 >= 123_584 and x0 <= 123_641) or (x0 >= 124_928 and x0 <= 125_124) or (x0 >= 125_136 and x0 <= 125_142) or (x0 >= 125_184 and x0 <= 125_259) or (x0 >= 125_264 and x0 <= 125_273) or (x0 >= 126_464 and x0 <= 126_467) or (x0 >= 126_469 and x0 <= 126_495) or (x0 >= 126_497 and x0 <= 126_498) or x0 === 126_500 or x0 === 126_503 or (x0 >= 126_505 and x0 <= 126_514) or (x0 >= 126_516 and x0 <= 126_519) or x0 === 126_521 or x0 === 126_523 or x0 === 126_530 or x0 === 126_535 or x0 === 126_537 or x0 === 126_539 or (x0 >= 126_541 and x0 <= 126_543) or (x0 >= 126_545 and x0 <= 126_546) or x0 === 126_548 or x0 === 126_551 or x0 === 126_553 or x0 === 126_555 or x0 === 126_557 or x0 === 126_559 or (x0 >= 126_561 and x0 <= 126_562) or x0 === 126_564 or (x0 >= 126_567 and x0 <= 126_570) or (x0 >= 126_572 and x0 <= 126_578) or (x0 >= 126_580 and x0 <= 126_583) or (x0 >= 126_585 and x0 <= 126_588) or x0 === 126_590 or (x0 >= 126_592 and x0 <= 126_601) or (x0 >= 126_603 and x0 <= 126_619) or (x0 >= 126_625 and x0 <= 126_627) or (x0 >= 126_629 and x0 <= 126_633) or (x0 >= 126_635 and x0 <= 126_651) or (x0 >= 130_032 and x0 <= 130_041) or (x0 >= 131_072 and x0 <= 173_789) or (x0 >= 173_824 and x0 <= 177_972) or (x0 >= 177_984 and x0 <= 178_205) or (x0 >= 178_208 and x0 <= 183_969) or (x0 >= 183_984 and x0 <= 191_456) or (x0 >= 194_560 and x0 <= 195_101) or (x0 >= 196_608 and x0 <= 201_546) or (x0 >= 917_760 and x0 <= 917_999) do atom_continue_chars__1( rest, [x0] ++ acc, stack, context, comb__line, comb__offset + byte_size(<>) ) end def atom_continue_chars__0(rest, _acc, _stack, context, line, offset) do {:error, "expected atom continue", rest, context, line, offset} end def atom_continue_chars__1(rest, acc, _stack, context, line, offset) do {:ok, acc, rest, context, line, offset} end def atom_start_chars__0( <>, acc, stack, context, comb__line, comb__offset ) when (x0 >= 65 and x0 <= 90) or x0 === 95 or (x0 >= 97 and x0 <= 122) or x0 === 170 or x0 === 181 or x0 === 186 or (x0 >= 192 and x0 <= 214) or (x0 >= 216 and x0 <= 246) or (x0 >= 248 and x0 <= 705) or (x0 >= 710 and x0 <= 721) or (x0 >= 736 and x0 <= 740) or x0 === 748 or x0 === 750 or (x0 >= 880 and x0 <= 884) or (x0 >= 886 and x0 <= 887) or (x0 >= 890 and x0 <= 893) or x0 === 895 or x0 === 902 or (x0 >= 904 and x0 <= 906) or x0 === 908 or (x0 >= 910 and x0 <= 929) or (x0 >= 931 and x0 <= 1013) or (x0 >= 1015 and x0 <= 1153) or (x0 >= 1162 and x0 <= 1327) or (x0 >= 1329 and x0 <= 1366) or x0 === 1369 or (x0 >= 1376 and x0 <= 1416) or (x0 >= 1488 and x0 <= 1514) or (x0 >= 1519 and x0 <= 1522) or (x0 >= 1568 and x0 <= 1610) or (x0 >= 1646 and x0 <= 1647) or (x0 >= 1649 and x0 <= 1747) or x0 === 1749 or (x0 >= 1765 and x0 <= 1766) or (x0 >= 1774 and x0 <= 1775) or (x0 >= 1786 and x0 <= 1788) or x0 === 1791 or x0 === 1808 or (x0 >= 1810 and x0 <= 1839) or (x0 >= 1869 and x0 <= 1957) or x0 === 1969 or (x0 >= 1994 and x0 <= 2026) or (x0 >= 2036 and x0 <= 2037) or x0 === 2042 or (x0 >= 2048 and x0 <= 2069) or x0 === 2074 or x0 === 2084 or x0 === 2088 or (x0 >= 2112 and x0 <= 2136) or (x0 >= 2144 and x0 <= 2154) or (x0 >= 2208 and x0 <= 2228) or (x0 >= 2230 and x0 <= 2247) or (x0 >= 2308 and x0 <= 2361) or x0 === 2365 or x0 === 2384 or (x0 >= 2392 and x0 <= 2401) or (x0 >= 2417 and x0 <= 2432) or (x0 >= 2437 and x0 <= 2444) or (x0 >= 2447 and x0 <= 2448) or (x0 >= 2451 and x0 <= 2472) or (x0 >= 2474 and x0 <= 2480) or x0 === 2482 or (x0 >= 2486 and x0 <= 2489) or x0 === 2493 or x0 === 2510 or (x0 >= 2524 and x0 <= 2525) or (x0 >= 2527 and x0 <= 2529) or (x0 >= 2544 and x0 <= 2545) or x0 === 2556 or (x0 >= 2565 and x0 <= 2570) or (x0 >= 2575 and x0 <= 2576) or (x0 >= 2579 and x0 <= 2600) or (x0 >= 2602 and x0 <= 2608) or (x0 >= 2610 and x0 <= 2611) or (x0 >= 2613 and x0 <= 2614) or (x0 >= 2616 and x0 <= 2617) or (x0 >= 2649 and x0 <= 2652) or x0 === 2654 or (x0 >= 2674 and x0 <= 2676) or (x0 >= 2693 and x0 <= 2701) or (x0 >= 2703 and x0 <= 2705) or (x0 >= 2707 and x0 <= 2728) or (x0 >= 2730 and x0 <= 2736) or (x0 >= 2738 and x0 <= 2739) or (x0 >= 2741 and x0 <= 2745) or x0 === 2749 or x0 === 2768 or (x0 >= 2784 and x0 <= 2785) or x0 === 2809 or (x0 >= 2821 and x0 <= 2828) or (x0 >= 2831 and x0 <= 2832) or (x0 >= 2835 and x0 <= 2856) or (x0 >= 2858 and x0 <= 2864) or (x0 >= 2866 and x0 <= 2867) or (x0 >= 2869 and x0 <= 2873) or x0 === 2877 or (x0 >= 2908 and x0 <= 2909) or (x0 >= 2911 and x0 <= 2913) or x0 === 2929 or x0 === 2947 or (x0 >= 2949 and x0 <= 2954) or (x0 >= 2958 and x0 <= 2960) or (x0 >= 2962 and x0 <= 2965) or (x0 >= 2969 and x0 <= 2970) or x0 === 2972 or (x0 >= 2974 and x0 <= 2975) or (x0 >= 2979 and x0 <= 2980) or (x0 >= 2984 and x0 <= 2986) or (x0 >= 2990 and x0 <= 3001) or x0 === 3024 or (x0 >= 3077 and x0 <= 3084) or (x0 >= 3086 and x0 <= 3088) or (x0 >= 3090 and x0 <= 3112) or (x0 >= 3114 and x0 <= 3129) or x0 === 3133 or (x0 >= 3160 and x0 <= 3162) or (x0 >= 3168 and x0 <= 3169) or x0 === 3200 or (x0 >= 3205 and x0 <= 3212) or (x0 >= 3214 and x0 <= 3216) or (x0 >= 3218 and x0 <= 3240) or (x0 >= 3242 and x0 <= 3251) or (x0 >= 3253 and x0 <= 3257) or x0 === 3261 or x0 === 3294 or (x0 >= 3296 and x0 <= 3297) or (x0 >= 3313 and x0 <= 3314) or (x0 >= 3332 and x0 <= 3340) or (x0 >= 3342 and x0 <= 3344) or (x0 >= 3346 and x0 <= 3386) or x0 === 3389 or x0 === 3406 or (x0 >= 3412 and x0 <= 3414) or (x0 >= 3423 and x0 <= 3425) or (x0 >= 3450 and x0 <= 3455) or (x0 >= 3461 and x0 <= 3478) or (x0 >= 3482 and x0 <= 3505) or (x0 >= 3507 and x0 <= 3515) or x0 === 3517 or (x0 >= 3520 and x0 <= 3526) or (x0 >= 3585 and x0 <= 3632) or (x0 >= 3634 and x0 <= 3635) or (x0 >= 3648 and x0 <= 3654) or (x0 >= 3713 and x0 <= 3714) or x0 === 3716 or (x0 >= 3718 and x0 <= 3722) or (x0 >= 3724 and x0 <= 3747) or x0 === 3749 or (x0 >= 3751 and x0 <= 3760) or (x0 >= 3762 and x0 <= 3763) or x0 === 3773 or (x0 >= 3776 and x0 <= 3780) or x0 === 3782 or (x0 >= 3804 and x0 <= 3807) or x0 === 3840 or (x0 >= 3904 and x0 <= 3911) or (x0 >= 3913 and x0 <= 3948) or (x0 >= 3976 and x0 <= 3980) or (x0 >= 4096 and x0 <= 4138) or x0 === 4159 or (x0 >= 4176 and x0 <= 4181) or (x0 >= 4186 and x0 <= 4189) or x0 === 4193 or (x0 >= 4197 and x0 <= 4198) or (x0 >= 4206 and x0 <= 4208) or (x0 >= 4213 and x0 <= 4225) or x0 === 4238 or (x0 >= 4256 and x0 <= 4293) or x0 === 4295 or x0 === 4301 or (x0 >= 4304 and x0 <= 4346) or (x0 >= 4348 and x0 <= 4680) or (x0 >= 4682 and x0 <= 4685) or (x0 >= 4688 and x0 <= 4694) or x0 === 4696 or (x0 >= 4698 and x0 <= 4701) or (x0 >= 4704 and x0 <= 4744) or (x0 >= 4746 and x0 <= 4749) or (x0 >= 4752 and x0 <= 4784) or (x0 >= 4786 and x0 <= 4789) or (x0 >= 4792 and x0 <= 4798) or x0 === 4800 or (x0 >= 4802 and x0 <= 4805) or (x0 >= 4808 and x0 <= 4822) or (x0 >= 4824 and x0 <= 4880) or (x0 >= 4882 and x0 <= 4885) or (x0 >= 4888 and x0 <= 4954) or (x0 >= 4992 and x0 <= 5007) or (x0 >= 5024 and x0 <= 5109) or (x0 >= 5112 and x0 <= 5117) or (x0 >= 5121 and x0 <= 5740) or (x0 >= 5743 and x0 <= 5759) or (x0 >= 5761 and x0 <= 5786) or (x0 >= 5792 and x0 <= 5866) or (x0 >= 5870 and x0 <= 5880) or (x0 >= 5888 and x0 <= 5900) or (x0 >= 5902 and x0 <= 5905) or (x0 >= 5920 and x0 <= 5937) or (x0 >= 5952 and x0 <= 5969) or (x0 >= 5984 and x0 <= 5996) or (x0 >= 5998 and x0 <= 6000) or (x0 >= 6016 and x0 <= 6067) or x0 === 6103 or x0 === 6108 or (x0 >= 6176 and x0 <= 6264) or (x0 >= 6272 and x0 <= 6312) or x0 === 6314 or (x0 >= 6320 and x0 <= 6389) or (x0 >= 6400 and x0 <= 6430) or (x0 >= 6480 and x0 <= 6509) or (x0 >= 6512 and x0 <= 6516) or (x0 >= 6528 and x0 <= 6571) or (x0 >= 6576 and x0 <= 6601) or (x0 >= 6656 and x0 <= 6678) or (x0 >= 6688 and x0 <= 6740) or x0 === 6823 or (x0 >= 6917 and x0 <= 6963) or (x0 >= 6981 and x0 <= 6987) or (x0 >= 7043 and x0 <= 7072) or (x0 >= 7086 and x0 <= 7087) or (x0 >= 7098 and x0 <= 7141) or (x0 >= 7168 and x0 <= 7203) or (x0 >= 7245 and x0 <= 7247) or (x0 >= 7258 and x0 <= 7293) or (x0 >= 7296 and x0 <= 7304) or (x0 >= 7312 and x0 <= 7354) or (x0 >= 7357 and x0 <= 7359) or (x0 >= 7401 and x0 <= 7404) or (x0 >= 7406 and x0 <= 7411) or (x0 >= 7413 and x0 <= 7414) or x0 === 7418 or (x0 >= 7424 and x0 <= 7615) or (x0 >= 7680 and x0 <= 7957) or (x0 >= 7960 and x0 <= 7965) or (x0 >= 7968 and x0 <= 8005) or (x0 >= 8008 and x0 <= 8013) or (x0 >= 8016 and x0 <= 8023) or x0 === 8025 or x0 === 8027 or x0 === 8029 or (x0 >= 8031 and x0 <= 8061) or (x0 >= 8064 and x0 <= 8116) or (x0 >= 8118 and x0 <= 8124) or x0 === 8126 or (x0 >= 8130 and x0 <= 8132) or (x0 >= 8134 and x0 <= 8140) or (x0 >= 8144 and x0 <= 8147) or (x0 >= 8150 and x0 <= 8155) or (x0 >= 8160 and x0 <= 8172) or (x0 >= 8178 and x0 <= 8180) or (x0 >= 8182 and x0 <= 8188) or x0 === 8305 or x0 === 8319 or (x0 >= 8336 and x0 <= 8348) or x0 === 8450 or x0 === 8455 or (x0 >= 8458 and x0 <= 8467) or x0 === 8469 or (x0 >= 8472 and x0 <= 8477) or x0 === 8484 or x0 === 8486 or x0 === 8488 or (x0 >= 8490 and x0 <= 8505) or (x0 >= 8508 and x0 <= 8511) or (x0 >= 8517 and x0 <= 8521) or x0 === 8526 or (x0 >= 8544 and x0 <= 8584) or (x0 >= 11264 and x0 <= 11310) or (x0 >= 11312 and x0 <= 11358) or (x0 >= 11360 and x0 <= 11492) or (x0 >= 11499 and x0 <= 11502) or (x0 >= 11506 and x0 <= 11507) or (x0 >= 11520 and x0 <= 11557) or x0 === 11559 or x0 === 11565 or (x0 >= 11568 and x0 <= 11623) or x0 === 11631 or (x0 >= 11648 and x0 <= 11670) or (x0 >= 11680 and x0 <= 11686) or (x0 >= 11688 and x0 <= 11694) or (x0 >= 11696 and x0 <= 11702) or (x0 >= 11704 and x0 <= 11710) or (x0 >= 11712 and x0 <= 11718) or (x0 >= 11720 and x0 <= 11726) or (x0 >= 11728 and x0 <= 11734) or (x0 >= 11736 and x0 <= 11742) or (x0 >= 12293 and x0 <= 12295) or (x0 >= 12321 and x0 <= 12329) or (x0 >= 12337 and x0 <= 12341) or (x0 >= 12344 and x0 <= 12348) or (x0 >= 12353 and x0 <= 12438) or (x0 >= 12443 and x0 <= 12447) or (x0 >= 12449 and x0 <= 12538) or (x0 >= 12540 and x0 <= 12543) or (x0 >= 12549 and x0 <= 12591) or (x0 >= 12593 and x0 <= 12686) or (x0 >= 12704 and x0 <= 12735) or (x0 >= 12784 and x0 <= 12799) or (x0 >= 13312 and x0 <= 19903) or (x0 >= 19968 and x0 <= 40956) or (x0 >= 40960 and x0 <= 42124) or (x0 >= 42192 and x0 <= 42237) or (x0 >= 42240 and x0 <= 42508) or (x0 >= 42512 and x0 <= 42527) or (x0 >= 42538 and x0 <= 42539) or (x0 >= 42560 and x0 <= 42606) or (x0 >= 42623 and x0 <= 42653) or (x0 >= 42656 and x0 <= 42735) or (x0 >= 42775 and x0 <= 42783) or (x0 >= 42786 and x0 <= 42888) or (x0 >= 42891 and x0 <= 42943) or (x0 >= 42946 and x0 <= 42954) or (x0 >= 42997 and x0 <= 43009) or (x0 >= 43011 and x0 <= 43013) or (x0 >= 43015 and x0 <= 43018) or (x0 >= 43020 and x0 <= 43042) or (x0 >= 43072 and x0 <= 43123) or (x0 >= 43138 and x0 <= 43187) or (x0 >= 43250 and x0 <= 43255) or x0 === 43259 or (x0 >= 43261 and x0 <= 43262) or (x0 >= 43274 and x0 <= 43301) or (x0 >= 43312 and x0 <= 43334) or (x0 >= 43360 and x0 <= 43388) or (x0 >= 43396 and x0 <= 43442) or x0 === 43471 or (x0 >= 43488 and x0 <= 43492) or (x0 >= 43494 and x0 <= 43503) or (x0 >= 43514 and x0 <= 43518) or (x0 >= 43520 and x0 <= 43560) or (x0 >= 43584 and x0 <= 43586) or (x0 >= 43588 and x0 <= 43595) or (x0 >= 43616 and x0 <= 43638) or x0 === 43642 or (x0 >= 43646 and x0 <= 43695) or x0 === 43697 or (x0 >= 43701 and x0 <= 43702) or (x0 >= 43705 and x0 <= 43709) or x0 === 43712 or x0 === 43714 or (x0 >= 43739 and x0 <= 43741) or (x0 >= 43744 and x0 <= 43754) or (x0 >= 43762 and x0 <= 43764) or (x0 >= 43777 and x0 <= 43782) or (x0 >= 43785 and x0 <= 43790) or (x0 >= 43793 and x0 <= 43798) or (x0 >= 43808 and x0 <= 43814) or (x0 >= 43816 and x0 <= 43822) or (x0 >= 43824 and x0 <= 43866) or (x0 >= 43868 and x0 <= 43881) or (x0 >= 43888 and x0 <= 44002) or (x0 >= 44032 and x0 <= 55203) or (x0 >= 55216 and x0 <= 55238) or (x0 >= 55243 and x0 <= 55291) or (x0 >= 63744 and x0 <= 64109) or (x0 >= 64112 and x0 <= 64217) or (x0 >= 64256 and x0 <= 64262) or (x0 >= 64275 and x0 <= 64279) or x0 === 64285 or (x0 >= 64287 and x0 <= 64296) or (x0 >= 64298 and x0 <= 64310) or (x0 >= 64312 and x0 <= 64316) or x0 === 64318 or (x0 >= 64320 and x0 <= 64321) or (x0 >= 64323 and x0 <= 64324) or (x0 >= 64326 and x0 <= 64433) or (x0 >= 64467 and x0 <= 64829) or (x0 >= 64848 and x0 <= 64911) or (x0 >= 64914 and x0 <= 64967) or (x0 >= 65008 and x0 <= 65019) or (x0 >= 65136 and x0 <= 65140) or (x0 >= 65142 and x0 <= 65276) or (x0 >= 65313 and x0 <= 65338) or (x0 >= 65345 and x0 <= 65370) or (x0 >= 65382 and x0 <= 65470) or (x0 >= 65474 and x0 <= 65479) or (x0 >= 65482 and x0 <= 65487) or (x0 >= 65490 and x0 <= 65495) or (x0 >= 65498 and x0 <= 65500) or (x0 >= 65536 and x0 <= 65547) or (x0 >= 65549 and x0 <= 65574) or (x0 >= 65576 and x0 <= 65594) or (x0 >= 65596 and x0 <= 65597) or (x0 >= 65599 and x0 <= 65613) or (x0 >= 65616 and x0 <= 65629) or (x0 >= 65664 and x0 <= 65786) or (x0 >= 65856 and x0 <= 65908) or (x0 >= 66176 and x0 <= 66204) or (x0 >= 66208 and x0 <= 66256) or (x0 >= 66304 and x0 <= 66335) or (x0 >= 66349 and x0 <= 66378) or (x0 >= 66384 and x0 <= 66421) or (x0 >= 66432 and x0 <= 66461) or (x0 >= 66464 and x0 <= 66499) or (x0 >= 66504 and x0 <= 66511) or (x0 >= 66513 and x0 <= 66517) or (x0 >= 66560 and x0 <= 66717) or (x0 >= 66736 and x0 <= 66771) or (x0 >= 66776 and x0 <= 66811) or (x0 >= 66816 and x0 <= 66855) or (x0 >= 66864 and x0 <= 66915) or (x0 >= 67072 and x0 <= 67382) or (x0 >= 67392 and x0 <= 67413) or (x0 >= 67424 and x0 <= 67431) or (x0 >= 67584 and x0 <= 67589) or x0 === 67592 or (x0 >= 67594 and x0 <= 67637) or (x0 >= 67639 and x0 <= 67640) or x0 === 67644 or (x0 >= 67647 and x0 <= 67669) or (x0 >= 67680 and x0 <= 67702) or (x0 >= 67712 and x0 <= 67742) or (x0 >= 67808 and x0 <= 67826) or (x0 >= 67828 and x0 <= 67829) or (x0 >= 67840 and x0 <= 67861) or (x0 >= 67872 and x0 <= 67897) or (x0 >= 67968 and x0 <= 68023) or (x0 >= 68030 and x0 <= 68031) or x0 === 68096 or (x0 >= 68112 and x0 <= 68115) or (x0 >= 68117 and x0 <= 68119) or (x0 >= 68121 and x0 <= 68149) or (x0 >= 68192 and x0 <= 68220) or (x0 >= 68224 and x0 <= 68252) or (x0 >= 68288 and x0 <= 68295) or (x0 >= 68297 and x0 <= 68324) or (x0 >= 68352 and x0 <= 68405) or (x0 >= 68416 and x0 <= 68437) or (x0 >= 68448 and x0 <= 68466) or (x0 >= 68480 and x0 <= 68497) or (x0 >= 68608 and x0 <= 68680) or (x0 >= 68736 and x0 <= 68786) or (x0 >= 68800 and x0 <= 68850) or (x0 >= 68864 and x0 <= 68899) or (x0 >= 69248 and x0 <= 69289) or (x0 >= 69296 and x0 <= 69297) or (x0 >= 69376 and x0 <= 69404) or x0 === 69415 or (x0 >= 69424 and x0 <= 69445) or (x0 >= 69552 and x0 <= 69572) or (x0 >= 69600 and x0 <= 69622) or (x0 >= 69635 and x0 <= 69687) or (x0 >= 69763 and x0 <= 69807) or (x0 >= 69840 and x0 <= 69864) or (x0 >= 69891 and x0 <= 69926) or x0 === 69956 or x0 === 69959 or (x0 >= 69968 and x0 <= 70002) or x0 === 70006 or (x0 >= 70019 and x0 <= 70066) or (x0 >= 70081 and x0 <= 70084) or x0 === 70106 or x0 === 70108 or (x0 >= 70144 and x0 <= 70161) or (x0 >= 70163 and x0 <= 70187) or (x0 >= 70272 and x0 <= 70278) or x0 === 70280 or (x0 >= 70282 and x0 <= 70285) or (x0 >= 70287 and x0 <= 70301) or (x0 >= 70303 and x0 <= 70312) or (x0 >= 70320 and x0 <= 70366) or (x0 >= 70405 and x0 <= 70412) or (x0 >= 70415 and x0 <= 70416) or (x0 >= 70419 and x0 <= 70440) or (x0 >= 70442 and x0 <= 70448) or (x0 >= 70450 and x0 <= 70451) or (x0 >= 70453 and x0 <= 70457) or x0 === 70461 or x0 === 70480 or (x0 >= 70493 and x0 <= 70497) or (x0 >= 70656 and x0 <= 70708) or (x0 >= 70727 and x0 <= 70730) or (x0 >= 70751 and x0 <= 70753) or (x0 >= 70784 and x0 <= 70831) or (x0 >= 70852 and x0 <= 70853) or x0 === 70855 or (x0 >= 71040 and x0 <= 71086) or (x0 >= 71128 and x0 <= 71131) or (x0 >= 71168 and x0 <= 71215) or x0 === 71236 or (x0 >= 71296 and x0 <= 71338) or x0 === 71352 or (x0 >= 71424 and x0 <= 71450) or (x0 >= 71680 and x0 <= 71723) or (x0 >= 71840 and x0 <= 71903) or (x0 >= 71935 and x0 <= 71942) or x0 === 71945 or (x0 >= 71948 and x0 <= 71955) or (x0 >= 71957 and x0 <= 71958) or (x0 >= 71960 and x0 <= 71983) or x0 === 71999 or x0 === 72001 or (x0 >= 72096 and x0 <= 72103) or (x0 >= 72106 and x0 <= 72144) or x0 === 72161 or x0 === 72163 or x0 === 72192 or (x0 >= 72203 and x0 <= 72242) or x0 === 72250 or x0 === 72272 or (x0 >= 72284 and x0 <= 72329) or x0 === 72349 or (x0 >= 72384 and x0 <= 72440) or (x0 >= 72704 and x0 <= 72712) or (x0 >= 72714 and x0 <= 72750) or x0 === 72768 or (x0 >= 72818 and x0 <= 72847) or (x0 >= 72960 and x0 <= 72966) or (x0 >= 72968 and x0 <= 72969) or (x0 >= 72971 and x0 <= 73008) or x0 === 73030 or (x0 >= 73056 and x0 <= 73061) or (x0 >= 73063 and x0 <= 73064) or (x0 >= 73066 and x0 <= 73097) or x0 === 73112 or (x0 >= 73440 and x0 <= 73458) or x0 === 73648 or (x0 >= 73728 and x0 <= 74649) or (x0 >= 74752 and x0 <= 74862) or (x0 >= 74880 and x0 <= 75075) or (x0 >= 77824 and x0 <= 78894) or (x0 >= 82944 and x0 <= 83526) or (x0 >= 92160 and x0 <= 92728) or (x0 >= 92736 and x0 <= 92766) or (x0 >= 92880 and x0 <= 92909) or (x0 >= 92928 and x0 <= 92975) or (x0 >= 92992 and x0 <= 92995) or (x0 >= 93027 and x0 <= 93047) or (x0 >= 93053 and x0 <= 93071) or (x0 >= 93760 and x0 <= 93823) or (x0 >= 93952 and x0 <= 94026) or x0 === 94032 or (x0 >= 94099 and x0 <= 94111) or (x0 >= 94176 and x0 <= 94177) or x0 === 94179 or (x0 >= 94208 and x0 <= 100_343) or (x0 >= 100_352 and x0 <= 101_589) or (x0 >= 101_632 and x0 <= 101_640) or (x0 >= 110_592 and x0 <= 110_878) or (x0 >= 110_928 and x0 <= 110_930) or (x0 >= 110_948 and x0 <= 110_951) or (x0 >= 110_960 and x0 <= 111_355) or (x0 >= 113_664 and x0 <= 113_770) or (x0 >= 113_776 and x0 <= 113_788) or (x0 >= 113_792 and x0 <= 113_800) or (x0 >= 113_808 and x0 <= 113_817) or (x0 >= 119_808 and x0 <= 119_892) or (x0 >= 119_894 and x0 <= 119_964) or (x0 >= 119_966 and x0 <= 119_967) or x0 === 119_970 or (x0 >= 119_973 and x0 <= 119_974) or (x0 >= 119_977 and x0 <= 119_980) or (x0 >= 119_982 and x0 <= 119_993) or x0 === 119_995 or (x0 >= 119_997 and x0 <= 120_003) or (x0 >= 120_005 and x0 <= 120_069) or (x0 >= 120_071 and x0 <= 120_074) or (x0 >= 120_077 and x0 <= 120_084) or (x0 >= 120_086 and x0 <= 120_092) or (x0 >= 120_094 and x0 <= 120_121) or (x0 >= 120_123 and x0 <= 120_126) or (x0 >= 120_128 and x0 <= 120_132) or x0 === 120_134 or (x0 >= 120_138 and x0 <= 120_144) or (x0 >= 120_146 and x0 <= 120_485) or (x0 >= 120_488 and x0 <= 120_512) or (x0 >= 120_514 and x0 <= 120_538) or (x0 >= 120_540 and x0 <= 120_570) or (x0 >= 120_572 and x0 <= 120_596) or (x0 >= 120_598 and x0 <= 120_628) or (x0 >= 120_630 and x0 <= 120_654) or (x0 >= 120_656 and x0 <= 120_686) or (x0 >= 120_688 and x0 <= 120_712) or (x0 >= 120_714 and x0 <= 120_744) or (x0 >= 120_746 and x0 <= 120_770) or (x0 >= 120_772 and x0 <= 120_779) or (x0 >= 123_136 and x0 <= 123_180) or (x0 >= 123_191 and x0 <= 123_197) or x0 === 123_214 or (x0 >= 123_584 and x0 <= 123_627) or (x0 >= 124_928 and x0 <= 125_124) or (x0 >= 125_184 and x0 <= 125_251) or x0 === 125_259 or (x0 >= 126_464 and x0 <= 126_467) or (x0 >= 126_469 and x0 <= 126_495) or (x0 >= 126_497 and x0 <= 126_498) or x0 === 126_500 or x0 === 126_503 or (x0 >= 126_505 and x0 <= 126_514) or (x0 >= 126_516 and x0 <= 126_519) or x0 === 126_521 or x0 === 126_523 or x0 === 126_530 or x0 === 126_535 or x0 === 126_537 or x0 === 126_539 or (x0 >= 126_541 and x0 <= 126_543) or (x0 >= 126_545 and x0 <= 126_546) or x0 === 126_548 or x0 === 126_551 or x0 === 126_553 or x0 === 126_555 or x0 === 126_557 or x0 === 126_559 or (x0 >= 126_561 and x0 <= 126_562) or x0 === 126_564 or (x0 >= 126_567 and x0 <= 126_570) or (x0 >= 126_572 and x0 <= 126_578) or (x0 >= 126_580 and x0 <= 126_583) or (x0 >= 126_585 and x0 <= 126_588) or x0 === 126_590 or (x0 >= 126_592 and x0 <= 126_601) or (x0 >= 126_603 and x0 <= 126_619) or (x0 >= 126_625 and x0 <= 126_627) or (x0 >= 126_629 and x0 <= 126_633) or (x0 >= 126_635 and x0 <= 126_651) or (x0 >= 131_072 and x0 <= 173_789) or (x0 >= 173_824 and x0 <= 177_972) or (x0 >= 177_984 and x0 <= 178_205) or (x0 >= 178_208 and x0 <= 183_969) or (x0 >= 183_984 and x0 <= 191_456) or (x0 >= 194_560 and x0 <= 195_101) or (x0 >= 196_608 and x0 <= 201_546) do atom_start_chars__1( rest, [x0] ++ acc, stack, context, comb__line, comb__offset + byte_size(<>) ) end def atom_start_chars__0(rest, _acc, _stack, context, line, offset) do {:error, "expected atom start", rest, context, line, offset} end def atom_start_chars__1(rest, acc, _stack, context, line, offset) do {:ok, acc, rest, context, line, offset} end end makeup_elixir-0.16.1/lib/makeup/lexers/elixir_lexer/atoms.ex.exs000066400000000000000000000020371441250767100247520ustar00rootroot00000000000000defmodule Makeup.Lexers.ElixirLexer.Atoms do @moduledoc false # parsec:Makeup.Lexers.ElixirLexer.Atoms # This module is generated at "dev time" so that the lexer # doesn't have to depend on the (excellent) `unicode_set` library, # which takes several minutes to compile. import NimbleParsec atom_start_unicode_syntax = "[[:L:][:Nl:][:Other_ID_Start:]-[:Pattern_Syntax:]-[:Pattern_White_Space:][_]]" atom_continue_unicode_syntax = "[[:ID_Start:][:Mn:][:Mc:][:Nd:][:Pc:][:Other_ID_Continue:]-[:Pattern_Syntax:]-[:Pattern_White_Space:][_@]]" # TODO: Why do we need to flatten these lists? A bug in `unicode_set`? atom_start_chars = Unicode.Set.to_utf8_char(atom_start_unicode_syntax) |> List.flatten() atom_continue_chars = Unicode.Set.to_utf8_char(atom_continue_unicode_syntax) |> List.flatten() defcombinator(:atom_start_chars, label(utf8_char(atom_start_chars), "atom start")) defcombinator(:atom_continue_chars, label(utf8_char(atom_continue_chars), "atom continue")) # parsec:Makeup.Lexers.ElixirLexer.Atoms end makeup_elixir-0.16.1/lib/makeup/lexers/elixir_lexer/helper.ex000066400000000000000000000043011441250767100243040ustar00rootroot00000000000000defmodule Makeup.Lexers.ElixirLexer.Helper do @moduledoc false import NimbleParsec alias Makeup.Lexer.Combinators def with_optional_separator(combinator, separator) when is_binary(separator) do combinator |> repeat(string(separator) |> concat(combinator)) end # Allows escaping of the first character of a right delimiter. # This is used in sigils that don't support interpolation or character escapes but # must support escaping of the right delimiter. def escape_delim(rdelim) do rdelim_first_char = String.slice(rdelim, 0..0) string("\\" <> rdelim_first_char) end def sigil(ldelim, rdelim, ranges, middle) do left = string("~") |> utf8_char(ranges) |> string(ldelim) right = string(rdelim) choices = middle ++ [utf8_char([])] left |> repeat(lookahead_not(right) |> choice(choices)) |> concat(right) |> optional(utf8_string([?a..?z, ?A..?Z, ?0..?9], min: 1)) |> post_traverse({__MODULE__, :build_sigil, []}) end def build_sigil(rest, acc, context, line, offset) do type = case Enum.at(acc, -2) do sigil when sigil in 'sScC' -> :string sigil when sigil in 'rR' -> :string_regex sigil when sigil in 'TDNU' -> :literal_date _ -> :string_sigil end Combinators.collect_raw_chars_and_binaries(rest, acc, context, line, offset, type, %{}) end def escaped(literal) when is_binary(literal) do string("\\" <> literal) end def keyword_matcher(kind, fun_name, words) do heads = for {ttype, words} <- words do for word <- words do case kind do :defp -> quote do defp unquote(fun_name)([{:name, attrs, unquote(ttype)} | tokens]) do [{unquote(ttype), attrs, unquote(word)} | unquote(fun_name)(tokens)] end end |> IO.inspect() :def -> quote do def unquote(fun_name)([{:name, attrs, unquote(ttype)} | tokens]) do [{unquote(ttype), attrs, unquote(word)} | unquote(fun_name)(tokens)] end end end end end quote do (unquote_splicing(heads)) end end end makeup_elixir-0.16.1/lib/makeup/lexers/elixir_lexer/testing.ex000066400000000000000000000012711441250767100245050ustar00rootroot00000000000000defmodule Makeup.Lexers.ElixirLexer.Testing do @moduledoc false # The tests need to be checked manually!!! (remove this line when they've been checked) alias Makeup.Lexers.ElixirLexer alias Makeup.Lexer.Postprocess # This function has two purposes: # 1. Ensure deterministic lexer output (no random prefix) # 2. Convert the token values into binaries so that the output # is more obvious on visual inspection # (iolists are hard to parse by a human) def lex(text) do text |> ElixirLexer.lex(group_prefix: "group") |> Postprocess.token_values_to_binaries() |> Enum.map(fn {ttype, meta, value} -> {ttype, Map.delete(meta, :language), value} end) end end makeup_elixir-0.16.1/lib/makeup/lexers/elixir_lexer/variables.ex000066400000000000000000001440561441250767100250110ustar00rootroot00000000000000# Generated from lib/makeup/lexers/elixir_lexer/variables.ex.exs, do not edit. # Generated at 2020-10-02 20:53:40Z. defmodule Makeup.Lexers.ElixirLexer.Variables do @moduledoc false def variable_continue_chars__0( <>, acc, stack, context, comb__line, comb__offset ) when (x0 >= 48 and x0 <= 57) or (x0 >= 65 and x0 <= 90) or x0 === 95 or (x0 >= 97 and x0 <= 122) or x0 === 170 or x0 === 181 or x0 === 183 or x0 === 186 or (x0 >= 192 and x0 <= 214) or (x0 >= 216 and x0 <= 246) or (x0 >= 248 and x0 <= 705) or (x0 >= 710 and x0 <= 721) or (x0 >= 736 and x0 <= 740) or x0 === 748 or x0 === 750 or (x0 >= 768 and x0 <= 884) or (x0 >= 886 and x0 <= 887) or (x0 >= 890 and x0 <= 893) or x0 === 895 or (x0 >= 902 and x0 <= 906) or x0 === 908 or (x0 >= 910 and x0 <= 929) or (x0 >= 931 and x0 <= 1013) or (x0 >= 1015 and x0 <= 1153) or (x0 >= 1155 and x0 <= 1159) or (x0 >= 1162 and x0 <= 1327) or (x0 >= 1329 and x0 <= 1366) or x0 === 1369 or (x0 >= 1376 and x0 <= 1416) or (x0 >= 1425 and x0 <= 1469) or x0 === 1471 or (x0 >= 1473 and x0 <= 1474) or (x0 >= 1476 and x0 <= 1477) or x0 === 1479 or (x0 >= 1488 and x0 <= 1514) or (x0 >= 1519 and x0 <= 1522) or (x0 >= 1552 and x0 <= 1562) or (x0 >= 1568 and x0 <= 1641) or (x0 >= 1646 and x0 <= 1747) or (x0 >= 1749 and x0 <= 1756) or (x0 >= 1759 and x0 <= 1768) or (x0 >= 1770 and x0 <= 1788) or x0 === 1791 or (x0 >= 1808 and x0 <= 1866) or (x0 >= 1869 and x0 <= 1969) or (x0 >= 1984 and x0 <= 2037) or x0 === 2042 or x0 === 2045 or (x0 >= 2048 and x0 <= 2093) or (x0 >= 2112 and x0 <= 2139) or (x0 >= 2144 and x0 <= 2154) or (x0 >= 2208 and x0 <= 2228) or (x0 >= 2230 and x0 <= 2247) or (x0 >= 2259 and x0 <= 2273) or (x0 >= 2275 and x0 <= 2403) or (x0 >= 2406 and x0 <= 2415) or (x0 >= 2417 and x0 <= 2435) or (x0 >= 2437 and x0 <= 2444) or (x0 >= 2447 and x0 <= 2448) or (x0 >= 2451 and x0 <= 2472) or (x0 >= 2474 and x0 <= 2480) or x0 === 2482 or (x0 >= 2486 and x0 <= 2489) or (x0 >= 2492 and x0 <= 2500) or (x0 >= 2503 and x0 <= 2504) or (x0 >= 2507 and x0 <= 2510) or x0 === 2519 or (x0 >= 2524 and x0 <= 2525) or (x0 >= 2527 and x0 <= 2531) or (x0 >= 2534 and x0 <= 2545) or x0 === 2556 or x0 === 2558 or (x0 >= 2561 and x0 <= 2563) or (x0 >= 2565 and x0 <= 2570) or (x0 >= 2575 and x0 <= 2576) or (x0 >= 2579 and x0 <= 2600) or (x0 >= 2602 and x0 <= 2608) or (x0 >= 2610 and x0 <= 2611) or (x0 >= 2613 and x0 <= 2614) or (x0 >= 2616 and x0 <= 2617) or x0 === 2620 or (x0 >= 2622 and x0 <= 2626) or (x0 >= 2631 and x0 <= 2632) or (x0 >= 2635 and x0 <= 2637) or x0 === 2641 or (x0 >= 2649 and x0 <= 2652) or x0 === 2654 or (x0 >= 2662 and x0 <= 2677) or (x0 >= 2689 and x0 <= 2691) or (x0 >= 2693 and x0 <= 2701) or (x0 >= 2703 and x0 <= 2705) or (x0 >= 2707 and x0 <= 2728) or (x0 >= 2730 and x0 <= 2736) or (x0 >= 2738 and x0 <= 2739) or (x0 >= 2741 and x0 <= 2745) or (x0 >= 2748 and x0 <= 2757) or (x0 >= 2759 and x0 <= 2761) or (x0 >= 2763 and x0 <= 2765) or x0 === 2768 or (x0 >= 2784 and x0 <= 2787) or (x0 >= 2790 and x0 <= 2799) or (x0 >= 2809 and x0 <= 2815) or (x0 >= 2817 and x0 <= 2819) or (x0 >= 2821 and x0 <= 2828) or (x0 >= 2831 and x0 <= 2832) or (x0 >= 2835 and x0 <= 2856) or (x0 >= 2858 and x0 <= 2864) or (x0 >= 2866 and x0 <= 2867) or (x0 >= 2869 and x0 <= 2873) or (x0 >= 2876 and x0 <= 2884) or (x0 >= 2887 and x0 <= 2888) or (x0 >= 2891 and x0 <= 2893) or (x0 >= 2901 and x0 <= 2903) or (x0 >= 2908 and x0 <= 2909) or (x0 >= 2911 and x0 <= 2915) or (x0 >= 2918 and x0 <= 2927) or x0 === 2929 or (x0 >= 2946 and x0 <= 2947) or (x0 >= 2949 and x0 <= 2954) or (x0 >= 2958 and x0 <= 2960) or (x0 >= 2962 and x0 <= 2965) or (x0 >= 2969 and x0 <= 2970) or x0 === 2972 or (x0 >= 2974 and x0 <= 2975) or (x0 >= 2979 and x0 <= 2980) or (x0 >= 2984 and x0 <= 2986) or (x0 >= 2990 and x0 <= 3001) or (x0 >= 3006 and x0 <= 3010) or (x0 >= 3014 and x0 <= 3016) or (x0 >= 3018 and x0 <= 3021) or x0 === 3024 or x0 === 3031 or (x0 >= 3046 and x0 <= 3055) or (x0 >= 3072 and x0 <= 3084) or (x0 >= 3086 and x0 <= 3088) or (x0 >= 3090 and x0 <= 3112) or (x0 >= 3114 and x0 <= 3129) or (x0 >= 3133 and x0 <= 3140) or (x0 >= 3142 and x0 <= 3144) or (x0 >= 3146 and x0 <= 3149) or (x0 >= 3157 and x0 <= 3158) or (x0 >= 3160 and x0 <= 3162) or (x0 >= 3168 and x0 <= 3171) or (x0 >= 3174 and x0 <= 3183) or (x0 >= 3200 and x0 <= 3203) or (x0 >= 3205 and x0 <= 3212) or (x0 >= 3214 and x0 <= 3216) or (x0 >= 3218 and x0 <= 3240) or (x0 >= 3242 and x0 <= 3251) or (x0 >= 3253 and x0 <= 3257) or (x0 >= 3260 and x0 <= 3268) or (x0 >= 3270 and x0 <= 3272) or (x0 >= 3274 and x0 <= 3277) or (x0 >= 3285 and x0 <= 3286) or x0 === 3294 or (x0 >= 3296 and x0 <= 3299) or (x0 >= 3302 and x0 <= 3311) or (x0 >= 3313 and x0 <= 3314) or (x0 >= 3328 and x0 <= 3340) or (x0 >= 3342 and x0 <= 3344) or (x0 >= 3346 and x0 <= 3396) or (x0 >= 3398 and x0 <= 3400) or (x0 >= 3402 and x0 <= 3406) or (x0 >= 3412 and x0 <= 3415) or (x0 >= 3423 and x0 <= 3427) or (x0 >= 3430 and x0 <= 3439) or (x0 >= 3450 and x0 <= 3455) or (x0 >= 3457 and x0 <= 3459) or (x0 >= 3461 and x0 <= 3478) or (x0 >= 3482 and x0 <= 3505) or (x0 >= 3507 and x0 <= 3515) or x0 === 3517 or (x0 >= 3520 and x0 <= 3526) or x0 === 3530 or (x0 >= 3535 and x0 <= 3540) or x0 === 3542 or (x0 >= 3544 and x0 <= 3551) or (x0 >= 3558 and x0 <= 3567) or (x0 >= 3570 and x0 <= 3571) or (x0 >= 3585 and x0 <= 3642) or (x0 >= 3648 and x0 <= 3662) or (x0 >= 3664 and x0 <= 3673) or (x0 >= 3713 and x0 <= 3714) or x0 === 3716 or (x0 >= 3718 and x0 <= 3722) or (x0 >= 3724 and x0 <= 3747) or x0 === 3749 or (x0 >= 3751 and x0 <= 3773) or (x0 >= 3776 and x0 <= 3780) or x0 === 3782 or (x0 >= 3784 and x0 <= 3789) or (x0 >= 3792 and x0 <= 3801) or (x0 >= 3804 and x0 <= 3807) or x0 === 3840 or (x0 >= 3864 and x0 <= 3865) or (x0 >= 3872 and x0 <= 3881) or x0 === 3893 or x0 === 3895 or x0 === 3897 or (x0 >= 3902 and x0 <= 3911) or (x0 >= 3913 and x0 <= 3948) or (x0 >= 3953 and x0 <= 3972) or (x0 >= 3974 and x0 <= 3991) or (x0 >= 3993 and x0 <= 4028) or x0 === 4038 or (x0 >= 4096 and x0 <= 4169) or (x0 >= 4176 and x0 <= 4253) or (x0 >= 4256 and x0 <= 4293) or x0 === 4295 or x0 === 4301 or (x0 >= 4304 and x0 <= 4346) or (x0 >= 4348 and x0 <= 4680) or (x0 >= 4682 and x0 <= 4685) or (x0 >= 4688 and x0 <= 4694) or x0 === 4696 or (x0 >= 4698 and x0 <= 4701) or (x0 >= 4704 and x0 <= 4744) or (x0 >= 4746 and x0 <= 4749) or (x0 >= 4752 and x0 <= 4784) or (x0 >= 4786 and x0 <= 4789) or (x0 >= 4792 and x0 <= 4798) or x0 === 4800 or (x0 >= 4802 and x0 <= 4805) or (x0 >= 4808 and x0 <= 4822) or (x0 >= 4824 and x0 <= 4880) or (x0 >= 4882 and x0 <= 4885) or (x0 >= 4888 and x0 <= 4954) or (x0 >= 4957 and x0 <= 4959) or (x0 >= 4969 and x0 <= 4977) or (x0 >= 4992 and x0 <= 5007) or (x0 >= 5024 and x0 <= 5109) or (x0 >= 5112 and x0 <= 5117) or (x0 >= 5121 and x0 <= 5740) or (x0 >= 5743 and x0 <= 5759) or (x0 >= 5761 and x0 <= 5786) or (x0 >= 5792 and x0 <= 5866) or (x0 >= 5870 and x0 <= 5880) or (x0 >= 5888 and x0 <= 5900) or (x0 >= 5902 and x0 <= 5908) or (x0 >= 5920 and x0 <= 5940) or (x0 >= 5952 and x0 <= 5971) or (x0 >= 5984 and x0 <= 5996) or (x0 >= 5998 and x0 <= 6000) or (x0 >= 6002 and x0 <= 6003) or (x0 >= 6016 and x0 <= 6099) or x0 === 6103 or (x0 >= 6108 and x0 <= 6109) or (x0 >= 6112 and x0 <= 6121) or (x0 >= 6155 and x0 <= 6157) or (x0 >= 6160 and x0 <= 6169) or (x0 >= 6176 and x0 <= 6264) or (x0 >= 6272 and x0 <= 6314) or (x0 >= 6320 and x0 <= 6389) or (x0 >= 6400 and x0 <= 6430) or (x0 >= 6432 and x0 <= 6443) or (x0 >= 6448 and x0 <= 6459) or (x0 >= 6470 and x0 <= 6509) or (x0 >= 6512 and x0 <= 6516) or (x0 >= 6528 and x0 <= 6571) or (x0 >= 6576 and x0 <= 6601) or (x0 >= 6608 and x0 <= 6618) or (x0 >= 6656 and x0 <= 6683) or (x0 >= 6688 and x0 <= 6750) or (x0 >= 6752 and x0 <= 6780) or (x0 >= 6783 and x0 <= 6793) or (x0 >= 6800 and x0 <= 6809) or x0 === 6823 or (x0 >= 6832 and x0 <= 6845) or (x0 >= 6847 and x0 <= 6848) or (x0 >= 6912 and x0 <= 6987) or (x0 >= 6992 and x0 <= 7001) or (x0 >= 7019 and x0 <= 7027) or (x0 >= 7040 and x0 <= 7155) or (x0 >= 7168 and x0 <= 7223) or (x0 >= 7232 and x0 <= 7241) or (x0 >= 7245 and x0 <= 7293) or (x0 >= 7296 and x0 <= 7304) or (x0 >= 7312 and x0 <= 7354) or (x0 >= 7357 and x0 <= 7359) or (x0 >= 7376 and x0 <= 7378) or (x0 >= 7380 and x0 <= 7418) or (x0 >= 7424 and x0 <= 7673) or (x0 >= 7675 and x0 <= 7957) or (x0 >= 7960 and x0 <= 7965) or (x0 >= 7968 and x0 <= 8005) or (x0 >= 8008 and x0 <= 8013) or (x0 >= 8016 and x0 <= 8023) or x0 === 8025 or x0 === 8027 or x0 === 8029 or (x0 >= 8031 and x0 <= 8061) or (x0 >= 8064 and x0 <= 8116) or (x0 >= 8118 and x0 <= 8124) or x0 === 8126 or (x0 >= 8130 and x0 <= 8132) or (x0 >= 8134 and x0 <= 8140) or (x0 >= 8144 and x0 <= 8147) or (x0 >= 8150 and x0 <= 8155) or (x0 >= 8160 and x0 <= 8172) or (x0 >= 8178 and x0 <= 8180) or (x0 >= 8182 and x0 <= 8188) or (x0 >= 8255 and x0 <= 8256) or x0 === 8276 or x0 === 8305 or x0 === 8319 or (x0 >= 8336 and x0 <= 8348) or (x0 >= 8400 and x0 <= 8412) or x0 === 8417 or (x0 >= 8421 and x0 <= 8432) or x0 === 8450 or x0 === 8455 or (x0 >= 8458 and x0 <= 8467) or x0 === 8469 or (x0 >= 8472 and x0 <= 8477) or x0 === 8484 or x0 === 8486 or x0 === 8488 or (x0 >= 8490 and x0 <= 8505) or (x0 >= 8508 and x0 <= 8511) or (x0 >= 8517 and x0 <= 8521) or x0 === 8526 or (x0 >= 8544 and x0 <= 8584) or (x0 >= 11264 and x0 <= 11310) or (x0 >= 11312 and x0 <= 11358) or (x0 >= 11360 and x0 <= 11492) or (x0 >= 11499 and x0 <= 11507) or (x0 >= 11520 and x0 <= 11557) or x0 === 11559 or x0 === 11565 or (x0 >= 11568 and x0 <= 11623) or x0 === 11631 or (x0 >= 11647 and x0 <= 11670) or (x0 >= 11680 and x0 <= 11686) or (x0 >= 11688 and x0 <= 11694) or (x0 >= 11696 and x0 <= 11702) or (x0 >= 11704 and x0 <= 11710) or (x0 >= 11712 and x0 <= 11718) or (x0 >= 11720 and x0 <= 11726) or (x0 >= 11728 and x0 <= 11734) or (x0 >= 11736 and x0 <= 11742) or (x0 >= 11744 and x0 <= 11775) or (x0 >= 12293 and x0 <= 12295) or (x0 >= 12321 and x0 <= 12335) or (x0 >= 12337 and x0 <= 12341) or (x0 >= 12344 and x0 <= 12348) or (x0 >= 12353 and x0 <= 12438) or (x0 >= 12441 and x0 <= 12447) or (x0 >= 12449 and x0 <= 12538) or (x0 >= 12540 and x0 <= 12543) or (x0 >= 12549 and x0 <= 12591) or (x0 >= 12593 and x0 <= 12686) or (x0 >= 12704 and x0 <= 12735) or (x0 >= 12784 and x0 <= 12799) or (x0 >= 13312 and x0 <= 19903) or (x0 >= 19968 and x0 <= 40956) or (x0 >= 40960 and x0 <= 42124) or (x0 >= 42192 and x0 <= 42237) or (x0 >= 42240 and x0 <= 42508) or (x0 >= 42512 and x0 <= 42539) or (x0 >= 42560 and x0 <= 42607) or (x0 >= 42612 and x0 <= 42621) or (x0 >= 42623 and x0 <= 42737) or (x0 >= 42775 and x0 <= 42783) or (x0 >= 42786 and x0 <= 42888) or (x0 >= 42891 and x0 <= 42943) or (x0 >= 42946 and x0 <= 42954) or (x0 >= 42997 and x0 <= 43047) or x0 === 43052 or (x0 >= 43072 and x0 <= 43123) or (x0 >= 43136 and x0 <= 43205) or (x0 >= 43216 and x0 <= 43225) or (x0 >= 43232 and x0 <= 43255) or x0 === 43259 or (x0 >= 43261 and x0 <= 43309) or (x0 >= 43312 and x0 <= 43347) or (x0 >= 43360 and x0 <= 43388) or (x0 >= 43392 and x0 <= 43456) or (x0 >= 43471 and x0 <= 43481) or (x0 >= 43488 and x0 <= 43518) or (x0 >= 43520 and x0 <= 43574) or (x0 >= 43584 and x0 <= 43597) or (x0 >= 43600 and x0 <= 43609) or (x0 >= 43616 and x0 <= 43638) or (x0 >= 43642 and x0 <= 43714) or (x0 >= 43739 and x0 <= 43741) or (x0 >= 43744 and x0 <= 43759) or (x0 >= 43762 and x0 <= 43766) or (x0 >= 43777 and x0 <= 43782) or (x0 >= 43785 and x0 <= 43790) or (x0 >= 43793 and x0 <= 43798) or (x0 >= 43808 and x0 <= 43814) or (x0 >= 43816 and x0 <= 43822) or (x0 >= 43824 and x0 <= 43866) or (x0 >= 43868 and x0 <= 43881) or (x0 >= 43888 and x0 <= 44010) or (x0 >= 44012 and x0 <= 44013) or (x0 >= 44016 and x0 <= 44025) or (x0 >= 44032 and x0 <= 55203) or (x0 >= 55216 and x0 <= 55238) or (x0 >= 55243 and x0 <= 55291) or (x0 >= 63744 and x0 <= 64109) or (x0 >= 64112 and x0 <= 64217) or (x0 >= 64256 and x0 <= 64262) or (x0 >= 64275 and x0 <= 64279) or (x0 >= 64285 and x0 <= 64296) or (x0 >= 64298 and x0 <= 64310) or (x0 >= 64312 and x0 <= 64316) or x0 === 64318 or (x0 >= 64320 and x0 <= 64321) or (x0 >= 64323 and x0 <= 64324) or (x0 >= 64326 and x0 <= 64433) or (x0 >= 64467 and x0 <= 64829) or (x0 >= 64848 and x0 <= 64911) or (x0 >= 64914 and x0 <= 64967) or (x0 >= 65008 and x0 <= 65019) or (x0 >= 65024 and x0 <= 65039) or (x0 >= 65056 and x0 <= 65071) or (x0 >= 65075 and x0 <= 65076) or (x0 >= 65101 and x0 <= 65103) or (x0 >= 65136 and x0 <= 65140) or (x0 >= 65142 and x0 <= 65276) or (x0 >= 65296 and x0 <= 65305) or (x0 >= 65313 and x0 <= 65338) or x0 === 65343 or (x0 >= 65345 and x0 <= 65370) or (x0 >= 65382 and x0 <= 65470) or (x0 >= 65474 and x0 <= 65479) or (x0 >= 65482 and x0 <= 65487) or (x0 >= 65490 and x0 <= 65495) or (x0 >= 65498 and x0 <= 65500) or (x0 >= 65536 and x0 <= 65547) or (x0 >= 65549 and x0 <= 65574) or (x0 >= 65576 and x0 <= 65594) or (x0 >= 65596 and x0 <= 65597) or (x0 >= 65599 and x0 <= 65613) or (x0 >= 65616 and x0 <= 65629) or (x0 >= 65664 and x0 <= 65786) or (x0 >= 65856 and x0 <= 65908) or x0 === 66045 or (x0 >= 66176 and x0 <= 66204) or (x0 >= 66208 and x0 <= 66256) or x0 === 66272 or (x0 >= 66304 and x0 <= 66335) or (x0 >= 66349 and x0 <= 66378) or (x0 >= 66384 and x0 <= 66426) or (x0 >= 66432 and x0 <= 66461) or (x0 >= 66464 and x0 <= 66499) or (x0 >= 66504 and x0 <= 66511) or (x0 >= 66513 and x0 <= 66517) or (x0 >= 66560 and x0 <= 66717) or (x0 >= 66720 and x0 <= 66729) or (x0 >= 66736 and x0 <= 66771) or (x0 >= 66776 and x0 <= 66811) or (x0 >= 66816 and x0 <= 66855) or (x0 >= 66864 and x0 <= 66915) or (x0 >= 67072 and x0 <= 67382) or (x0 >= 67392 and x0 <= 67413) or (x0 >= 67424 and x0 <= 67431) or (x0 >= 67584 and x0 <= 67589) or x0 === 67592 or (x0 >= 67594 and x0 <= 67637) or (x0 >= 67639 and x0 <= 67640) or x0 === 67644 or (x0 >= 67647 and x0 <= 67669) or (x0 >= 67680 and x0 <= 67702) or (x0 >= 67712 and x0 <= 67742) or (x0 >= 67808 and x0 <= 67826) or (x0 >= 67828 and x0 <= 67829) or (x0 >= 67840 and x0 <= 67861) or (x0 >= 67872 and x0 <= 67897) or (x0 >= 67968 and x0 <= 68023) or (x0 >= 68030 and x0 <= 68031) or (x0 >= 68096 and x0 <= 68099) or (x0 >= 68101 and x0 <= 68102) or (x0 >= 68108 and x0 <= 68115) or (x0 >= 68117 and x0 <= 68119) or (x0 >= 68121 and x0 <= 68149) or (x0 >= 68152 and x0 <= 68154) or x0 === 68159 or (x0 >= 68192 and x0 <= 68220) or (x0 >= 68224 and x0 <= 68252) or (x0 >= 68288 and x0 <= 68295) or (x0 >= 68297 and x0 <= 68326) or (x0 >= 68352 and x0 <= 68405) or (x0 >= 68416 and x0 <= 68437) or (x0 >= 68448 and x0 <= 68466) or (x0 >= 68480 and x0 <= 68497) or (x0 >= 68608 and x0 <= 68680) or (x0 >= 68736 and x0 <= 68786) or (x0 >= 68800 and x0 <= 68850) or (x0 >= 68864 and x0 <= 68903) or (x0 >= 68912 and x0 <= 68921) or (x0 >= 69248 and x0 <= 69289) or (x0 >= 69291 and x0 <= 69292) or (x0 >= 69296 and x0 <= 69297) or (x0 >= 69376 and x0 <= 69404) or x0 === 69415 or (x0 >= 69424 and x0 <= 69456) or (x0 >= 69552 and x0 <= 69572) or (x0 >= 69600 and x0 <= 69622) or (x0 >= 69632 and x0 <= 69702) or (x0 >= 69734 and x0 <= 69743) or (x0 >= 69759 and x0 <= 69818) or (x0 >= 69840 and x0 <= 69864) or (x0 >= 69872 and x0 <= 69881) or (x0 >= 69888 and x0 <= 69940) or (x0 >= 69942 and x0 <= 69951) or (x0 >= 69956 and x0 <= 69959) or (x0 >= 69968 and x0 <= 70003) or x0 === 70006 or (x0 >= 70016 and x0 <= 70084) or (x0 >= 70089 and x0 <= 70092) or (x0 >= 70094 and x0 <= 70106) or x0 === 70108 or (x0 >= 70144 and x0 <= 70161) or (x0 >= 70163 and x0 <= 70199) or x0 === 70206 or (x0 >= 70272 and x0 <= 70278) or x0 === 70280 or (x0 >= 70282 and x0 <= 70285) or (x0 >= 70287 and x0 <= 70301) or (x0 >= 70303 and x0 <= 70312) or (x0 >= 70320 and x0 <= 70378) or (x0 >= 70384 and x0 <= 70393) or (x0 >= 70400 and x0 <= 70403) or (x0 >= 70405 and x0 <= 70412) or (x0 >= 70415 and x0 <= 70416) or (x0 >= 70419 and x0 <= 70440) or (x0 >= 70442 and x0 <= 70448) or (x0 >= 70450 and x0 <= 70451) or (x0 >= 70453 and x0 <= 70457) or (x0 >= 70459 and x0 <= 70468) or (x0 >= 70471 and x0 <= 70472) or (x0 >= 70475 and x0 <= 70477) or x0 === 70480 or x0 === 70487 or (x0 >= 70493 and x0 <= 70499) or (x0 >= 70502 and x0 <= 70508) or (x0 >= 70512 and x0 <= 70516) or (x0 >= 70656 and x0 <= 70730) or (x0 >= 70736 and x0 <= 70745) or (x0 >= 70750 and x0 <= 70753) or (x0 >= 70784 and x0 <= 70853) or x0 === 70855 or (x0 >= 70864 and x0 <= 70873) or (x0 >= 71040 and x0 <= 71093) or (x0 >= 71096 and x0 <= 71104) or (x0 >= 71128 and x0 <= 71133) or (x0 >= 71168 and x0 <= 71232) or x0 === 71236 or (x0 >= 71248 and x0 <= 71257) or (x0 >= 71296 and x0 <= 71352) or (x0 >= 71360 and x0 <= 71369) or (x0 >= 71424 and x0 <= 71450) or (x0 >= 71453 and x0 <= 71467) or (x0 >= 71472 and x0 <= 71481) or (x0 >= 71680 and x0 <= 71738) or (x0 >= 71840 and x0 <= 71913) or (x0 >= 71935 and x0 <= 71942) or x0 === 71945 or (x0 >= 71948 and x0 <= 71955) or (x0 >= 71957 and x0 <= 71958) or (x0 >= 71960 and x0 <= 71989) or (x0 >= 71991 and x0 <= 71992) or (x0 >= 71995 and x0 <= 72003) or (x0 >= 72016 and x0 <= 72025) or (x0 >= 72096 and x0 <= 72103) or (x0 >= 72106 and x0 <= 72151) or (x0 >= 72154 and x0 <= 72161) or (x0 >= 72163 and x0 <= 72164) or (x0 >= 72192 and x0 <= 72254) or x0 === 72263 or (x0 >= 72272 and x0 <= 72345) or x0 === 72349 or (x0 >= 72384 and x0 <= 72440) or (x0 >= 72704 and x0 <= 72712) or (x0 >= 72714 and x0 <= 72758) or (x0 >= 72760 and x0 <= 72768) or (x0 >= 72784 and x0 <= 72793) or (x0 >= 72818 and x0 <= 72847) or (x0 >= 72850 and x0 <= 72871) or (x0 >= 72873 and x0 <= 72886) or (x0 >= 72960 and x0 <= 72966) or (x0 >= 72968 and x0 <= 72969) or (x0 >= 72971 and x0 <= 73014) or x0 === 73018 or (x0 >= 73020 and x0 <= 73021) or (x0 >= 73023 and x0 <= 73031) or (x0 >= 73040 and x0 <= 73049) or (x0 >= 73056 and x0 <= 73061) or (x0 >= 73063 and x0 <= 73064) or (x0 >= 73066 and x0 <= 73102) or (x0 >= 73104 and x0 <= 73105) or (x0 >= 73107 and x0 <= 73112) or (x0 >= 73120 and x0 <= 73129) or (x0 >= 73440 and x0 <= 73462) or x0 === 73648 or (x0 >= 73728 and x0 <= 74649) or (x0 >= 74752 and x0 <= 74862) or (x0 >= 74880 and x0 <= 75075) or (x0 >= 77824 and x0 <= 78894) or (x0 >= 82944 and x0 <= 83526) or (x0 >= 92160 and x0 <= 92728) or (x0 >= 92736 and x0 <= 92766) or (x0 >= 92768 and x0 <= 92777) or (x0 >= 92880 and x0 <= 92909) or (x0 >= 92912 and x0 <= 92916) or (x0 >= 92928 and x0 <= 92982) or (x0 >= 92992 and x0 <= 92995) or (x0 >= 93008 and x0 <= 93017) or (x0 >= 93027 and x0 <= 93047) or (x0 >= 93053 and x0 <= 93071) or (x0 >= 93760 and x0 <= 93823) or (x0 >= 93952 and x0 <= 94026) or (x0 >= 94031 and x0 <= 94087) or (x0 >= 94095 and x0 <= 94111) or (x0 >= 94176 and x0 <= 94177) or (x0 >= 94179 and x0 <= 94180) or (x0 >= 94192 and x0 <= 94193) or (x0 >= 94208 and x0 <= 100_343) or (x0 >= 100_352 and x0 <= 101_589) or (x0 >= 101_632 and x0 <= 101_640) or (x0 >= 110_592 and x0 <= 110_878) or (x0 >= 110_928 and x0 <= 110_930) or (x0 >= 110_948 and x0 <= 110_951) or (x0 >= 110_960 and x0 <= 111_355) or (x0 >= 113_664 and x0 <= 113_770) or (x0 >= 113_776 and x0 <= 113_788) or (x0 >= 113_792 and x0 <= 113_800) or (x0 >= 113_808 and x0 <= 113_817) or (x0 >= 113_821 and x0 <= 113_822) or (x0 >= 119_141 and x0 <= 119_145) or (x0 >= 119_149 and x0 <= 119_154) or (x0 >= 119_163 and x0 <= 119_170) or (x0 >= 119_173 and x0 <= 119_179) or (x0 >= 119_210 and x0 <= 119_213) or (x0 >= 119_362 and x0 <= 119_364) or (x0 >= 119_808 and x0 <= 119_892) or (x0 >= 119_894 and x0 <= 119_964) or (x0 >= 119_966 and x0 <= 119_967) or x0 === 119_970 or (x0 >= 119_973 and x0 <= 119_974) or (x0 >= 119_977 and x0 <= 119_980) or (x0 >= 119_982 and x0 <= 119_993) or x0 === 119_995 or (x0 >= 119_997 and x0 <= 120_003) or (x0 >= 120_005 and x0 <= 120_069) or (x0 >= 120_071 and x0 <= 120_074) or (x0 >= 120_077 and x0 <= 120_084) or (x0 >= 120_086 and x0 <= 120_092) or (x0 >= 120_094 and x0 <= 120_121) or (x0 >= 120_123 and x0 <= 120_126) or (x0 >= 120_128 and x0 <= 120_132) or x0 === 120_134 or (x0 >= 120_138 and x0 <= 120_144) or (x0 >= 120_146 and x0 <= 120_485) or (x0 >= 120_488 and x0 <= 120_512) or (x0 >= 120_514 and x0 <= 120_538) or (x0 >= 120_540 and x0 <= 120_570) or (x0 >= 120_572 and x0 <= 120_596) or (x0 >= 120_598 and x0 <= 120_628) or (x0 >= 120_630 and x0 <= 120_654) or (x0 >= 120_656 and x0 <= 120_686) or (x0 >= 120_688 and x0 <= 120_712) or (x0 >= 120_714 and x0 <= 120_744) or (x0 >= 120_746 and x0 <= 120_770) or (x0 >= 120_772 and x0 <= 120_779) or (x0 >= 120_782 and x0 <= 120_831) or (x0 >= 121_344 and x0 <= 121_398) or (x0 >= 121_403 and x0 <= 121_452) or x0 === 121_461 or x0 === 121_476 or (x0 >= 121_499 and x0 <= 121_503) or (x0 >= 121_505 and x0 <= 121_519) or (x0 >= 122_880 and x0 <= 122_886) or (x0 >= 122_888 and x0 <= 122_904) or (x0 >= 122_907 and x0 <= 122_913) or (x0 >= 122_915 and x0 <= 122_916) or (x0 >= 122_918 and x0 <= 122_922) or (x0 >= 123_136 and x0 <= 123_180) or (x0 >= 123_184 and x0 <= 123_197) or (x0 >= 123_200 and x0 <= 123_209) or x0 === 123_214 or (x0 >= 123_584 and x0 <= 123_641) or (x0 >= 124_928 and x0 <= 125_124) or (x0 >= 125_136 and x0 <= 125_142) or (x0 >= 125_184 and x0 <= 125_259) or (x0 >= 125_264 and x0 <= 125_273) or (x0 >= 126_464 and x0 <= 126_467) or (x0 >= 126_469 and x0 <= 126_495) or (x0 >= 126_497 and x0 <= 126_498) or x0 === 126_500 or x0 === 126_503 or (x0 >= 126_505 and x0 <= 126_514) or (x0 >= 126_516 and x0 <= 126_519) or x0 === 126_521 or x0 === 126_523 or x0 === 126_530 or x0 === 126_535 or x0 === 126_537 or x0 === 126_539 or (x0 >= 126_541 and x0 <= 126_543) or (x0 >= 126_545 and x0 <= 126_546) or x0 === 126_548 or x0 === 126_551 or x0 === 126_553 or x0 === 126_555 or x0 === 126_557 or x0 === 126_559 or (x0 >= 126_561 and x0 <= 126_562) or x0 === 126_564 or (x0 >= 126_567 and x0 <= 126_570) or (x0 >= 126_572 and x0 <= 126_578) or (x0 >= 126_580 and x0 <= 126_583) or (x0 >= 126_585 and x0 <= 126_588) or x0 === 126_590 or (x0 >= 126_592 and x0 <= 126_601) or (x0 >= 126_603 and x0 <= 126_619) or (x0 >= 126_625 and x0 <= 126_627) or (x0 >= 126_629 and x0 <= 126_633) or (x0 >= 126_635 and x0 <= 126_651) or (x0 >= 130_032 and x0 <= 130_041) or (x0 >= 131_072 and x0 <= 173_789) or (x0 >= 173_824 and x0 <= 177_972) or (x0 >= 177_984 and x0 <= 178_205) or (x0 >= 178_208 and x0 <= 183_969) or (x0 >= 183_984 and x0 <= 191_456) or (x0 >= 194_560 and x0 <= 195_101) or (x0 >= 196_608 and x0 <= 201_546) or (x0 >= 917_760 and x0 <= 917_999) do variable_continue_chars__1( rest, [x0] ++ acc, stack, context, comb__line, comb__offset + byte_size(<>) ) end def variable_continue_chars__0(rest, _acc, _stack, context, line, offset) do {:error, "expected variable continue", rest, context, line, offset} end def variable_continue_chars__1(rest, acc, _stack, context, line, offset) do {:ok, acc, rest, context, line, offset} end def variable_start_chars__0( <>, acc, stack, context, comb__line, comb__offset ) when x0 === 95 or (x0 >= 97 and x0 <= 122) or x0 === 170 or x0 === 181 or x0 === 186 or (x0 >= 223 and x0 <= 246) or (x0 >= 248 and x0 <= 255) or x0 === 257 or x0 === 259 or x0 === 261 or x0 === 263 or x0 === 265 or x0 === 267 or x0 === 269 or x0 === 271 or x0 === 273 or x0 === 275 or x0 === 277 or x0 === 279 or x0 === 281 or x0 === 283 or x0 === 285 or x0 === 287 or x0 === 289 or x0 === 291 or x0 === 293 or x0 === 295 or x0 === 297 or x0 === 299 or x0 === 301 or x0 === 303 or x0 === 305 or x0 === 307 or x0 === 309 or (x0 >= 311 and x0 <= 312) or x0 === 314 or x0 === 316 or x0 === 318 or x0 === 320 or x0 === 322 or x0 === 324 or x0 === 326 or (x0 >= 328 and x0 <= 329) or x0 === 331 or x0 === 333 or x0 === 335 or x0 === 337 or x0 === 339 or x0 === 341 or x0 === 343 or x0 === 345 or x0 === 347 or x0 === 349 or x0 === 351 or x0 === 353 or x0 === 355 or x0 === 357 or x0 === 359 or x0 === 361 or x0 === 363 or x0 === 365 or x0 === 367 or x0 === 369 or x0 === 371 or x0 === 373 or x0 === 375 or x0 === 378 or x0 === 380 or (x0 >= 382 and x0 <= 384) or x0 === 387 or x0 === 389 or x0 === 392 or (x0 >= 396 and x0 <= 397) or x0 === 402 or x0 === 405 or (x0 >= 409 and x0 <= 411) or x0 === 414 or x0 === 417 or x0 === 419 or x0 === 421 or x0 === 424 or (x0 >= 426 and x0 <= 427) or x0 === 429 or x0 === 432 or x0 === 436 or x0 === 438 or (x0 >= 441 and x0 <= 443) or (x0 >= 445 and x0 <= 451) or x0 === 454 or x0 === 457 or x0 === 460 or x0 === 462 or x0 === 464 or x0 === 466 or x0 === 468 or x0 === 470 or x0 === 472 or x0 === 474 or (x0 >= 476 and x0 <= 477) or x0 === 479 or x0 === 481 or x0 === 483 or x0 === 485 or x0 === 487 or x0 === 489 or x0 === 491 or x0 === 493 or (x0 >= 495 and x0 <= 496) or x0 === 499 or x0 === 501 or x0 === 505 or x0 === 507 or x0 === 509 or x0 === 511 or x0 === 513 or x0 === 515 or x0 === 517 or x0 === 519 or x0 === 521 or x0 === 523 or x0 === 525 or x0 === 527 or x0 === 529 or x0 === 531 or x0 === 533 or x0 === 535 or x0 === 537 or x0 === 539 or x0 === 541 or x0 === 543 or x0 === 545 or x0 === 547 or x0 === 549 or x0 === 551 or x0 === 553 or x0 === 555 or x0 === 557 or x0 === 559 or x0 === 561 or (x0 >= 563 and x0 <= 569) or x0 === 572 or (x0 >= 575 and x0 <= 576) or x0 === 578 or x0 === 583 or x0 === 585 or x0 === 587 or x0 === 589 or (x0 >= 591 and x0 <= 705) or (x0 >= 710 and x0 <= 721) or (x0 >= 736 and x0 <= 740) or x0 === 748 or x0 === 750 or (x0 >= 881 and x0 <= 884) or x0 === 887 or (x0 >= 890 and x0 <= 893) or (x0 >= 912 and x0 <= 929) or (x0 >= 940 and x0 <= 1013) or (x0 >= 1016 and x0 <= 1153) or (x0 >= 1163 and x0 <= 1327) or x0 === 1369 or (x0 >= 1376 and x0 <= 1416) or (x0 >= 1488 and x0 <= 1514) or (x0 >= 1519 and x0 <= 1522) or (x0 >= 1568 and x0 <= 1610) or (x0 >= 1646 and x0 <= 1647) or (x0 >= 1649 and x0 <= 1747) or x0 === 1749 or (x0 >= 1765 and x0 <= 1766) or (x0 >= 1774 and x0 <= 1775) or (x0 >= 1786 and x0 <= 1788) or x0 === 1791 or x0 === 1808 or (x0 >= 1810 and x0 <= 1839) or (x0 >= 1869 and x0 <= 1957) or x0 === 1969 or (x0 >= 1994 and x0 <= 2026) or (x0 >= 2036 and x0 <= 2037) or x0 === 2042 or (x0 >= 2048 and x0 <= 2069) or x0 === 2074 or x0 === 2084 or x0 === 2088 or (x0 >= 2112 and x0 <= 2136) or (x0 >= 2144 and x0 <= 2154) or (x0 >= 2208 and x0 <= 2228) or (x0 >= 2230 and x0 <= 2247) or (x0 >= 2308 and x0 <= 2361) or x0 === 2365 or x0 === 2384 or (x0 >= 2392 and x0 <= 2401) or (x0 >= 2417 and x0 <= 2432) or (x0 >= 2437 and x0 <= 2444) or (x0 >= 2447 and x0 <= 2448) or (x0 >= 2451 and x0 <= 2472) or (x0 >= 2474 and x0 <= 2480) or x0 === 2482 or (x0 >= 2486 and x0 <= 2489) or x0 === 2493 or x0 === 2510 or (x0 >= 2524 and x0 <= 2525) or (x0 >= 2527 and x0 <= 2529) or (x0 >= 2544 and x0 <= 2545) or x0 === 2556 or (x0 >= 2565 and x0 <= 2570) or (x0 >= 2575 and x0 <= 2576) or (x0 >= 2579 and x0 <= 2600) or (x0 >= 2602 and x0 <= 2608) or (x0 >= 2610 and x0 <= 2611) or (x0 >= 2613 and x0 <= 2614) or (x0 >= 2616 and x0 <= 2617) or (x0 >= 2649 and x0 <= 2652) or x0 === 2654 or (x0 >= 2674 and x0 <= 2676) or (x0 >= 2693 and x0 <= 2701) or (x0 >= 2703 and x0 <= 2705) or (x0 >= 2707 and x0 <= 2728) or (x0 >= 2730 and x0 <= 2736) or (x0 >= 2738 and x0 <= 2739) or (x0 >= 2741 and x0 <= 2745) or x0 === 2749 or x0 === 2768 or (x0 >= 2784 and x0 <= 2785) or x0 === 2809 or (x0 >= 2821 and x0 <= 2828) or (x0 >= 2831 and x0 <= 2832) or (x0 >= 2835 and x0 <= 2856) or (x0 >= 2858 and x0 <= 2864) or (x0 >= 2866 and x0 <= 2867) or (x0 >= 2869 and x0 <= 2873) or x0 === 2877 or (x0 >= 2908 and x0 <= 2909) or (x0 >= 2911 and x0 <= 2913) or x0 === 2929 or x0 === 2947 or (x0 >= 2949 and x0 <= 2954) or (x0 >= 2958 and x0 <= 2960) or (x0 >= 2962 and x0 <= 2965) or (x0 >= 2969 and x0 <= 2970) or x0 === 2972 or (x0 >= 2974 and x0 <= 2975) or (x0 >= 2979 and x0 <= 2980) or (x0 >= 2984 and x0 <= 2986) or (x0 >= 2990 and x0 <= 3001) or x0 === 3024 or (x0 >= 3077 and x0 <= 3084) or (x0 >= 3086 and x0 <= 3088) or (x0 >= 3090 and x0 <= 3112) or (x0 >= 3114 and x0 <= 3129) or x0 === 3133 or (x0 >= 3160 and x0 <= 3162) or (x0 >= 3168 and x0 <= 3169) or x0 === 3200 or (x0 >= 3205 and x0 <= 3212) or (x0 >= 3214 and x0 <= 3216) or (x0 >= 3218 and x0 <= 3240) or (x0 >= 3242 and x0 <= 3251) or (x0 >= 3253 and x0 <= 3257) or x0 === 3261 or x0 === 3294 or (x0 >= 3296 and x0 <= 3297) or (x0 >= 3313 and x0 <= 3314) or (x0 >= 3332 and x0 <= 3340) or (x0 >= 3342 and x0 <= 3344) or (x0 >= 3346 and x0 <= 3386) or x0 === 3389 or x0 === 3406 or (x0 >= 3412 and x0 <= 3414) or (x0 >= 3423 and x0 <= 3425) or (x0 >= 3450 and x0 <= 3455) or (x0 >= 3461 and x0 <= 3478) or (x0 >= 3482 and x0 <= 3505) or (x0 >= 3507 and x0 <= 3515) or x0 === 3517 or (x0 >= 3520 and x0 <= 3526) or (x0 >= 3585 and x0 <= 3632) or (x0 >= 3634 and x0 <= 3635) or (x0 >= 3648 and x0 <= 3654) or (x0 >= 3713 and x0 <= 3714) or x0 === 3716 or (x0 >= 3718 and x0 <= 3722) or (x0 >= 3724 and x0 <= 3747) or x0 === 3749 or (x0 >= 3751 and x0 <= 3760) or (x0 >= 3762 and x0 <= 3763) or x0 === 3773 or (x0 >= 3776 and x0 <= 3780) or x0 === 3782 or (x0 >= 3804 and x0 <= 3807) or x0 === 3840 or (x0 >= 3904 and x0 <= 3911) or (x0 >= 3913 and x0 <= 3948) or (x0 >= 3976 and x0 <= 3980) or (x0 >= 4096 and x0 <= 4138) or x0 === 4159 or (x0 >= 4176 and x0 <= 4181) or (x0 >= 4186 and x0 <= 4189) or x0 === 4193 or (x0 >= 4197 and x0 <= 4198) or (x0 >= 4206 and x0 <= 4208) or (x0 >= 4213 and x0 <= 4225) or x0 === 4238 or (x0 >= 4304 and x0 <= 4346) or (x0 >= 4348 and x0 <= 4680) or (x0 >= 4682 and x0 <= 4685) or (x0 >= 4688 and x0 <= 4694) or x0 === 4696 or (x0 >= 4698 and x0 <= 4701) or (x0 >= 4704 and x0 <= 4744) or (x0 >= 4746 and x0 <= 4749) or (x0 >= 4752 and x0 <= 4784) or (x0 >= 4786 and x0 <= 4789) or (x0 >= 4792 and x0 <= 4798) or x0 === 4800 or (x0 >= 4802 and x0 <= 4805) or (x0 >= 4808 and x0 <= 4822) or (x0 >= 4824 and x0 <= 4880) or (x0 >= 4882 and x0 <= 4885) or (x0 >= 4888 and x0 <= 4954) or (x0 >= 4992 and x0 <= 5007) or (x0 >= 5112 and x0 <= 5117) or (x0 >= 5121 and x0 <= 5740) or (x0 >= 5743 and x0 <= 5759) or (x0 >= 5761 and x0 <= 5786) or (x0 >= 5792 and x0 <= 5866) or (x0 >= 5870 and x0 <= 5880) or (x0 >= 5888 and x0 <= 5900) or (x0 >= 5902 and x0 <= 5905) or (x0 >= 5920 and x0 <= 5937) or (x0 >= 5952 and x0 <= 5969) or (x0 >= 5984 and x0 <= 5996) or (x0 >= 5998 and x0 <= 6000) or (x0 >= 6016 and x0 <= 6067) or x0 === 6103 or x0 === 6108 or (x0 >= 6176 and x0 <= 6264) or (x0 >= 6272 and x0 <= 6312) or x0 === 6314 or (x0 >= 6320 and x0 <= 6389) or (x0 >= 6400 and x0 <= 6430) or (x0 >= 6480 and x0 <= 6509) or (x0 >= 6512 and x0 <= 6516) or (x0 >= 6528 and x0 <= 6571) or (x0 >= 6576 and x0 <= 6601) or (x0 >= 6656 and x0 <= 6678) or (x0 >= 6688 and x0 <= 6740) or x0 === 6823 or (x0 >= 6917 and x0 <= 6963) or (x0 >= 6981 and x0 <= 6987) or (x0 >= 7043 and x0 <= 7072) or (x0 >= 7086 and x0 <= 7087) or (x0 >= 7098 and x0 <= 7141) or (x0 >= 7168 and x0 <= 7203) or (x0 >= 7245 and x0 <= 7247) or (x0 >= 7258 and x0 <= 7293) or (x0 >= 7296 and x0 <= 7304) or (x0 >= 7401 and x0 <= 7404) or (x0 >= 7406 and x0 <= 7411) or (x0 >= 7413 and x0 <= 7414) or x0 === 7418 or (x0 >= 7424 and x0 <= 7615) or (x0 >= 7681 and x0 <= 7957) or (x0 >= 7968 and x0 <= 7975) or (x0 >= 7984 and x0 <= 7991) or (x0 >= 8000 and x0 <= 8005) or (x0 >= 8016 and x0 <= 8023) or (x0 >= 8032 and x0 <= 8061) or (x0 >= 8064 and x0 <= 8071) or (x0 >= 8080 and x0 <= 8087) or (x0 >= 8096 and x0 <= 8103) or (x0 >= 8112 and x0 <= 8116) or (x0 >= 8118 and x0 <= 8119) or x0 === 8126 or (x0 >= 8130 and x0 <= 8132) or (x0 >= 8134 and x0 <= 8135) or (x0 >= 8144 and x0 <= 8147) or (x0 >= 8150 and x0 <= 8151) or (x0 >= 8160 and x0 <= 8167) or (x0 >= 8178 and x0 <= 8180) or (x0 >= 8182 and x0 <= 8183) or x0 === 8305 or x0 === 8319 or (x0 >= 8336 and x0 <= 8348) or x0 === 8458 or (x0 >= 8462 and x0 <= 8463) or x0 === 8467 or x0 === 8472 or (x0 >= 8494 and x0 <= 8505) or (x0 >= 8508 and x0 <= 8509) or (x0 >= 8518 and x0 <= 8521) or x0 === 8526 or (x0 >= 8544 and x0 <= 8578) or (x0 >= 8580 and x0 <= 8584) or (x0 >= 11312 and x0 <= 11358) or (x0 >= 11361 and x0 <= 11492) or (x0 >= 11500 and x0 <= 11502) or x0 === 11507 or (x0 >= 11520 and x0 <= 11557) or x0 === 11559 or x0 === 11565 or (x0 >= 11568 and x0 <= 11623) or x0 === 11631 or (x0 >= 11648 and x0 <= 11670) or (x0 >= 11680 and x0 <= 11686) or (x0 >= 11688 and x0 <= 11694) or (x0 >= 11696 and x0 <= 11702) or (x0 >= 11704 and x0 <= 11710) or (x0 >= 11712 and x0 <= 11718) or (x0 >= 11720 and x0 <= 11726) or (x0 >= 11728 and x0 <= 11734) or (x0 >= 11736 and x0 <= 11742) or (x0 >= 12293 and x0 <= 12295) or (x0 >= 12321 and x0 <= 12329) or (x0 >= 12337 and x0 <= 12341) or (x0 >= 12344 and x0 <= 12348) or (x0 >= 12353 and x0 <= 12438) or (x0 >= 12443 and x0 <= 12447) or (x0 >= 12449 and x0 <= 12538) or (x0 >= 12540 and x0 <= 12543) or (x0 >= 12549 and x0 <= 12591) or (x0 >= 12593 and x0 <= 12686) or (x0 >= 12704 and x0 <= 12735) or (x0 >= 12784 and x0 <= 12799) or (x0 >= 13312 and x0 <= 19903) or (x0 >= 19968 and x0 <= 40956) or (x0 >= 40960 and x0 <= 42124) or (x0 >= 42192 and x0 <= 42237) or (x0 >= 42240 and x0 <= 42508) or (x0 >= 42512 and x0 <= 42527) or (x0 >= 42538 and x0 <= 42539) or (x0 >= 42561 and x0 <= 42606) or x0 === 42623 or x0 === 42625 or x0 === 42627 or x0 === 42629 or x0 === 42631 or x0 === 42633 or x0 === 42635 or x0 === 42637 or x0 === 42639 or x0 === 42641 or x0 === 42643 or x0 === 42645 or x0 === 42647 or x0 === 42649 or (x0 >= 42651 and x0 <= 42653) or (x0 >= 42656 and x0 <= 42735) or (x0 >= 42775 and x0 <= 42783) or (x0 >= 42787 and x0 <= 42888) or (x0 >= 42892 and x0 <= 42943) or (x0 >= 42947 and x0 <= 42954) or (x0 >= 42998 and x0 <= 43009) or (x0 >= 43011 and x0 <= 43013) or (x0 >= 43015 and x0 <= 43018) or (x0 >= 43020 and x0 <= 43042) or (x0 >= 43072 and x0 <= 43123) or (x0 >= 43138 and x0 <= 43187) or (x0 >= 43250 and x0 <= 43255) or x0 === 43259 or (x0 >= 43261 and x0 <= 43262) or (x0 >= 43274 and x0 <= 43301) or (x0 >= 43312 and x0 <= 43334) or (x0 >= 43360 and x0 <= 43388) or (x0 >= 43396 and x0 <= 43442) or x0 === 43471 or (x0 >= 43488 and x0 <= 43492) or (x0 >= 43494 and x0 <= 43503) or (x0 >= 43514 and x0 <= 43518) or (x0 >= 43520 and x0 <= 43560) or (x0 >= 43584 and x0 <= 43586) or (x0 >= 43588 and x0 <= 43595) or (x0 >= 43616 and x0 <= 43638) or x0 === 43642 or (x0 >= 43646 and x0 <= 43695) or x0 === 43697 or (x0 >= 43701 and x0 <= 43702) or (x0 >= 43705 and x0 <= 43709) or x0 === 43712 or x0 === 43714 or (x0 >= 43739 and x0 <= 43741) or (x0 >= 43744 and x0 <= 43754) or (x0 >= 43762 and x0 <= 43764) or (x0 >= 43777 and x0 <= 43782) or (x0 >= 43785 and x0 <= 43790) or (x0 >= 43793 and x0 <= 43798) or (x0 >= 43808 and x0 <= 43814) or (x0 >= 43816 and x0 <= 43822) or (x0 >= 43824 and x0 <= 43866) or (x0 >= 43868 and x0 <= 43881) or (x0 >= 43888 and x0 <= 44002) or (x0 >= 44032 and x0 <= 55203) or (x0 >= 55216 and x0 <= 55238) or (x0 >= 55243 and x0 <= 55291) or (x0 >= 63744 and x0 <= 64109) or (x0 >= 64112 and x0 <= 64217) or (x0 >= 64256 and x0 <= 64262) or (x0 >= 64275 and x0 <= 64279) or x0 === 64285 or (x0 >= 64287 and x0 <= 64296) or (x0 >= 64298 and x0 <= 64310) or (x0 >= 64312 and x0 <= 64316) or x0 === 64318 or (x0 >= 64320 and x0 <= 64321) or (x0 >= 64323 and x0 <= 64324) or (x0 >= 64326 and x0 <= 64433) or (x0 >= 64467 and x0 <= 64829) or (x0 >= 64848 and x0 <= 64911) or (x0 >= 64914 and x0 <= 64967) or (x0 >= 65008 and x0 <= 65019) or (x0 >= 65136 and x0 <= 65140) or (x0 >= 65142 and x0 <= 65276) or (x0 >= 65345 and x0 <= 65370) or (x0 >= 65382 and x0 <= 65470) or (x0 >= 65474 and x0 <= 65479) or (x0 >= 65482 and x0 <= 65487) or (x0 >= 65490 and x0 <= 65495) or (x0 >= 65498 and x0 <= 65500) or (x0 >= 65536 and x0 <= 65547) or (x0 >= 65549 and x0 <= 65574) or (x0 >= 65576 and x0 <= 65594) or (x0 >= 65596 and x0 <= 65597) or (x0 >= 65599 and x0 <= 65613) or (x0 >= 65616 and x0 <= 65629) or (x0 >= 65664 and x0 <= 65786) or (x0 >= 65856 and x0 <= 65908) or (x0 >= 66176 and x0 <= 66204) or (x0 >= 66208 and x0 <= 66256) or (x0 >= 66304 and x0 <= 66335) or (x0 >= 66349 and x0 <= 66378) or (x0 >= 66384 and x0 <= 66421) or (x0 >= 66432 and x0 <= 66461) or (x0 >= 66464 and x0 <= 66499) or (x0 >= 66504 and x0 <= 66511) or (x0 >= 66513 and x0 <= 66517) or (x0 >= 66600 and x0 <= 66717) or (x0 >= 66776 and x0 <= 66811) or (x0 >= 66816 and x0 <= 66855) or (x0 >= 66864 and x0 <= 66915) or (x0 >= 67072 and x0 <= 67382) or (x0 >= 67392 and x0 <= 67413) or (x0 >= 67424 and x0 <= 67431) or (x0 >= 67584 and x0 <= 67589) or x0 === 67592 or (x0 >= 67594 and x0 <= 67637) or (x0 >= 67639 and x0 <= 67640) or x0 === 67644 or (x0 >= 67647 and x0 <= 67669) or (x0 >= 67680 and x0 <= 67702) or (x0 >= 67712 and x0 <= 67742) or (x0 >= 67808 and x0 <= 67826) or (x0 >= 67828 and x0 <= 67829) or (x0 >= 67840 and x0 <= 67861) or (x0 >= 67872 and x0 <= 67897) or (x0 >= 67968 and x0 <= 68023) or (x0 >= 68030 and x0 <= 68031) or x0 === 68096 or (x0 >= 68112 and x0 <= 68115) or (x0 >= 68117 and x0 <= 68119) or (x0 >= 68121 and x0 <= 68149) or (x0 >= 68192 and x0 <= 68220) or (x0 >= 68224 and x0 <= 68252) or (x0 >= 68288 and x0 <= 68295) or (x0 >= 68297 and x0 <= 68324) or (x0 >= 68352 and x0 <= 68405) or (x0 >= 68416 and x0 <= 68437) or (x0 >= 68448 and x0 <= 68466) or (x0 >= 68480 and x0 <= 68497) or (x0 >= 68608 and x0 <= 68680) or (x0 >= 68800 and x0 <= 68850) or (x0 >= 68864 and x0 <= 68899) or (x0 >= 69248 and x0 <= 69289) or (x0 >= 69296 and x0 <= 69297) or (x0 >= 69376 and x0 <= 69404) or x0 === 69415 or (x0 >= 69424 and x0 <= 69445) or (x0 >= 69552 and x0 <= 69572) or (x0 >= 69600 and x0 <= 69622) or (x0 >= 69635 and x0 <= 69687) or (x0 >= 69763 and x0 <= 69807) or (x0 >= 69840 and x0 <= 69864) or (x0 >= 69891 and x0 <= 69926) or x0 === 69956 or x0 === 69959 or (x0 >= 69968 and x0 <= 70002) or x0 === 70006 or (x0 >= 70019 and x0 <= 70066) or (x0 >= 70081 and x0 <= 70084) or x0 === 70106 or x0 === 70108 or (x0 >= 70144 and x0 <= 70161) or (x0 >= 70163 and x0 <= 70187) or (x0 >= 70272 and x0 <= 70278) or x0 === 70280 or (x0 >= 70282 and x0 <= 70285) or (x0 >= 70287 and x0 <= 70301) or (x0 >= 70303 and x0 <= 70312) or (x0 >= 70320 and x0 <= 70366) or (x0 >= 70405 and x0 <= 70412) or (x0 >= 70415 and x0 <= 70416) or (x0 >= 70419 and x0 <= 70440) or (x0 >= 70442 and x0 <= 70448) or (x0 >= 70450 and x0 <= 70451) or (x0 >= 70453 and x0 <= 70457) or x0 === 70461 or x0 === 70480 or (x0 >= 70493 and x0 <= 70497) or (x0 >= 70656 and x0 <= 70708) or (x0 >= 70727 and x0 <= 70730) or (x0 >= 70751 and x0 <= 70753) or (x0 >= 70784 and x0 <= 70831) or (x0 >= 70852 and x0 <= 70853) or x0 === 70855 or (x0 >= 71040 and x0 <= 71086) or (x0 >= 71128 and x0 <= 71131) or (x0 >= 71168 and x0 <= 71215) or x0 === 71236 or (x0 >= 71296 and x0 <= 71338) or x0 === 71352 or (x0 >= 71424 and x0 <= 71450) or (x0 >= 71680 and x0 <= 71723) or (x0 >= 71872 and x0 <= 71903) or (x0 >= 71935 and x0 <= 71942) or x0 === 71945 or (x0 >= 71948 and x0 <= 71955) or (x0 >= 71957 and x0 <= 71958) or (x0 >= 71960 and x0 <= 71983) or x0 === 71999 or x0 === 72001 or (x0 >= 72096 and x0 <= 72103) or (x0 >= 72106 and x0 <= 72144) or x0 === 72161 or x0 === 72163 or x0 === 72192 or (x0 >= 72203 and x0 <= 72242) or x0 === 72250 or x0 === 72272 or (x0 >= 72284 and x0 <= 72329) or x0 === 72349 or (x0 >= 72384 and x0 <= 72440) or (x0 >= 72704 and x0 <= 72712) or (x0 >= 72714 and x0 <= 72750) or x0 === 72768 or (x0 >= 72818 and x0 <= 72847) or (x0 >= 72960 and x0 <= 72966) or (x0 >= 72968 and x0 <= 72969) or (x0 >= 72971 and x0 <= 73008) or x0 === 73030 or (x0 >= 73056 and x0 <= 73061) or (x0 >= 73063 and x0 <= 73064) or (x0 >= 73066 and x0 <= 73097) or x0 === 73112 or (x0 >= 73440 and x0 <= 73458) or x0 === 73648 or (x0 >= 73728 and x0 <= 74649) or (x0 >= 74752 and x0 <= 74862) or (x0 >= 74880 and x0 <= 75075) or (x0 >= 77824 and x0 <= 78894) or (x0 >= 82944 and x0 <= 83526) or (x0 >= 92160 and x0 <= 92728) or (x0 >= 92736 and x0 <= 92766) or (x0 >= 92880 and x0 <= 92909) or (x0 >= 92928 and x0 <= 92975) or (x0 >= 92992 and x0 <= 92995) or (x0 >= 93027 and x0 <= 93047) or (x0 >= 93053 and x0 <= 93071) or (x0 >= 93792 and x0 <= 93823) or (x0 >= 93952 and x0 <= 94026) or x0 === 94032 or (x0 >= 94099 and x0 <= 94111) or (x0 >= 94176 and x0 <= 94177) or x0 === 94179 or (x0 >= 94208 and x0 <= 100_343) or (x0 >= 100_352 and x0 <= 101_589) or (x0 >= 101_632 and x0 <= 101_640) or (x0 >= 110_592 and x0 <= 110_878) or (x0 >= 110_928 and x0 <= 110_930) or (x0 >= 110_948 and x0 <= 110_951) or (x0 >= 110_960 and x0 <= 111_355) or (x0 >= 113_664 and x0 <= 113_770) or (x0 >= 113_776 and x0 <= 113_788) or (x0 >= 113_792 and x0 <= 113_800) or (x0 >= 113_808 and x0 <= 113_817) or (x0 >= 119_834 and x0 <= 119_892) or (x0 >= 119_894 and x0 <= 119_911) or (x0 >= 119_938 and x0 <= 119_963) or (x0 >= 119_990 and x0 <= 119_993) or x0 === 119_995 or (x0 >= 119_997 and x0 <= 120_003) or (x0 >= 120_005 and x0 <= 120_015) or (x0 >= 120_042 and x0 <= 120_067) or (x0 >= 120_094 and x0 <= 120_119) or (x0 >= 120_146 and x0 <= 120_171) or (x0 >= 120_198 and x0 <= 120_223) or (x0 >= 120_250 and x0 <= 120_275) or (x0 >= 120_302 and x0 <= 120_327) or (x0 >= 120_354 and x0 <= 120_379) or (x0 >= 120_406 and x0 <= 120_431) or (x0 >= 120_458 and x0 <= 120_485) or (x0 >= 120_514 and x0 <= 120_538) or (x0 >= 120_540 and x0 <= 120_545) or (x0 >= 120_572 and x0 <= 120_596) or (x0 >= 120_598 and x0 <= 120_603) or (x0 >= 120_630 and x0 <= 120_654) or (x0 >= 120_656 and x0 <= 120_661) or (x0 >= 120_688 and x0 <= 120_712) or (x0 >= 120_714 and x0 <= 120_719) or (x0 >= 120_746 and x0 <= 120_770) or (x0 >= 120_772 and x0 <= 120_777) or x0 === 120_779 or (x0 >= 123_136 and x0 <= 123_180) or (x0 >= 123_191 and x0 <= 123_197) or x0 === 123_214 or (x0 >= 123_584 and x0 <= 123_627) or (x0 >= 124_928 and x0 <= 125_124) or (x0 >= 125_218 and x0 <= 125_251) or x0 === 125_259 or (x0 >= 126_464 and x0 <= 126_467) or (x0 >= 126_469 and x0 <= 126_495) or (x0 >= 126_497 and x0 <= 126_498) or x0 === 126_500 or x0 === 126_503 or (x0 >= 126_505 and x0 <= 126_514) or (x0 >= 126_516 and x0 <= 126_519) or x0 === 126_521 or x0 === 126_523 or x0 === 126_530 or x0 === 126_535 or x0 === 126_537 or x0 === 126_539 or (x0 >= 126_541 and x0 <= 126_543) or (x0 >= 126_545 and x0 <= 126_546) or x0 === 126_548 or x0 === 126_551 or x0 === 126_553 or x0 === 126_555 or x0 === 126_557 or x0 === 126_559 or (x0 >= 126_561 and x0 <= 126_562) or x0 === 126_564 or (x0 >= 126_567 and x0 <= 126_570) or (x0 >= 126_572 and x0 <= 126_578) or (x0 >= 126_580 and x0 <= 126_583) or (x0 >= 126_585 and x0 <= 126_588) or x0 === 126_590 or (x0 >= 126_592 and x0 <= 126_601) or (x0 >= 126_603 and x0 <= 126_619) or (x0 >= 126_625 and x0 <= 126_627) or (x0 >= 126_629 and x0 <= 126_633) or (x0 >= 126_635 and x0 <= 126_651) or (x0 >= 131_072 and x0 <= 173_789) or (x0 >= 173_824 and x0 <= 177_972) or (x0 >= 177_984 and x0 <= 178_205) or (x0 >= 178_208 and x0 <= 183_969) or (x0 >= 183_984 and x0 <= 191_456) or (x0 >= 194_560 and x0 <= 195_101) or (x0 >= 196_608 and x0 <= 201_546) do variable_start_chars__1( rest, [x0] ++ acc, stack, context, comb__line, comb__offset + byte_size(<>) ) end def variable_start_chars__0(rest, _acc, _stack, context, line, offset) do {:error, "expected variable start", rest, context, line, offset} end def variable_start_chars__1(rest, acc, _stack, context, line, offset) do {:ok, acc, rest, context, line, offset} end end makeup_elixir-0.16.1/lib/makeup/lexers/elixir_lexer/variables.ex.exs000066400000000000000000000021701441250767100255750ustar00rootroot00000000000000defmodule Makeup.Lexers.ElixirLexer.Variables do @moduledoc false # parsec:Makeup.Lexers.ElixirLexer.Variables # This module is generated at "dev time" so that the lexer # doesn't have to depend on the (excellent) `unicode_set` library, # which takes several minutes to compile. import NimbleParsec variable_start_unicode_syntax = "[[:L:][:Nl:][:Other_ID_Start:]-[:Pattern_Syntax:]-[:Pattern_White_Space:]-[:Lu:]-[:Lt:][_]]" variable_continue_unicode_syntax = "[[:ID_Start:][:Mn:][:Mc:][:Nd:][:Pc:][:Other_ID_Continue:]-[:Pattern_Syntax:]-[:Pattern_White_Space:]]" # TODO: Why do we need to flatten these lists? A bug in `unicode_set`? variable_start_chars = Unicode.Set.to_utf8_char(variable_start_unicode_syntax) |> List.flatten() variable_continue_chars = Unicode.Set.to_utf8_char(variable_continue_unicode_syntax) |> List.flatten() defcombinator(:variable_start_chars, label(utf8_char(variable_start_chars), "variable start")) defcombinator( :variable_continue_chars, label(utf8_char(variable_continue_chars), "variable continue") ) # parsec:Makeup.Lexers.ElixirLexer.Variables end makeup_elixir-0.16.1/mix.exs000066400000000000000000000034231441250767100157640ustar00rootroot00000000000000defmodule MakeupElixir.Mixfile do use Mix.Project @version "0.16.1" @url "https://github.com/elixir-makeup/makeup_elixir" def project do [ app: :makeup_elixir, version: @version, elixir: "~> 1.6", start_permanent: Mix.env() == :prod, deps: deps(), package: package(), description: description(), aliases: aliases() ] end defp description do """ Elixir lexer for the Makeup syntax highlighter. """ end defp package do [ name: :makeup_elixir, licenses: ["BSD"], maintainers: ["Tiago Barroso "], links: %{"GitHub" => @url} ] end # Run "mix help compile.app" to learn about applications. def application do [ extra_applications: [], mod: {Makeup.Lexers.ElixirLexer.Application, []} ] end # Run "mix help deps" to learn about dependencies. defp deps do [ {:makeup, "~> 1.0"}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3"}, # Generate unicode character lists {:unicode_set, "~> 1.1.0", only: :dev}, # Benchmarking utilities {:benchee, "~> 1.0", only: :dev}, {:benchee_markdown, "~> 0.2", only: :dev} ] end defp aliases do [ docs: &build_docs/1, publish: "run scripts/publish.exs" ] end defp build_docs(_) do Mix.Task.run("compile") ex_doc = Path.join(Mix.path_for(:escripts), "ex_doc") unless File.exists?(ex_doc) do raise "cannot build docs because escript for ex_doc is not installed" end args = ["MakeupElixir", @version, Mix.Project.compile_path()] opts = ~w[--main Makeup.Lexers.ElixirLexer --source-ref v#{@version} --source-url #{@url}] System.cmd(ex_doc, args ++ opts) Mix.shell().info("Docs built successfully") end end makeup_elixir-0.16.1/mix.lock000066400000000000000000000041051441250767100161130ustar00rootroot00000000000000%{ "benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"}, "benchee_markdown": {:hex, :benchee_markdown, "0.3.1", "9d08a81ae217722ba65ade422b39dfb932cc14d96a2047c44dd30b025bbbb8b7", [:mix], [{:benchee, ">= 1.1.0 and < 2.0.0", [hex: :benchee, repo: "hexpm", optional: false]}], "hexpm", "6274a076e8bd51b192e957b6a7de957b4a1bbb5583892ea3673e0808f658bf5f"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, "nimble_parsec": {:hex, :nimble_parsec, "1.3.0", "9e18a119d9efc3370a3ef2a937bf0b24c088d9c4bf0ba9d7c3751d49d347d035", [:mix], [], "hexpm", "7977f183127a7cbe9346981e2f480dc04c55ffddaef746bd58debd566070eef8"}, "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, "unicode": {:hex, :unicode, "1.16.0", "48277a9300abece59f56136a5c461109a9c22c2e6e1b08e73befc32dd2ab18de", [:mix], [], "hexpm", "1c35bf6ab209dc4041ac3b894e0c519c1cd5988ed5690d788cfef883c6939551"}, "unicode_set": {:hex, :unicode_set, "1.1.0", "32971b9b8061f2b2f0c607ba588ad9a6202e78a0c577555df4da899fd4434f23", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:unicode, "~> 1.13", [hex: :unicode, repo: "hexpm", optional: false]}], "hexpm", "b416e7b18d1297bbdc25c05e56506291e8fd3f339b8386d4e1f6ddb57c047918"}, } makeup_elixir-0.16.1/scripts/000077500000000000000000000000001441250767100161335ustar00rootroot00000000000000makeup_elixir-0.16.1/scripts/publish.exs000066400000000000000000000121521441250767100203230ustar00rootroot00000000000000defmodule Releaser.VersionUtils do @doc """ Some utilities to get and set version numbers in the `mix.exs` file and to programmatically transform version numbers. Maybe the `bump_*` functions should be in the standard library? This script doesn't support pre-release versions or versions with build information. """ @version_line_regex ~r/(\n\s*@version\s+")([^"\n]+)("\n)/ def bump_major(%Version{} = version) do %{version | major: version.major + 1, minor: 0, patch: 0} end def bump_minor(%Version{} = version) do %{version | minor: version.minor + 1, patch: 0} end def bump_patch(%Version{} = version) do %{version | patch: version.patch + 1} end def version_to_string(%Version{} = version) do "#{version.major}.#{version.minor}.#{version.patch}" end def get_version() do # Remove Windows-style line endings config = "mix.exs" |> File.read!() |> String.replace("\r", "") case Regex.run(@version_line_regex, config) do [_line, _pre, version, _post] -> Version.parse!(version) _ -> raise "Invalid project version in your mix.exs file" end end def set_version(version) do contents = File.read!("mix.exs") version_string = version_to_string(version) replaced = Regex.replace(@version_line_regex, contents, fn _, pre, _version, post -> "#{pre}#{version_string}#{post}" end) File.write!("mix.exs", replaced) end def update_version(%Version{} = version, "major"), do: bump_major(version) def update_version(%Version{} = version, "minor"), do: bump_minor(version) def update_version(%Version{} = version, "patch"), do: bump_patch(version) def update_version(%Version{} = _version, type), do: raise("Invalid version type: #{type}") end defmodule Releaser.Changelog do @doc """ Functions to append entries to the changelog. """ alias Releaser.VersionUtils @release_filename "RELEASE.md" @release_type_regex ~r/^(RELEASE_TYPE:\s+)(\w+)(.*)/s @changelog_filename "CHANGELOG.md" @changelog_entry_header_level 3 @changelog_entries_marker "\n\n" def remove_release_file() do File.rm!(@release_filename) end def extract_release_type() do # Remove Windows line endings contents = @release_filename |> File.read!() |> String.replace("\r", "") {type, text} = case Regex.run(@release_type_regex, contents) |> IO.inspect() do [_line, _pre, type, text] -> {type, String.trim(text)} _ -> raise "Invalid project version in your mix.exs file" end {type, text} end def changelog_entry(%Version{} = version, %DateTime{} = date_time, text) do header_prefix = String.duplicate("#", @changelog_entry_header_level) version_string = VersionUtils.version_to_string(version) date_time_string = date_time |> DateTime.truncate(:second) |> NaiveDateTime.to_string() """ #{header_prefix} #{version_string} - #{date_time_string} #{text} """ end def add_changelog_entry(entry) do contents = @changelog_filename |> File.read!() |> String.replace("\r", "") [first, last] = String.split(contents, @changelog_entries_marker) replaced = Enum.join([ first, @changelog_entries_marker, entry, last ]) File.write!(@changelog_filename, replaced) end end defmodule Releaser.Git do @doc """ This module contains some git-specific functionality """ alias Releaser.VersionUtils def add_commit_and_tag(version) do version_string = VersionUtils.version_to_string(version) Mix.Shell.IO.cmd("git add .", []) Mix.Shell.IO.cmd(~s'git commit -m "Bumped version number"') Mix.Shell.IO.cmd(~s'git tag -a v#{version_string} -m "Version #{version_string}"') end end defmodule Releaser.Tests do def run_tests!() do error_code = Mix.Shell.IO.cmd("mix test", []) if error_code != 0 do raise "This version can't be released because tests are failing." end :ok end end defmodule Releaser do alias Releaser.VersionUtils alias Releaser.Changelog alias Releaser.Git alias Releaser.Tests alias Releaser.Publish def run() do # Run the tests before generating the release. # If any test fails, stop. Tests.run_tests!() # Get the current version from the mix.exs file. version = VersionUtils.get_version() # Extract the changelog entry and add it to the changelog. # Use the information in the RELEASE.md file to bump the version number. {release_type, text} = Changelog.extract_release_type() new_version = VersionUtils.update_version(version, release_type) entry = Changelog.changelog_entry(new_version, DateTime.utc_now(), text) Changelog.add_changelog_entry(entry) # Set a new version on the mix.exs file VersionUtils.set_version(new_version) # Commit the changes and ad a new 'v*.*.*' tag Git.add_commit_and_tag(new_version) # Now that we have committed the changes, we can remove the release file Changelog.remove_release_file() end end # Generate a new release Releaser.run() makeup_elixir-0.16.1/test/000077500000000000000000000000001441250767100154235ustar00rootroot00000000000000makeup_elixir-0.16.1/test/generators/000077500000000000000000000000001441250767100175745ustar00rootroot00000000000000makeup_elixir-0.16.1/test/generators/elixir_lexer/000077500000000000000000000000001441250767100222675ustar00rootroot00000000000000makeup_elixir-0.16.1/test/generators/elixir_lexer/elixir_lexer_group_test_generator.exs000066400000000000000000000044141441250767100320270ustar00rootroot00000000000000defmodule Makeup.Test.Generators.ElixirLexer.ElixirLexerGroupTestGenerator do require EEx import Makeup.Lexers.ElixirLexer.Testing, only: [lex: 1] def indent(text, n) do text |> String.split("\n") |> Enum.map(fn line -> String.duplicate(" ", n) <> line end) |> Enum.join("\n") |> String.trim_leading() end EEx.function_from_string( :def, :gen_group_test_file, """ defmodule <%= @name %> do # The tests need to be checked manually!!! (remove this line when they've been checked) use ExUnit.Case, async: true import Makeup.Lexers.ElixirLexer.Testing, only: [lex: 1] alias Makeup.Lexer describe "all group transitions" do\ <%= for {name1, fun1} <- @funs do %><%= for {name2, fun2} <- @funs do %> test "`<%= name1 %>` + `<%= name2 %>`" do\ <% input = fun1.(fun2.("x")) output = input |> lex() |> inspect |> Code.format_string! |> Enum.join |> indent(6) %> code = <%= inspect(input) %> assert lex(code) == <%= output %> assert code |> lex() |> Lexer.unlex() == code end<% end %><% end %> end end """, [:assigns] ) def funs do [ {"do ... end", fn s -> "do #{s} end" end}, {"do ... else ... end", fn s -> "do #{s} else #{s} end" end}, {"fn ... end", fn s -> "fn -> #{s} end" end}, {"(...)", fn s -> "(#{s})" end}, {"[...]", fn s -> "[#{s}]" end}, {"{...}", fn s -> "{#{s}}" end}, {"%{...}", fn s -> "%{#{s}}" end}, {"%Struct{...}", fn s -> "%Struct{#{s}}" end}, # Extra whitespace in order to avoid syntax errors with the bitwise operators {"#OpaqueStruct<...>", fn s -> "#OpaqueStruct< #{s} >" end}, # Extra whitespace for the same reason # TODO: find a better way to fix this without requiring the whitespace {"<<...>>", fn s -> "<< #{s} >>" end} ] end def run() do content = gen_group_test_file( funs: funs(), name: "Makeup.Lexers.ElixirLexer.ElixirLexerGroupsTest" ) filename = "test/makeup/lexers/elixir_lexer/elixir_lexer_groups_test.exs" File.write!(filename, content) IO.puts("Done.") end end Makeup.Test.Generators.ElixirLexer.ElixirLexerGroupTestGenerator.run() makeup_elixir-0.16.1/test/makeup/000077500000000000000000000000001441250767100167055ustar00rootroot00000000000000makeup_elixir-0.16.1/test/makeup/lexers/000077500000000000000000000000001441250767100202075ustar00rootroot00000000000000makeup_elixir-0.16.1/test/makeup/lexers/elixir_lexer/000077500000000000000000000000001441250767100227025ustar00rootroot00000000000000makeup_elixir-0.16.1/test/makeup/lexers/elixir_lexer/elixir_lexer_groups_test.exs000066400000000000000000002000001441250767100305440ustar00rootroot00000000000000defmodule Makeup.Lexers.ElixirLexer.ElixirLexerGroupsTest do # The tests need to be checked manually!!! (remove this line when they've been checked) use ExUnit.Case, async: true import Makeup.Lexers.ElixirLexer.Testing, only: [lex: 1] alias Makeup.Lexer describe "all group transitions" do test "`do ... end` + `do ... end`" do code = "do do x end end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... end` + `do ... else ... end`" do code = "do do x else x end end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... end` + `fn ... end`" do code = "do fn -> x end end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... end` + `(...)`" do code = "do (x) end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... end` + `[...]`" do code = "do [x] end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... end` + `{...}`" do code = "do {x} end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... end` + `%{...}`" do code = "do %{x} end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... end` + `%Struct{...}`" do code = "do %Struct{x} end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... end` + `#OpaqueStruct<...>`" do code = "do #OpaqueStruct< x > end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... end` + `<<...>>`" do code = "do << x >> end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `do ... end`" do code = "do do x end else do x end end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-3"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-3"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `do ... else ... end`" do code = "do do x else x end else do x else x end end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-3"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-3"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-3"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `fn ... end`" do code = "do fn -> x end else fn -> x end end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-3"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-3"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `(...)`" do code = "do (x) else (x) end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-3"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-3"}, ")"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `[...]`" do code = "do [x] else [x] end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-3"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-3"}, "]"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `{...}`" do code = "do {x} else {x} end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-3"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-3"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `%{...}`" do code = "do %{x} else %{x} end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-3"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-3"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `%Struct{...}`" do code = "do %Struct{x} else %Struct{x} end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-3"}, "%"}, {:name_class, %{group_id: "group-3"}, "Struct"}, {:punctuation, %{group_id: "group-3"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-3"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `#OpaqueStruct<...>`" do code = "do #OpaqueStruct< x > else #OpaqueStruct< x > end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-3"}, "#"}, {:name_class, %{group_id: "group-3"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-3"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-3"}, ">"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`do ... else ... end` + `<<...>>`" do code = "do << x >> else << x >> end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "do"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "else"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-3"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-3"}, ">>"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `do ... end`" do code = "fn -> do x end end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `do ... else ... end`" do code = "fn -> do x else x end end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `fn ... end`" do code = "fn -> fn -> x end end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `(...)`" do code = "fn -> (x) end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `[...]`" do code = "fn -> [x] end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `{...}`" do code = "fn -> {x} end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `%{...}`" do code = "fn -> %{x} end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `%Struct{...}`" do code = "fn -> %Struct{x} end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `#OpaqueStruct<...>`" do code = "fn -> #OpaqueStruct< x > end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`fn ... end` + `<<...>>`" do code = "fn -> << x >> end" assert lex(code) == [ {:keyword, %{group_id: "group-1"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-1"}, "end"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `do ... end`" do code = "(do x end)" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `do ... else ... end`" do code = "(do x else x end)" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `fn ... end`" do code = "(fn -> x end)" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `(...)`" do code = "((x))" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `[...]`" do code = "([x])" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `{...}`" do code = "({x})" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `%{...}`" do code = "(%{x})" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `%Struct{...}`" do code = "(%Struct{x})" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `#OpaqueStruct<...>`" do code = "(#OpaqueStruct< x >)" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`(...)` + `<<...>>`" do code = "(<< x >>)" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "("}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `do ... end`" do code = "[do x end]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `do ... else ... end`" do code = "[do x else x end]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `fn ... end`" do code = "[fn -> x end]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `(...)`" do code = "[(x)]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `[...]`" do code = "[[x]]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `{...}`" do code = "[{x}]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `%{...}`" do code = "[%{x}]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `%Struct{...}`" do code = "[%Struct{x}]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `#OpaqueStruct<...>`" do code = "[#OpaqueStruct< x >]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`[...]` + `<<...>>`" do code = "[<< x >>]" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "["}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:punctuation, %{group_id: "group-1"}, "]"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `do ... end`" do code = "{do x end}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `do ... else ... end`" do code = "{do x else x end}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `fn ... end`" do code = "{fn -> x end}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `(...)`" do code = "{(x)}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `[...]`" do code = "{[x]}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `{...}`" do code = "{{x}}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `%{...}`" do code = "{%{x}}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `%Struct{...}`" do code = "{%Struct{x}}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `#OpaqueStruct<...>`" do code = "{#OpaqueStruct< x >}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`{...}` + `<<...>>`" do code = "{<< x >>}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `do ... end`" do code = "%{do x end}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `do ... else ... end`" do code = "%{do x else x end}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `fn ... end`" do code = "%{fn -> x end}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `(...)`" do code = "%{(x)}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `[...]`" do code = "%{[x]}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `{...}`" do code = "%{{x}}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `%{...}`" do code = "%{%{x}}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `%Struct{...}`" do code = "%{%Struct{x}}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `#OpaqueStruct<...>`" do code = "%{#OpaqueStruct< x >}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%{...}` + `<<...>>`" do code = "%{<< x >>}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `do ... end`" do code = "%Struct{do x end}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `do ... else ... end`" do code = "%Struct{do x else x end}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `fn ... end`" do code = "%Struct{fn -> x end}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `(...)`" do code = "%Struct{(x)}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `[...]`" do code = "%Struct{[x]}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `{...}`" do code = "%Struct{{x}}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `%{...}`" do code = "%Struct{%{x}}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `%Struct{...}`" do code = "%Struct{%Struct{x}}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `#OpaqueStruct<...>`" do code = "%Struct{#OpaqueStruct< x >}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`%Struct{...}` + `<<...>>`" do code = "%Struct{<< x >>}" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "%"}, {:name_class, %{group_id: "group-1"}, "Struct"}, {:punctuation, %{group_id: "group-1"}, "{"}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:punctuation, %{group_id: "group-1"}, "}"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `do ... end`" do code = "#OpaqueStruct< do x end >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `do ... else ... end`" do code = "#OpaqueStruct< do x else x end >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `fn ... end`" do code = "#OpaqueStruct< fn -> x end >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `(...)`" do code = "#OpaqueStruct< (x) >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `[...]`" do code = "#OpaqueStruct< [x] >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `{...}`" do code = "#OpaqueStruct< {x} >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `%{...}`" do code = "#OpaqueStruct< %{x} >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `%Struct{...}`" do code = "#OpaqueStruct< %Struct{x} >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `#OpaqueStruct<...>`" do code = "#OpaqueStruct< #OpaqueStruct< x > >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`#OpaqueStruct<...>` + `<<...>>`" do code = "#OpaqueStruct< << x >> >" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `do ... end`" do code = "<< do x end >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `do ... else ... end`" do code = "<< do x else x end >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "do"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "else"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `fn ... end`" do code = "<< fn -> x end >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "fn"}, {:whitespace, %{}, " "}, {:operator, %{}, "->"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:keyword, %{group_id: "group-2"}, "end"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `(...)`" do code = "<< (x) >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "("}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, ")"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `[...]`" do code = "<< [x] >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "["}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "]"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `{...}`" do code = "<< {x} >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `%{...}`" do code = "<< %{x} >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `%Struct{...}`" do code = "<< %Struct{x} >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "%"}, {:name_class, %{group_id: "group-2"}, "Struct"}, {:punctuation, %{group_id: "group-2"}, "{"}, {:name, %{}, "x"}, {:punctuation, %{group_id: "group-2"}, "}"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `#OpaqueStruct<...>`" do code = "<< #OpaqueStruct< x > >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "#"}, {:name_class, %{group_id: "group-2"}, "OpaqueStruct"}, {:punctuation, %{group_id: "group-2"}, "<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end test "`<<...>>` + `<<...>>`" do code = "<< << x >> >>" assert lex(code) == [ {:punctuation, %{group_id: "group-1"}, "<<"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, "<<"}, {:whitespace, %{}, " "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-2"}, ">>"}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, ">>"} ] assert code |> lex() |> Lexer.unlex() == code end end end makeup_elixir-0.16.1/test/makeup/lexers/elixir_lexer/elixir_lexer_tokenizer_test.exs000066400000000000000000000562271441250767100312630ustar00rootroot00000000000000defmodule ElixirLexerTokenizerTestSnippet do use ExUnit.Case, async: false import Makeup.Lexers.ElixirLexer.Testing, only: [lex: 1] test "?\\f is recognized as whitespace character" do assert lex("\f") == [{:whitespace, %{}, "\f"}] end test "builtins" do # is a builtin and not an unused variable! assert lex("_") == [{:name_builtin_pseudo, %{}, "_"}] end test "newlines" do assert lex("1+\n2") == [ {:number_integer, %{}, "1"}, {:operator, %{}, "+"}, {:whitespace, %{}, "\n"}, {:number_integer, %{}, "2"} ] assert lex("1+\r\n2") == [ {:number_integer, %{}, "1"}, {:operator, %{}, "+"}, {:whitespace, %{}, "\r\n"}, {:number_integer, %{}, "2"} ] end test "unused variables" do assert lex("_123") == [{:comment, %{}, "_123"}] assert lex("_a") == [{:comment, %{}, "_a"}] assert lex("_unused") == [{:comment, %{}, "_unused"}] end describe "iex prompt" do test "parses iex prompt correctly (first line)" do assert lex("iex>") == [{:generic_prompt, %{selectable: false}, "iex>"}] assert lex("iex(1)>") == [{:generic_prompt, %{selectable: false}, "iex(1)>"}] assert lex("iex(12)>") == [{:generic_prompt, %{selectable: false}, "iex(12)>"}] end test "accepts correct iex prompt (continuation)" do assert lex("...>") == [{:generic_prompt, %{selectable: false}, "...>"}] end test "parses iex prompt with extra space" do assert lex("iex> ") == [{:generic_prompt, %{selectable: false}, "iex> "}] assert lex("iex(1)> ") == [{:generic_prompt, %{selectable: false}, "iex(1)> "}] assert lex("...(12)> ") == [{:generic_prompt, %{selectable: false}, "...(12)> "}] end test "parses multiline iex prompt correctly" do source = """ iex> x = [ ...> key: ...> "value" ...> ] """ assert lex(source) == [ {:generic_prompt, %{selectable: false}, "iex> "}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:operator, %{}, "="}, {:whitespace, %{}, " "}, {:punctuation, %{group_id: "group-1"}, "["}, {:whitespace, %{}, "\n"}, {:generic_prompt, %{selectable: false}, "...> "}, {:whitespace, %{}, " "}, {:string_symbol, %{}, "key"}, {:punctuation, %{}, ":"}, {:whitespace, %{}, "\n"}, {:generic_prompt, %{selectable: false}, "...> "}, {:whitespace, %{}, " "}, {:string, %{}, "\"value\""}, {:whitespace, %{}, "\n"}, {:generic_prompt, %{selectable: false}, "...> "}, {:punctuation, %{group_id: "group-1"}, "]"}, {:whitespace, %{}, "\n"} ] end test "rejects incomplete iex prompt (first line)" do # missing the `>` assert lex("iex") == [{:name, %{}, "iex"}] # with number but missing the `>` assert lex("iex(8)") == [ {:name, %{}, "iex"}, {:punctuation, %{group_id: "group-1"}, "("}, {:number_integer, %{}, "8"}, {:punctuation, %{group_id: "group-1"}, ")"} ] # missing the number assert lex("iex()>") == [ {:name, %{}, "iex"}, {:punctuation, %{group_id: "group-1"}, "("}, {:punctuation, %{group_id: "group-1"}, ")"}, {:operator, %{}, ">"} ] end test "rejects incomplete iex prompt (continuation)" do # missing the `>` assert lex("...") == [{:name, %{}, "..."}] # missing the `>` assert lex("...<") == [{:name, %{}, "..."}, {:operator, %{}, "<"}] end test "iex prompt must start a new line" do assert lex("x iex>") == [ {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:name, %{}, "iex"}, {:operator, %{}, ">"} ] assert lex("x iex(1)>") == [ {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:name, %{}, "iex"}, {:punctuation, %{group_id: "group-1"}, "("}, {:number_integer, %{}, "1"}, {:punctuation, %{group_id: "group-1"}, ")"}, {:operator, %{}, ">"} ] assert lex("x ...>") == [ {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:name, %{}, "..."}, {:operator, %{}, ">"} ] assert lex("x ...(1)>") == [ {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:name, %{}, "..."}, {:punctuation, %{group_id: "group-1"}, "("}, {:number_integer, %{}, "1"}, {:punctuation, %{group_id: "group-1"}, ")"}, {:operator, %{}, ">"} ] end test "iex prompt works when previous line has trailing whitespace" do assert lex("x \niex> ") == [ {:name, %{}, "x"}, {:whitespace, %{}, " \n"}, {:generic_prompt, %{selectable: false}, "iex> "}, ] assert lex("x \r\niex> ") == [ {:name, %{}, "x"}, {:whitespace, %{}, " \r\n"}, {:generic_prompt, %{selectable: false}, "iex> "}, ] end end describe "def-like macros" do test "normal function/macro definition" do assert lex("def f") == [ {:keyword_declaration, %{}, "def"}, {:whitespace, %{}, " "}, {:name_function, %{}, "f"} ] assert lex("defp g") == [ {:keyword_declaration, %{}, "defp"}, {:whitespace, %{}, " "}, {:name_function, %{}, "g"} ] assert lex("defguard h") == [ {:keyword_declaration, %{}, "defguard"}, {:whitespace, %{}, " "}, {:name_function, %{}, "h"} ] end test "operator definition" do # Must not highlight the first argument! assert lex("def a + b") == [ {:keyword_declaration, %{}, "def"}, {:whitespace, %{}, " "}, {:name, %{}, "a"}, {:whitespace, %{}, " "}, {:operator, %{}, "+"}, {:whitespace, %{}, " "}, {:name, %{}, "b"} ] assert lex("defp a - b") == [ {:keyword_declaration, %{}, "defp"}, {:whitespace, %{}, " "}, {:name, %{}, "a"}, {:whitespace, %{}, " "}, {:operator, %{}, "-"}, {:whitespace, %{}, " "}, {:name, %{}, "b"} ] assert lex("defguard a <<< b") == [ {:keyword_declaration, %{}, "defguard"}, {:whitespace, %{}, " "}, {:name, %{}, "a"}, {:whitespace, %{}, " "}, {:operator, %{}, "<<<"}, {:whitespace, %{}, " "}, {:name, %{}, "b"} ] end end describe "anonymous functions" do test "accepts anonymous function argument" do assert lex("&1") == [{:name_entity, %{}, "&1"}] assert lex("&2") == [{:name_entity, %{}, "&2"}] assert lex("&666") == [{:name_entity, %{}, "&666"}] end test "rejects incorrect anonymous function argument" do assert lex("&p") == [{:operator, %{}, "&"}, {:name, %{}, "p"}] assert lex("&!") == [{:operator, %{}, "&"}, {:operator, %{}, "!"}] assert lex("&,") == [{:operator, %{}, "&"}, {:punctuation, %{}, ","}] end test "anonymous function with arguments" do assert lex("&(&1)") == [ {:operator, %{}, "&"}, {:punctuation, %{group_id: "group-1"}, "("}, {:name_entity, %{}, "&1"}, {:punctuation, %{group_id: "group-1"}, ")"} ] assert lex("&(&1, &2)") == [ {:operator, %{}, "&"}, {:punctuation, %{group_id: "group-1"}, "("}, {:name_entity, %{}, "&1"}, {:punctuation, %{}, ","}, {:whitespace, %{}, " "}, {:name_entity, %{}, "&2"}, {:punctuation, %{group_id: "group-1"}, ")"} ] end end test "bitwise operators" do assert lex("1 >>> 2") == [ {:number_integer, %{}, "1"}, {:whitespace, %{}, " "}, {:operator, %{}, ">>>"}, {:whitespace, %{}, " "}, {:number_integer, %{}, "2"} ] assert lex("1 <<< 2") == [ {:number_integer, %{}, "1"}, {:whitespace, %{}, " "}, {:operator, %{}, "<<<"}, {:whitespace, %{}, " "}, {:number_integer, %{}, "2"} ] end describe "syntax sugar for keyword lists" do test "keys are normal atoms" do assert lex("atom: value") == [ {:string_symbol, %{}, "atom"}, {:punctuation, %{}, ":"}, {:whitespace, %{}, " "}, {:name, %{}, "value"} ] assert lex("Atom: value") == [ {:string_symbol, %{}, "Atom"}, {:punctuation, %{}, ":"}, {:whitespace, %{}, " "}, {:name, %{}, "value"} ] assert lex("atom@host: value") == [ {:string_symbol, %{}, "atom@host"}, {:punctuation, %{}, ":"}, {:whitespace, %{}, " "}, {:name, %{}, "value"} ] end test "keys are string-like atomes" do assert lex(~S["atom": value]) == [ {:string_symbol, %{}, "\"atom\""}, {:punctuation, %{}, ":"}, {:whitespace, %{}, " "}, {:name, %{}, "value"} ] assert lex(~S["!a-b?c": value]) == [ {:string_symbol, %{}, "\"!a-b?c\""}, {:punctuation, %{}, ":"}, {:whitespace, %{}, " "}, {:name, %{}, "value"} ] assert lex(~S["\n\s\t": value]) == [ {:string_symbol, %{}, "\""}, {:string_escape, %{}, "\\n"}, {:string_escape, %{}, "\\s"}, {:string_escape, %{}, "\\t"}, {:string_symbol, %{}, "\""}, {:punctuation, %{}, ":"}, {:whitespace, %{}, " "}, {:name, %{}, "value"} ] end end describe "declarations" do test "defmodule" do assert lex("defmodule MyModule") == [ {:keyword_declaration, %{}, "defmodule"}, {:whitespace, %{}, " "}, {:name_class, %{}, "MyModule"} ] end test "def, defmacro, etc. - no function name" do assert lex("def") == [{:keyword_declaration, %{}, "def"}] assert lex("defp") == [{:keyword_declaration, %{}, "defp"}] assert lex("defmacro") == [{:keyword_declaration, %{}, "defmacro"}] assert lex("defmacrop") == [{:keyword_declaration, %{}, "defmacrop"}] assert lex("defimpl") == [{:keyword_declaration, %{}, "defimpl"}] end end describe "atoms" do test "normal atoms" do assert lex(":atom") == [{:string_symbol, %{}, ":atom"}] end test "normal atoms - '@' character is valid in the middle or at the end" do assert lex(":atom@somewhere") == [{:string_symbol, %{}, ":atom@somewhere"}] assert lex(":atom@@@atom") == [{:string_symbol, %{}, ":atom@@@atom"}] assert lex(":atom@@@atom@@") == [{:string_symbol, %{}, ":atom@@@atom@@"}] end test "normal atoms - '@' character is not valid at the beginning" do assert lex(":@atom") == [ {:punctuation, %{}, ":"}, {:name_attribute, %{}, "@atom"} ] end test "string-like atoms" do assert lex(~S[:"a!&;//"]) == [{:string_symbol, %{}, ~S[:"a!&;//"]}] assert lex(~S[:'a!&;//']) == [{:string_symbol, %{}, ~S[:'a!&;//']}] end test "triple colon" do assert lex(":::") === [{:string_symbol, %{}, ":::"}] end test "operator names" do assert lex(":+") === [{:string_symbol, %{}, ":+"}] assert lex(":..") === [{:string_symbol, %{}, ":.."}] end test "special atom names" do assert lex(":...") === [{:string_symbol, %{}, ":..."}] assert lex(":%{}") === [{:string_symbol, %{}, ":%{}"}] end test "atoms used as modules are highlighted as modules" do assert lex(":crypto.strong_rand_bytes(4)") === [ {:name_class, %{}, ":crypto"}, {:operator, %{}, "."}, {:name, %{}, "strong_rand_bytes"}, {:punctuation, %{group_id: "group-1"}, "("}, {:number_integer, %{}, "4"}, {:punctuation, %{group_id: "group-1"}, ")"} ] end end describe "numbers" do end describe "stacktrace" do test "raw" do # real error from a `mix docs` task (some problem when interfacing with node) assert lex(""" ** (ErlangError) Erlang error: :eacces erlang.erl:2112: :erlang.open_port({:spawn_executable, 'c:/Program Files/nodejs/npm.cmd'}, [:use_stdio, :exit_status, :binary, :hide, {:args, ["run", "docs"]}]) (elixir) lib/system.ex:629: System.cmd/3 (mix) lib/mix/task.ex:353: Mix.Task.run_alias/3 (mix) lib/mix/task.ex:277: Mix.Task.run/2 (mix) lib/mix/cli.ex:80: Mix.CLI.run_task/2 (elixir) lib/code.ex:677: Code.require_file/2\ """) == [ {:generic_traceback, %{}, """ ** (ErlangError) Erlang error: :eacces erlang.erl:2112: :erlang.open_port({:spawn_executable, 'c:/Program Files/nodejs/npm.cmd'}, [:use_stdio, :exit_status, :binary, :hide, {:args, ["run", "docs"]}]) (elixir) lib/system.ex:629: System.cmd/3 (mix) lib/mix/task.ex:353: Mix.Task.run_alias/3 (mix) lib/mix/task.ex:277: Mix.Task.run/2 (mix) lib/mix/cli.ex:80: Mix.CLI.run_task/2 (elixir) lib/code.ex:677: Code.require_file/2\ """} ] end test "inside iex" do assert lex(""" iex> raise_error ** (ErlangError) Erlang error: :eacces erlang.erl:2112: :erlang.open_port({:spawn_executable, :error}) (elixir) lib/system.ex:629: System.cmd/3 iex> 1 + 2 3 """) == [ {:generic_prompt, %{selectable: false}, "iex> "}, {:name, %{}, "raise_error"}, {:whitespace, %{}, "\n"}, {:generic_traceback, %{}, """ ** (ErlangError) Erlang error: :eacces erlang.erl:2112: :erlang.open_port({:spawn_executable, :error}) (elixir) lib/system.ex:629: System.cmd/3\ """}, {:whitespace, %{}, "\n"}, {:generic_prompt, %{selectable: false}, "iex> "}, {:number_integer, %{}, "1"}, {:whitespace, %{}, " "}, {:operator, %{}, "+"}, {:whitespace, %{}, " "}, {:number_integer, %{}, "2"}, {:whitespace, %{}, "\n"}, {:number_integer, %{}, "3"}, {:whitespace, %{}, "\n"} ] end end @sigil_delimiters [ {~S["""], ~S["""]}, {"'''", "'''"}, {"\"", "\""}, {"'", "'"}, {"/", "/"}, {"{", "}"}, {"[", "]"}, {"(", ")"}, {"<", ">"}, {"|", "|"} ] # A subset of `@sigil_delimiters` @string_like_delimiters [ {~S["""], ~S["""]}, {"'''", "'''"}, {"\"", "\""}, {"'", "'"} ] describe "interpolation" do test "sigils with interpolation (lowercase letters)" do for b <- ?a..?z do for {llim, rlim} <- @sigil_delimiters do left = "~#{<>}#{llim}x" middle = "\#{y}" right = "z#{rlim}" sigil = left <> middle <> right assert [ {sigil_tag, %{}, ^left}, {:string_interpol, %{group_id: "group-1"}, "\#{"}, {:name, %{}, "y"}, {:string_interpol, %{group_id: "group-1"}, "}"}, {sigil_tag, %{}, ^right} ] = lex(sigil) end end end test "sigils without interpolation (uppercase letter)" do for b <- ?A..?Z do for {llim, rlim} <- @sigil_delimiters, {llim, rlim} != {"{", "}"} do sigil = "~#{<>}#{llim}x\#{y}z#{rlim}" assert [{_sigil_tag, %{}, ^sigil}] = lex(sigil) end end end end test "calendar sigils" do assert lex("~D[2020-01-01]") == [{:literal_date, %{}, "~D[2020-01-01]"}] assert lex("~T[01:23:45]") == [{:literal_date, %{}, "~T[01:23:45]"}] assert lex("~N[2020-01-01 01:23:45]") == [{:literal_date, %{}, "~N[2020-01-01 01:23:45]"}] assert lex("~U[2020-01-01 01:23:45Z]") == [{:literal_date, %{}, "~U[2020-01-01 01:23:45Z]"}] end describe "strings and sigils" do test "unicode codepoints" do assert lex(~S["\u0000"]) == [ {:string, %{}, "\""}, {:string_escape, %{}, "\\u0000"}, {:string, %{}, "\""} ] # Uppercase decimal digits are allowed assert lex(~S["\ua1B2"]) == [ {:string, %{}, "\""}, {:string_escape, %{}, "\\ua1B2"}, {:string, %{}, "\""} ] assert lex(~S["X\ua1B2Y"]) == [ {:string, %{}, "\"X"}, {:string_escape, %{}, "\\ua1B2"}, {:string, %{}, "Y\""} ] end end test "iex prompt inside string" do code = """ iex> a = " ...> ine1 ...> line2 ...> ilne3 ...> " """ assert lex(code) == [ {:generic_prompt, %{selectable: false}, "iex> "}, {:name, %{}, "a"}, {:whitespace, %{}, " "}, {:operator, %{}, "="}, {:whitespace, %{}, " "}, {:string, %{}, "\""}, {:generic_prompt, %{selectable: false}, "\n...> "}, {:string, %{}, "ine1"}, {:generic_prompt, %{selectable: false}, "\n...> "}, {:string, %{}, "line2"}, {:generic_prompt, %{selectable: false}, "\n...> "}, {:string, %{}, "ilne3"}, {:generic_prompt, %{selectable: false}, "\n...> "}, {:string, %{}, "\""}, {:whitespace, %{}, "\n"} ] end # Generalization of the above test "iex prompt inside strings, charlists and heredocs" do for prompt_number <- ["", "(1)", "(22)"] do for {ldelim, rdelim} <- @string_like_delimiters do code = ~s''' iex#{prompt_number}> x = #{ldelim} ...#{prompt_number}> line1 ...#{prompt_number}> line2 ...#{prompt_number}> line3 ...#{prompt_number}> #{rdelim} ''' first_prompt = "iex#{prompt_number}> " other_prompt = "\n...#{prompt_number}> " assert [ {:generic_prompt, %{selectable: false}, ^first_prompt}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:operator, %{}, "="}, {:whitespace, %{}, " "}, {ttype, %{}, ^ldelim}, {:generic_prompt, %{selectable: false}, ^other_prompt}, {ttype, %{}, "line1"}, {:generic_prompt, %{selectable: false}, ^other_prompt}, {ttype, %{}, "line2"}, {:generic_prompt, %{selectable: false}, ^other_prompt}, {ttype, %{}, "line3"}, {:generic_prompt, %{selectable: false}, ^other_prompt}, {ttype, %{}, ^rdelim}, {:whitespace, %{}, "\n"} ] = lex(code) end end end test "iex prompt inside sigils (not strings, charlists or heredocs)" do lowercase = Enum.map(?a..?z, fn c -> <<"~", c>> end) uppercase = Enum.map(?A..?Z, fn c -> <<"~", c>> end) sigil_prefixes = lowercase ++ uppercase for prompt_number <- ["", "(1)", "(22)"] do for {ldelim, rdelim} <- @sigil_delimiters do for sigil_prefix <- sigil_prefixes do code = ~s''' iex#{prompt_number}> x = #{sigil_prefix}#{ldelim} ...#{prompt_number}> line1 ...#{prompt_number}> line2 ...#{prompt_number}> line3 ...#{prompt_number}> #{rdelim} ''' first_prompt = "iex#{prompt_number}> " other_prompt = "\n...#{prompt_number}> " sigil_start = sigil_prefix <> ldelim assert [ {:generic_prompt, %{selectable: false}, ^first_prompt}, {:name, %{}, "x"}, {:whitespace, %{}, " "}, {:operator, %{}, "="}, {:whitespace, %{}, " "}, {ttype, %{}, ^sigil_start}, {:generic_prompt, %{selectable: false}, ^other_prompt}, {ttype, %{}, "line1"}, {:generic_prompt, %{selectable: false}, ^other_prompt}, {ttype, %{}, "line2"}, {:generic_prompt, %{selectable: false}, ^other_prompt}, {ttype, %{}, "line3"}, {:generic_prompt, %{selectable: false}, ^other_prompt}, {ttype, %{}, ^rdelim}, {:whitespace, %{}, "\n"} ] = lex(code) end end end end test "PIDs" do assert lex("#PID<0.489.0>") == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "PID"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:number_integer, %{}, "0"}, {:operator, %{}, "."}, {:number_integer, %{}, "489"}, {:operator, %{}, "."}, {:number_integer, %{}, "0"}, {:punctuation, %{group_id: "group-1"}, ">"} ] assert lex("#PID<112.489.940>") == [ {:punctuation, %{group_id: "group-1"}, "#"}, {:name_class, %{group_id: "group-1"}, "PID"}, {:punctuation, %{group_id: "group-1"}, "<"}, {:number_integer, %{}, "112"}, {:operator, %{}, "."}, {:number_integer, %{}, "489"}, {:operator, %{}, "."}, {:number_integer, %{}, "940"}, {:punctuation, %{group_id: "group-1"}, ">"} ] end test "unicode variables" do assert lex("josé = 'awesome'") == [ {:name, %{}, "josé"}, {:whitespace, %{}, " "}, {:operator, %{}, "="}, {:whitespace, %{}, " "}, {:string_char, %{}, "'awesome'"} ] end test "unicode atoms" do assert lex(":josé@home") == [{:string_symbol, %{}, ":josé@home"}] end test "triple dot is a special name" do assert lex("...") == [{:name, %{}, "..."}] end test "map" do assert lex("%{:a => 1}") == [ {:punctuation, %{group_id: "group-1"}, "%{"}, {:string_symbol, %{}, ":a"}, {:whitespace, %{}, " "}, {:punctuation, %{}, "=>"}, {:whitespace, %{}, " "}, {:number_integer, %{}, "1"}, {:punctuation, %{group_id: "group-1"}, "}"} ] end end makeup_elixir-0.16.1/test/makeup/lexers/elixir_lexer/registry_test.exs000066400000000000000000000011501441250767100263270ustar00rootroot00000000000000defmodule Makeup.Lexers.ElixirLexer.RegistryTest do use ExUnit.Case, async: true alias Makeup.Registry alias Makeup.Lexers.ElixirLexer describe "the elixir lexer has successfully registered itself:" do test "language name" do assert {:ok, {ElixirLexer, []}} == Registry.fetch_lexer_by_name("elixir") assert {:ok, {ElixirLexer, []}} == Registry.fetch_lexer_by_name("iex") end test "file extension" do assert {:ok, {ElixirLexer, []}} == Registry.fetch_lexer_by_extension("exs") assert {:ok, {ElixirLexer, []}} == Registry.fetch_lexer_by_extension("ex") end end end makeup_elixir-0.16.1/test/test_helper.exs000066400000000000000000000000411441250767100204550ustar00rootroot00000000000000ExUnit.start(timeout: :infinity)