Compare commits

...

2 Commits

Author SHA1 Message Date
da997b80c7
Added demo script 2022-11-12 19:15:08 -08:00
1b951813f4
Fixed command parser 2022-11-12 19:14:58 -08:00
6 changed files with 41 additions and 12 deletions

3
.gitignore vendored
View File

@ -9,4 +9,5 @@ build
dist
# Misc
*.gif
*.gif
misc/secrets.sh

View File

@ -8,6 +8,7 @@
"mdel",
"onefile",
"Packrat",
"printables",
"pyparsing",
"rlimit",
"runstatus",

View File

@ -56,7 +56,7 @@ class LambdaParser:
(self.lp + self.pp_history + self.rp)
)
self.pp_command = pp.Suppress(":") + pp.Word(pp.alphas + "_") + pp.Word(pp.alphas + pp.nums + "_.")[0, ...]
self.pp_command = pp.Suppress(":") + pp.Word(pp.alphas + "_") + pp.Word(pp.printables)[0, ...]
self.pp_all = (

View File

@ -1,11 +1,4 @@
# How to use this:
# install vhs
# enter venv
# vhs < misc/demo.tape
#
# We need macros.lamb, so run this from
# the root of this repository.
# See makedemo.sh
#Output lambdemo.mp4
Output lambdemo.gif
@ -25,7 +18,7 @@ Enter
Sleep 2000ms
# Demo 1: load
Type ":load macros.lamb"
Type ":load ../macros.lamb"
Sleep 500ms
Enter
Sleep 2000ms

34
misc/makedemo.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
# Should be run from the misc directory.
# Will not work with any other root.
# Create this file.
# Should define two variables:
# DAV_USER="name:password"
# DAV_URL="https://site.com/dav-path"
if [[ -f "secrets.sh" ]]; then
source secrets.sh
else
echo "Cannot run without secrets.sh"
exit
fi
# Activate venv if not in venv
if [[ "$VIRTUAL_ENV" == "" ]]; then
source ../venv/bin/activate
fi
# Make sure our venv is running the latest
# version of lamb.
pip install --editable ..
# Make gif
vhs < demo.tape
# Upload
curl \
--user $DAV_USER \
--url $DAV_URL \
--upload-file "lambdemo.gif"

View File

@ -15,7 +15,7 @@ lamb = "lamb_engine:main"
[project]
name = "lamb_engine"
description = "A lambda calculus engine"
version = "1.1.6"
version = "1.1.7"
dependencies = [
"prompt-toolkit==3.0.31",
"pyparsing==3.0.9"