Author: kjs
Date: Tue Apr 10 16:11:05 2007
New Revision: 18129
Added:
trunk/compilers/pirc/t/heredoc.pir (contents, props changed)
Modified:
trunk/compilers/pirc/src/pirlexer.c
Log:
compilers/pirc:
* changed unsigned type into int in lexer in default case (error case)
* added heredoc test file.
Modified: trunk/compilers/pirc/src/pirlexer.c
==============================================================================
--- trunk/compilers/pirc/src/pirlexer.c (original)
+++ trunk/compilers/pirc/src/pirlexer.c Tue Apr 10 16:11:05 2007
@@ -1626,8 +1626,8 @@
}
else {
- fprintf(stderr, "BUG IN LEXER: Unknown character: '%c' (ascii: %u)
"
- "at character position %d.\n", c, (unsigned)c,
+ fprintf(stderr, "BUG IN LEXER: Unknown character: '%c' (ascii: %d)
"
+ "at character position %d.\n", c, (int)c,
get_current_filepos(lexer));
fprintf(stderr, "Was parsing file: '%s'\n",
lexer->curfile->filename);
if (lexer->curfile->curchar >=
lexer->curfile->buffer+lexer->curfile->filesize) {
Added: trunk/compilers/pirc/t/heredoc.pir
==============================================================================
--- (empty file)
+++ trunk/compilers/pirc/t/heredoc.pir Tue Apr 10 16:11:05 2007
@@ -0,0 +1,31 @@
+.sub main
+ foo(<<'CODE', <<'OUTPUT', <<'HI')
+
+ print "Hello!"
+CODE
+ Hello!
+OUTPUT
+ this is some message
+HI
+
+.end
+
+.sub foo
+ .param pmc args :slurpy
+
+ .yield(<<'YIELD')
+ This is some text returned through .yield!
+
+YIELD
+
+ .return(<<'RET')
+ Some text returned through return
+RET
+.end
+
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4: