|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
#!/bin/sh
# This file: (find-angg "bin/patch-lua-5.2")
# old version: (find-angg "bin/patch-lua-5.1.3")
# See: (find-es "lua5" "risclua")
# (find-es "lua5" "minimal_GCW_SUGAR")
# http://www.wra1th.plus.com/lua/book/rb04.html
# http://angg.twu.net/luaforth.html#GCW_SUGAR
# (find-TH "luaforth" "GCW_SUGAR")
# (find-lua51file "src/llex.c" "#ifdef GCW_SUGAR")
# (find-lua51file "src/llex.c.orig" "case '=':")
# (find-lua52file "src/llex.c" "case '=':")
# (find-lua52file "src/llex.c.orig" "case '=':")
# (find-tkdiff (ee-lua51file "src/llex.c") (ee-lua51file "src/llex.c.orig"))
cp -iv src/llex.c src/llex.c.orig
patch -p0 src/llex.c <<'%%%'
395,399c395,413
< case '=': {
< next(ls);
< if (ls->current != '=') return '=';
< else { next(ls); return TK_EQ; }
< }
---
> #ifndef GCW_SUGAR
> case '=': {
> next(ls);
> if (ls->current != '=') return '=';
> else { next(ls); return TK_EQ; }
> }
> #else
> case '=': {
> next(ls);
> switch(ls->current) {
> case '=': next(ls); return TK_EQ; break;
> case '>': next(ls); return TK_RETURN; break;
> default: return '='; }
> }
> case '\\': {
> next(ls);
> return TK_FUNCTION;
> }
> #endif
%%%
# Pre-compile llex.c with GCW_SUGAR=1
# cd src; gcc -O2 -Wall -DLUA_USE_LINUX -DGCW_SUGAR -c -o llex.o llex.c; cd ..
# Instead:
# (find-lua51file "src/Makefile")
cp -iv src/Makefile src/Makefile.orig
patch -p0 src/Makefile <<'%%%'
11c11
< CFLAGS= -O2 -Wall $(MYCFLAGS)
---
> CFLAGS= -O2 -Wall $(MYCFLAGS) -g $(MYEXTRACFLAGS) -DGCW_SUGAR
%%%