File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 11# Scanner for Bash
22# Author: Petr Kovar <pejuko@gmail.com>
3- module CodeRay
4- module Scanners
3+
4+ module CodeRay module Scanners
5+
56 class Bash < Scanner
67
78 register_for :bash
@@ -84,11 +85,15 @@ def scan_tokens tokens, options
8485 elsif match = scan ( /"/ )
8586 @state = :quote
8687 @quote = match
87- tokens << [ :open , : string]
88+ tokens . begin_group : string
8889 tokens << [ match , :delimiter ]
8990 next
9091 elsif match = scan ( /`/ )
91- tokens << [ @shell ? :close : :open , :shell ]
92+ if @shell
93+ tokens . end_group :shell
94+ else
95+ tokens . begin_group :shell
96+ end
9297 @shell = ( not @shell )
9398 tokens << [ match , :delimiter ]
9499 next
@@ -165,7 +170,7 @@ def scan_tokens tokens, options
165170 kind = :content
166171 elsif match = scan ( /#{ @quote } / )
167172 tokens << [ match , :delimiter ]
168- tokens << [ :close , : string] if @quote == '"'
173+ tokens . end_group : string
169174 @quote = nil
170175 @state = :initial
171176 next
Original file line number Diff line number Diff line change 11# Scanner for Bash
22# Author: spam+github@codez.ch
3- require 'coderay/scanners/rhtml '
3+ require 'coderay/scanners/erb '
44
55module CodeRay
66 module Scanners
7- class ErbBash < RHTML
7+ class ErbBash < ERB
88 register_for :erb_bash
99
1010 protected
You can’t perform that action at this time.
0 commit comments