Skip to content

Commit

Permalink
Add support for long options to Batchfile lexer (#1626)
Browse files Browse the repository at this point in the history
The Batchfile lexer does not support 'long options' (i.e. options that
begin with --). This commit adds support for that.
  • Loading branch information
pyrmont authored Nov 10, 2020
1 parent 2e2627e commit 5a40f6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rouge/lexers/batchfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def self.attributes
state :basic do
# Comments
rule %r/@?\brem\b.*$/i, Comment

# Empty Labels
rule %r/^::.*$/, Comment

Expand All @@ -105,7 +106,7 @@ def self.attributes
end
end

rule %r/([\/\-+][a-z]+)\s*/i, Name::Attribute
rule %r/((?:[\/\+]|--?)[a-z]+)\s*/i, Name::Attribute

mixin :expansions

Expand Down
1 change: 1 addition & 0 deletions spec/visual/samples/batchfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ echo ^Hello
echo Bye
goto :eof
:a
streamlink --http-header "User-Agent: test" "https://example.com/master.m3u8" best -o output.ts

0 comments on commit 5a40f6f

Please sign in to comment.