#!/bin/sh

# fix quirks caused by the implementation's programming language (python)

# python does not allow (not|and|or) as names so we shall rename them to (not_|and_|or_) respectively

echo renaming in functions/boolean.py: not → _not, and → _and, or → _or
sed -i \
	-e 's/def not(/def not_(/g' \
	-e 's/context\.not/context.not_/g' \
	-e 's/def and(/def and_(/g' \
	-e 's/context\.and/context.and_/g' \
	-e 's/def or(/def or_(/g' \
	-e 's/context\.or/context.or_/g' \
	../src/daamath/functions/boolean.py

echo renaming in context/signatures.py: not → not_, and → and_, or → or_
sed -i \
	-e 's/^not = /not_ = /' \
	-e 's/^and = /and_ = /' \
	-e 's/^or = /or_ = /' \
	-e 's/mappings\.not/mappings.not_/g' \
	-e 's/mappings\.and/mappings.and_/g' \
	-e 's/mappings\.or/mappings.or_/g' \
	../src/daamath/context/signatures.py
