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 use of # character in Racket lexer #1472

Merged
merged 10 commits into from Apr 2, 2020
8 changes: 8 additions & 0 deletions lib/rouge/lexers/racket.rb
Expand Up @@ -488,6 +488,7 @@ def self.builtins
state :root do
# comments
rule %r/;.*$/, Comment::Single
rule %r/#\|/, Comment::Multiline, :comment
rule %r/\s+/m, Text

rule %r/[+-]inf[.][f0]/, Num::Float
Expand Down Expand Up @@ -524,6 +525,13 @@ def self.builtins
rule id, Name::Variable
end

state :comment do
rule %r/[^|#]+/, Comment::Multiline
rule %r/\|#/, Comment::Multiline, :pop!
rule %r/#\|/, Comment::Multiline, :comment
rule %r/[|#]/, Comment::Multiline
pyrmont marked this conversation as resolved.
Show resolved Hide resolved
end

state :command do
rule id, Name::Function do |m|
if self.class.keywords.include? m[0]
Expand Down