git @ Cat's Eye Technologies ZOWIE / 2d5f12c
RPython doesn't seem to understand str.encode(), so work around it. Chris Pressey 1 year, 5 months ago
4 changed file(s) with 14 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
33 echo 'RPython not found. Not building. Use CPython or Skulpt instead.'
44 else
55 python `which rpython` src/zowie.py
6 mkdir -p bin
7 mv zowie-c bin/
68 fi
397397 if not s:
398398 return 0
399399 return ord(s[0])
400
401
400
401
402402 def rpython_output(code):
403 os.write(0, unichr_compat(code).encode('utf-8'))
404
405
403 if code <= 127:
404 os.write(0, chr(code))
405 else:
406 os.write(0, "&#%d;" % code)
407
408
406409 def rpython_load(filename):
407410 fd = os.open(filename, os.O_RDONLY, 0o644)
408411 text = ''
413416 text += chunk
414417 os.close(fd)
415418 return text
416
417
419
420
418421 def rpython_main(argv):
419422 p = Processor()
420423 program = rpython_load(argv[1])
00 #!/bin/sh
11
22 APPLIANCES="tests/appliances/zowie.py2.md tests/appliances/zowie.py3.md"
3 if [ ! `which rpython`X = X ]; then
3 if [ -x bin/zowie-c ]; then
44 APPLIANCES="$APPLIANCES tests/appliances/zowie-c.md"
5 if [ ! -e ./zowie-c ]; then
6 ./build.sh || exit $?
7 fi
85 fi
96
107 falderal $APPLIANCES tests/ZOWIE.md
99
1010 -> Functionality "Interpret ZOWIE Program" is implemented by
1111 -> shell command
12 -> "fa-under-pty ./zowie-c %(test-body-file)"
12 -> "fa-under-pty ./bin/zowie-c %(test-body-file)"
1313