Open Access. Powered by Scholars. Published by Universities.®

Software Engineering

Master's Projects

Theses/Dissertations

2018

Articles 1 - 1 of 1

Full-Text Articles in Programming Languages and Compilers

Pantry: A Macro Library For Python, Derek Pang Dec 2018

Pantry: A Macro Library For Python, Derek Pang

Master's Projects

Python lacks a simple way to create custom syntax and constructs that goes outside of its own syntax rules. A paradigm that allows for these possibilities to exist within languages is macros. Macros allow for a shorter set of syntax to expand into a longer set of instructions at compile-time. This gives the capability to evolve the language to fit personal needs.

Pantry, implements a hygienic text-substitution macro system for Python. Pantry achieves this through the introduction of an additional preparsing step that utilizes parsing and lexing of the source code. Pantry proposes a way to simply declare a pattern …