Skip to content

Commit

Permalink
Fix duplicating capture groups in Julia lexer (#1292)
Browse files Browse the repository at this point in the history
The Julia lexer includes nested capture groups and this causes text to
be duplicated on output. This commit fixes that bug.
  • Loading branch information
pyrmont committed Aug 2, 2019
1 parent b99ab3a commit a0a0823
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 464 deletions.
2 changes: 1 addition & 1 deletion lib/rouge/lexers/julia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def self.detect?(text)
end

# types
rule %r/((mutable )?struct|(abstract|primitive) type)((?:\s|\\\s)+)/ do
rule %r/((?:mutable )?struct|(?:abstract|primitive) type)((?:\s|\\\s)+)/ do
groups Keyword, Name::Class
push :typename
end
Expand Down
Loading

0 comments on commit a0a0823

Please sign in to comment.