lib/rouge/lexers/elixir.rb in rouge-3.2.1 vs lib/rouge/lexers/elixir.rb in rouge-3.3.0
- old
+ new
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- #
+# frozen_string_literal: true
module Rouge
module Lexers
# Direct port of pygments Lexer.
# See: https://bitbucket.org/birkenfeld/pygments-main/src/7304e4759ae65343d89a51359ca538912519cc31/pygments/lexers/functional.py?at=default#cl-2362
@@ -18,10 +19,10 @@
state :root do
rule /\s+/m, Text
rule /#.*$/, Comment::Single
rule %r{\b(case|cond|end|bc|lc|if|unless|try|loop|receive|fn|defmodule|
defp?|defprotocol|defimpl|defrecord|defmacrop?|defdelegate|
- defexception|exit|raise|throw|after|rescue|catch|else)\b(?![?!])|
+ defexception|defguardp?|defstruct|exit|raise|throw|after|rescue|catch|else)\b(?![?!])|
(?<!\.)\b(do|\-\>)\b}x, Keyword
rule /\b(import|require|use|recur|quote|unquote|super|refer)\b(?![?!])/, Keyword::Namespace
rule /(?<!\.)\b(and|not|or|when|xor|in)\b/, Operator::Word
rule %r{%=|\*=|\*\*=|\+=|\-=|\^=|\|\|=|
<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?=[\s\t])\?|