diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ce6418d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + +jobs: + test: + runs-on: ubuntu-20.04 + env: + MIX_ENV: test + strategy: + fail-fast: false + matrix: + include: + - elixir: "1.12" + otp: "22" + - elixir: "1.18" + otp: "27" + lint: lint + steps: + - uses: actions/checkout@v4 + + - uses: erlef/setup-elixir@v1 + with: + otp-version: ${{matrix.otp}} + elixir-version: ${{matrix.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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7c366ef..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -sudo: false -language: elixir - -elixir: '1.10' -otp_release: '22.0' - -stages: - - check formatted - - test - -jobs: - include: - - stage: check formatted - script: mix format --check-formatted - - - stage: test - - - elixir: 1.4 - otp_release: 19.3 - - elixir: 1.9 - otp_release: 20.3 - - elixir: 1.9 - otp_release: 21.3 - - elixir: 1.10 - otp_release: 22.0 diff --git a/lib/makeup_c.ex b/lib/makeup_c.ex index 9567cd3..33f7f64 100644 --- a/lib/makeup_c.ex +++ b/lib/makeup_c.ex @@ -76,7 +76,7 @@ defmodule Makeup.Lexers.CLexer do operator_name = word_from_list(~W( -> + - * / % ++ -- ~ ^ & && | || = += -= *= /= &= |= %= ^= << >> - <<= >>= > < >= <= == != ! ? : + <<= >>= > < >= <= == != ! ? : )) operator = token(operator_name, :operator) @@ -104,7 +104,7 @@ defmodule Makeup.Lexers.CLexer do delimiters_punctuation = word_from_list( - ~W( ( \) [ ] { }), + ~W| ( ) [ ] { }|, :punctuation ) @@ -242,16 +242,16 @@ defmodule Makeup.Lexers.CLexer do ################################################################### @keyword ~W[ - alignas alignoif asm atomic_cancel atomic_commit - atomic_noexcept auto break case catch class co_await - co_return co_yield compl concept const const_cast - constexpr continue decltype default delete do dynamic_cast - else enum explicit export extern for friend goto if - import inline module mutable namespace new noexcept - nullptr operator private protected public register - reinterpret_cast requires return sizeof static static_assert - static_cast struct switch synchronized template this - thread_local throw try typedef typeid typename union + alignas alignoif asm atomic_cancel atomic_commit + atomic_noexcept auto break case catch class co_await + co_return co_yield compl concept const const_cast + constexpr continue decltype default delete do dynamic_cast + else enum explicit export extern for friend goto if + import inline module mutable namespace new noexcept + nullptr operator private protected public register + reinterpret_cast requires return sizeof static static_assert + static_cast struct switch synchronized template this + thread_local throw try typedef typeid typename union using virtual volatile while ] diff --git a/mix.exs b/mix.exs index dffd464..dbf50fa 100644 --- a/mix.exs +++ b/mix.exs @@ -8,13 +8,11 @@ defmodule MakeupC.MixProject do [ app: :makeup_c, version: @version, - elixir: "~> 1.4", + elixir: "~> 1.12", start_permanent: Mix.env() == :prod, deps: deps(), - # Package package: package(), description: description(), - # aliases: aliases(), docs: docs() ] end @@ -46,7 +44,7 @@ defmodule MakeupC.MixProject do defp deps do [ {:makeup, "~> 1.0"}, - {:ex_doc, ">= 0.0.0", only: [:dev, :docs]}, + {:ex_doc, ">= 0.0.0", only: [:dev, :docs]} ] end @@ -57,5 +55,4 @@ defmodule MakeupC.MixProject do main: "Makeup.Lexers.CLexer" ] end - end diff --git a/mix.lock b/mix.lock index c7fa158..2913c0b 100644 --- a/mix.lock +++ b/mix.lock @@ -1,9 +1,8 @@ %{ - "benchee": {:hex, :benchee, "0.99.0", "0efbfc31045ad2f75a48673bd1befa8a6a5855e93b8c3117aed7d7da8de65b71", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}], "hexpm", "672d8e9436471b7d5b77ca5be3ad69d065553e7ed8c5db29bb3d662378104618"}, - "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.10", "6603d7a603b9c18d3d20db69921527f82ef09990885ed7525003c7fe7dc86c56", [:mix], [], "hexpm", "8e2d5370b732385db2c9b22215c3f59c84ac7dda7ed7e544d7c459496ae519c0"}, - "ex_doc": {:hex, :ex_doc, "0.22.6", "0fb1e09a3e8b69af0ae94c8b4e4df36995d8c88d5ec7dbd35617929144b62c00", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "1e0aceda15faf71f1b0983165e6e7313be628a460e22a031e32913b98edbd638"}, - "makeup": {:hex, :makeup, "1.0.3", "e339e2f766d12e7260e6672dd4047405963c5ec99661abdc432e6ec67d29ef95", [:mix], [{:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "2e9b4996d11832947731f7608fed7ad2f9443011b3b479ae288011265cdd3dad"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.14.1", "4f0e96847c63c17841d42c08107405a005a2680eb9c7ccadfd757bd31dabccfb", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f2438b1a80eaec9ede832b5c41cd4f373b38fd7aa33e3b22d9db79e640cbde11"}, - "nimble_parsec": {:hex, :nimble_parsec, "0.6.0", "32111b3bf39137144abd7ba1cce0914533b2d16ef35e8abc5ec8be6122944263", [:mix], [], "hexpm", "27eac315a94909d4dc68bc07a4a83e06c8379237c5ea528a9acff4ca1c873c52"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.43", "34b2f401fe473080e39ff2b90feb8ddfeef7639f8ee0bbf71bb41911831d77c5", [:mix], [], "hexpm", "970a3cd19503f5e8e527a190662be2cee5d98eed1ff72ed9b3d1a3d466692de8"}, + "ex_doc": {:hex, :ex_doc, "0.37.0", "970f92b39e62c460aa8a367508e938f5e4da6e2ff3eaed3f8530b25870f45471", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "b0ee7f17373948e0cf471e59c3a0ee42f3bd1171c67d91eb3626456ef9c6202c"}, + "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, + "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, + "makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"}, }