Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors from new empty regex requirements #1606

Merged
merged 1 commit into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lib/rouge/lexers/apex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,19 @@ def self.constants
rule %r/import\b/, Keyword::Namespace, :import

rule %r/([@$.]?)(#{id})([:(]?)/io do |m|
if self.class.keywords.include? m[0].downcase
lowercased = m[0].downcase
uppercased = m[0].upcase
if self.class.keywords.include? lowercased
token Keyword
elsif self.class.soql.include? m[0].upcase
elsif self.class.soql.include? uppercased
token Keyword
elsif self.class.declarations.include? m[0].downcase
elsif self.class.declarations.include? lowercased
token Keyword::Declaration
elsif self.class.types.include? m[0].downcase
elsif self.class.types.include? lowercased
token Keyword::Type
elsif self.class.constants.include? m[0].downcase
elsif self.class.constants.include? lowercased
token Keyword::Constant
elsif m[0].downcase == 'package'
elsif lowercased == 'package'
token Keyword::Namespace
elsif m[1] == "@"
token Name::Decorator
Expand Down
2 changes: 1 addition & 1 deletion lib/rouge/lexers/email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Email < RegexLexer
state :root do
rule %r/\n/, Text
rule %r/^>.*/, Comment
rule %r/.*/, Text
rule %r/.+/, Text
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/rouge/lexers/j.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ def self.control_words_id

state :note do
mixin :delimiter
rule %r/.*\n?/, Comment::Multiline
rule %r/.+\n?/, Comment::Multiline
end

state :noun do
mixin :delimiter
rule %r/.*\n?/, Str::Heredoc
rule %r/.+\n?/, Str::Heredoc
end

state :code do
Expand Down