Fixes end-of-file bug in as.c. Adds build script.

This commit is contained in:
Felix Queißner 2016-07-01 17:15:21 +02:00
parent aadccaa37a
commit dc6e35f825
2 changed files with 15 additions and 2 deletions

View file

@ -165,7 +165,7 @@ void assemble()
apply_modifiers(&current);
int reqPatch = 0;
if(tok != TOK_NEWLINE)
if(tok != TOK_NEWLINE && tok != TOK_EOF)
{
switch(tok)
{
@ -291,7 +291,7 @@ int main(int argc, char **argv)
{
FILE *f = fopen(argv[index], "r");
if(f == NULL) {
fprintf(stderr, "%f not found.\n", optarg);
fprintf(stderr, "%s not found.\n", argv[index]);
abort();
}
yyrestart (f);

13
libvm/bin/build Normal file
View file

@ -0,0 +1,13 @@
#!/bin/sh
ASMFILE=$1.asm
BINFILE=`echo $ASMFILE | sed "s|\.asm\$|\.bin|"`
EXPFILE=`echo $BINFILE | sed "s|\.bin\$|\.exp|"`
echo $ASMFILE
echo $BINFILE
echo $EXPFILE
./bin/as -o $BINFILE $ASMFILE -Ls
./bin/explink -o $EXPFILE -c $BINFILE
rm $BINFILE