#! /bin/sh -f

if make UnicodeData.txt >&2
then	true
else	echo Could not acquire Unicode data file UnicodeData.txt >&2
	exit 1
fi


#05D0;HEBREW LETTER ALEF;Lo;0;R;;;;;N;;;;;
#0627;ARABIC LETTER ALEF;Lo;0;AL;;;;;N;;;;;

LC_CTYPE=C
export LC_CTYPE

echo "static struct interval Right_to_Left [] ="

sed -e 's-^\([^;]*\);\([^;]*\);\([^;]*\);\([^;]*\);R;.*-	\1-' -e t \
    -e 's-^\([^;]*\);\([^;]*\);\([^;]*\);\([^;]*\);AL;.*-	\1-' -e t \
    -e d UnicodeData.txt |
uniset +- c
