From 69b36951cb31a50271b3e6882018548c8a60a2e7 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 19 Aug 2015 09:57:52 +0200 Subject: Functions --- postrun.cpp | 5 +---- test.prn | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/postrun.cpp b/postrun.cpp index 4de856b..17d72ca 100644 --- a/postrun.cpp +++ b/postrun.cpp @@ -50,18 +50,15 @@ vector tokenise(istream &stream){ case 'x':{ int res; c=stream.get(); - cerr<<"Parsed "<='0'&&c<='9'?c-'0':(c>='a'&&c<='f')||(c>='A'&&c<='F')?(c&~32)-'A'+10:-1; if(res==-1)throw "Invalid character '"+string(1,c)+"'' in hexadecimal escape sequence in string"; res*=16; c=stream.get(); - cerr<='0'&&c<='9'?c-'0':(c>='a'&&c<='f')||(c>='A'&&c<='F')?(c&~32)-'A'+10:-241; if(res<0)throw "Invalid character '"+string(1,c)+"'' in hexadecimal escape sequence in string"; c=(char)res; - cerr<<(int)c< T){ for(end=start;end &functoks=functions[name]; functoks.resize(end-start); - for(unsigned int i=start;i=T.size())throw string("Unterminated @include statement at end of file"); diff --git a/test.prn b/test.prn index 13fe1d7..4cf7828 100644 --- a/test.prn +++ b/test.prn @@ -1,2 +1,6 @@ +@defun "hoi" { + "hoi\n" print +} +hoi hoi hoi "a" "b\x0a" + print 1 12 + 3 - print -- cgit v1.2.3-54-g00ecf