lib/rouge/lexers/make.rb in rouge-0.1.0.rc1 vs lib/rouge/lexers/make.rb in rouge-0.1.0
- old
+ new
@@ -18,19 +18,20 @@
ifeq ifneq ifdef ifndef else endif include -include define endef :
)
line = /(?:\\.|\\\n|[^\\\n])*/m
- attr_reader :shell
def initialize(opts={})
super
@shell = Shell.new(opts)
end
+ start { @shell.reset! }
+
state :root do
rule /^(?:[\t ]+.*\n|\n)+/ do
- delegate lexer.shell
+ delegate @shell
end
# rule /\$\((?:.*\\\n|.*\n)+/ do
# delegate Shell
# end
@@ -84,17 +85,17 @@
rule /(\t[\t ]*)([@-]?)/ do |m|
group 'Text'; group 'Punctuation'
push :shell_line
end
- rule(//) { lexer.shell.reset!; pop! }
+ rule(//) { @shell.reset!; pop! }
end
state :shell do
# macro interpolation
rule /\$\(\s*[a-z_]\w*\s*\)/i, 'Name.Variable'
- rule(/.+?(?=\$\(|\)|\n)/m) { delegate lexer.shell }
- rule(/\$\(|\)|\n/) { delegate lexer.shell }
+ rule(/.+?(?=\$\(|\)|\n)/m) { delegate @shell }
+ rule(/\$\(|\)|\n/) { delegate @shell }
end
state :shell_line do
rule /\n/, 'Text', :pop!
mixin :shell