home: hub: minipeg

Download patch

ref: 769f2e54caa48939a167640c54f8bd33fa555a16
parent: 69e237ef93234f9a7ed42e4f376e7f736efa68fc
author: Andrew Chambers <ac@acha.ninja>
date: Thu Apr 7 21:35:10 CDT 2022

Shorten script name.

--- a/Makefile
+++ b/Makefile
@@ -25,8 +25,8 @@
 minipeg-split: $(SRC)
 	$(CC) $(CFLAGS) -o $@ compile.c tree.c peg.c
 
-minipeg.c: $(SRC) amalgamate.sh
-	sh amalgamate.sh $(SRC) > $@
+minipeg.c: $(SRC) amalg.sh
+	sh amalg.sh $(SRC) > $@
 
 peg-new.c: peg.peg minipeg
 	./minipeg -o $@ $<
--- /dev/null
+++ b/amalg.sh
@@ -1,0 +1,40 @@
+# Amalgamate the source code, sqlite3 style.
+set -eu
+cat <<EOF
+/*
+   Copyright (c) 2007 by Ian Piumarta
+   Copyright (c) 2022 by Andrew Chambers
+   All rights reserved.
+   
+   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, and/or sell
+   copies of the Software, and to permit persons to whom the Software is
+   furnished to do so, provided that the above copyright notice(s) and this
+   permission notice appear in all copies of the Software.  Acknowledgement
+   of the use of this Software in supporting documentation would be
+   appreciated but is not required.
+   
+   THE SOFTWARE IS PROVIDED 'AS IS'.  USE ENTIRELY AT YOUR OWN RISK.
+
+   This file is a distributable version of the minipeg[1] project.
+   Visit https://github.com/andrewchambers/minipeg for source code.
+*/
+EOF
+(
+  for f in "$@"
+  do
+    case "$f" in
+      *.c)
+      cat "$f"
+      ;;
+    esac
+  done
+) | grep '^#include <' | sort -u
+
+for f in "$@"
+do
+  echo "#line 0 \"$f\""
+  grep -v '^#include' "$f"
+done
--- a/amalgamate.sh
+++ /dev/null
@@ -1,40 +1,0 @@
-# Amalgamate the source code, sqlite3 style.
-set -eu
-cat <<EOF
-/*
-   Copyright (c) 2007 by Ian Piumarta
-   Copyright (c) 2022 by Andrew Chambers
-   All rights reserved.
-   
-   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, and/or sell
-   copies of the Software, and to permit persons to whom the Software is
-   furnished to do so, provided that the above copyright notice(s) and this
-   permission notice appear in all copies of the Software.  Acknowledgement
-   of the use of this Software in supporting documentation would be
-   appreciated but is not required.
-   
-   THE SOFTWARE IS PROVIDED 'AS IS'.  USE ENTIRELY AT YOUR OWN RISK.
-
-   This file is a distributable version of the minipeg[1] project.
-   Visit https://github.com/andrewchambers/minipeg for source code.
-*/
-EOF
-(
-  for f in "$@"
-  do
-    case "$f" in
-      *.c)
-      cat "$f"
-      ;;
-    esac
-  done
-) | grep '^#include <' | sort -u
-
-for f in "$@"
-do
-  echo "#line 0 \"$f\""
-  grep -v '^#include' "$f"
-done