Code

Magma RegexLexer Class Definition

In Pygments, a custom lexer for Magma can be defined as a subclass of RegexLexer named Magma. The class sets core metadata attributes, including name = 'Magma', aliases = ['magma'], and filename matching patterns filenames = ['*.m', '*.mag'].

0

1

Updated 2026-10-08

Tags

Prep Sessions

Custom Pygments Lexer Engineering for Magma @ University of Michigan - Ann Arbor

Ch.1 Magma Lexer Fundamentals - Custom Pygments Lexer Engineering for Magma @ University of Michigan - Ann Arbor

Magma RegexLexer Structure and Tokens - Custom Pygments Lexer Engineering for Magma @ University of Michigan - Ann Arbor