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

Always pick GAS Lexer for .S files #316

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions http/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,13 @@ def format_code(filename, code):
import pygments
import pygments.lexers
import pygments.formatters
from pygments.lexers.asm import GasLexer
from pygments.lexers.r import SLexer

try:
lexer = pygments.lexers.guess_lexer_for_filename(filename, code)
if filename.endswith('.S') and isinstance(lexer, SLexer):
lexer = GasLexer()
fstachura marked this conversation as resolved.
Show resolved Hide resolved
except pygments.util.ClassNotFound:
lexer = pygments.lexers.get_lexer_by_name('text')

Expand Down