# HG changeset patch # User HackBot # Date 1468140095 0 # Node ID 30f86e019a0c0e4289c5db097a491da3e773875c # Parent 3c8030de1ce7a740ad523da743726cb828df4f7b fetch https://raw.githubusercontent.com/izabera/candide/master/candide-to-conf diff -r 3c8030de1ce7 -r 30f86e019a0c candide-to-conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/candide-to-conf Sun Jul 10 08:41:35 2016 +0000 @@ -0,0 +1,32 @@ +#!/bin/bash +# compile c from stdin +# candide, kinda + +readinput () { + while read -r -e || { printf %s "$REPLY"; false; } ; do + printf '%s\n' "$REPLY" + done +} + +c=$(readinput) +if ! [[ $c ]] || ! out=$(mktemp); then + echo Error >&2 + exit 1 +fi + +# if you don't write 'main' it assumes that you're writing a full program (with free includes) +# this allows you to use other functions and stuff +# it will get false positives, but who cares? +if [[ $c != *main* ]]; then c=$(cat <