From 1e0433c9df062ead21d0f46b15d088622b7d5c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 22 Sep 2021 02:11:50 +0200 Subject: Log in, log out --- mktpl/README | 2 +- mktpl/mktpl.lex | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'mktpl') diff --git a/mktpl/README b/mktpl/README index 85a2fe3..cb50a6e 100644 --- a/mktpl/README +++ b/mktpl/README @@ -20,7 +20,7 @@ is compiled to the following C code: /* This C code will be executed. */ for(i = 0; i<10; i++) printf("Hello World!\n"); strcpy(s, "This"); - + printf("\n"); printf("%s", s ); printf(" will be evaluated and printed as a string."); diff --git a/mktpl/mktpl.lex b/mktpl/mktpl.lex index e184c0e..296cc0b 100644 --- a/mktpl/mktpl.lex +++ b/mktpl/mktpl.lex @@ -5,12 +5,12 @@ #include #include #include - + void apnd(); void eval(); void text(); void prnt(); - + char *buf; int len; int sz; @@ -38,7 +38,7 @@ main(int argc, char *argv[]) sz = 512; if(!(buf = malloc(sz))) err(1, "malloc"); - + yylex(); return 0; } @@ -51,7 +51,7 @@ apnd() if(!(buf = realloc(buf, sz))) err(1, "realloc"); } - + buf[len++] = *yytext; } @@ -66,9 +66,9 @@ void text() { int i, ofs; - + if(!len) return; - + printf("printf(\""); for(i = ofs = 0; i < len; i++){ /* -- cgit v1.2.3