Metadata-Version: 2.5
Name: lupaxa-lupe
Version: 0.1.0
Summary: A small general-purpose interpreted scripting language for learning how languages are designed and executed.
Project-URL: Homepage, https://github.com/lupaxa-after-hours/lupe
Project-URL: Documentation, https://lupe.thelupaxaproject.org/
Project-URL: Repository, https://github.com/lupaxa-after-hours/lupe
Project-URL: Issues, https://github.com/lupaxa-after-hours/lupe/issues
Author: The Lupaxa Project
License: MIT License
        
        Copyright (c) The Lupaxa Project
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENCE
Keywords: education,interpreter,lupe,scripting-language
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Education
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Interpreters
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: bump-my-version>=1.2.0; extra == 'dev'
Requires-Dist: hatch>=1.12.0; extra == 'dev'
Requires-Dist: mkdocs-material==9.7.7; extra == 'dev'
Requires-Dist: mkdocs==1.6.1; extra == 'dev'
Requires-Dist: mypy>=1.12.0; extra == 'dev'
Requires-Dist: pip-audit>=2.7.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest-cov>=5.0; extra == 'test'
Requires-Dist: pytest>=8.0; extra == 'test'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://github.com/lupaxa-after-hours">
    <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/organisations/after-hours/readme-logo.png" alt="After Hours" />
  </a>
</p>

<h1 align="center">Lupe</h1>

Lupe is a small interpreted scripting language for learning how a language
is designed and run. Scripts use the `.lupe` extension. The reference
interpreter is this Python package: a handwritten lexer, a recursive-descent
parser, and a tree-walking interpreter.

A script is ordinary text. Blank lines and indentation are insignificant,
and a block ends with `end`.

## Install

```bash
pip install lupaxa-lupe
```

Requires Python 3.11 or newer. The standard library is enough.

From a checkout of this repository:

```bash
pip install -e ".[dev]"
```

## Run

`lupe`, `lupaxa-lupe`, and `python -m lupaxa.lupe` are the same program.

```bash
lupe run hello.lupe
lupe check hello.lupe
lupe tokens hello.lupe
lupe ast hello.lupe
lupe repl
lupe --version
```

`run` executes a file. `check` parses it and stops. `tokens` and `ast`
print the two stages before execution. `repl` keeps names between lines
and prints the value of a line that is only an expression.

### Shebang

A file may start with `#!/usr/bin/env lupe`. Once `lupe` is on `PATH`, the
shell runs that file the same way it runs a shell script. The kernel invokes
`lupe` with the script path and any arguments that follow it.
`examples/hello.lupe` is this program:

```lupe
#!/usr/bin/env lupe

let name = input("Enter your name: ")
print "Hello, " + name
```

```bash
chmod +x hello.lupe
./hello.lupe
```

`lupe hello.lupe` is the same direct form. Arguments after the file name
are the script's arguments.

### Script Arguments

`args()` returns those arguments. `lupe run` takes them after `--`.

```bash
./hello.lupe first second
lupe hello.lupe first second
lupe run hello.lupe -- first second
```

## Documentation

`mkdocs/` holds Getting Started, Usage, the Reference, Examples, and
Internals. The published site is <https://lupe.thelupaxaproject.org/>.

<a href="https://github.com/the-lupaxa-project">
    <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/components/footer-for-child-orgs.svg" alt="The Lupaxa Project Footer" width="100%" />
</a>
