├── citron_conv.h ├── stdout ├── compilerutils.c ├── ctr_constants.c ├── evalserver.ctr ├── hscomp └── compiler.hs ├── tests ├── test0130.ctr ├── test0097.exp ├── test0130.exp ├── test0146.exp ├── test0150.exp ├── test0202.exp ├── test0242.exp ├── test0243.exp ├── test0259.exp ├── test0278.exp ├── test0279.ctr ├── test0279.exp ├── test0282.exp ├── test0005.exp ├── test0007.exp ├── test0010.exp ├── test0011.exp ├── test0016.exp ├── test0018.exp ├── test0024.exp ├── test0025.exp ├── test0038.exp ├── test0040.exp ├── test0050.exp ├── test0051.exp ├── test0053.exp ├── test0087.exp ├── test0093.exp ├── test0094.exp ├── test0098.ctr ├── test0099.ctr ├── test0106.exp ├── test0199.exp ├── test0200.exp ├── test0245.exp ├── test0283.exp ├── test0012.exp ├── test0015.exp ├── test0017.exp ├── test0019.exp ├── test0023.exp ├── test0031.exp ├── test0033.exp ├── test0034.exp ├── test0059.exp ├── test0066.exp ├── test0079.exp ├── test0105.exp ├── test0112.exp ├── test0120.exp ├── test0124.exp ├── test0132.exp ├── test0134.exp ├── test0135.exp ├── test0201.exp ├── test0219.exp ├── test0222.exp ├── test0244.exp ├── test0251.exp ├── test0269.exp ├── test0276.exp ├── test0001.exp ├── test0002.exp ├── test0003.exp ├── test0006.exp ├── test0030.exp ├── test0032.exp ├── test0061.exp ├── test0082.exp ├── test0109.exp ├── test0136.exp ├── test0191.exp ├── test0194.ctr ├── test0228.exp ├── test0233.exp ├── test0234.exp ├── test0235.exp ├── test0266.exp ├── test0268.ctr ├── test0004.exp ├── test0014.exp ├── test0022.exp ├── test0029.exp ├── test0045.exp ├── test0057.exp ├── test0064.exp ├── test0067.exp ├── test0085.exp ├── test0101.exp ├── test0159.exp ├── test0160.exp ├── test0161.exp ├── test0170.exp ├── test0185.exp ├── test0197.exp ├── test0230.exp ├── test0237.exp ├── test0249.exp ├── test0250.exp ├── test0028.exp ├── test0054.exp ├── test0055.exp ├── test0076.exp ├── test0083.exp ├── test0088.exp ├── test0110.exp ├── test0121.exp ├── test0129.exp ├── test0138.exp ├── test0196.exp ├── test0263.exp ├── test0281.exp ├── test0005.ctr ├── test0008.exp ├── test0009.exp ├── test0026.exp ├── test0044.exp ├── test0046.exp ├── test0047.exp ├── test0048.exp ├── test0049.exp ├── test0102.exp ├── test0150.ctr ├── test0184.exp ├── test0198.exp ├── test0016.ctr ├── test0019.ctr ├── test0027.exp ├── test0072.exp ├── test0111.exp ├── test0122.exp ├── test0128.exp ├── test0224.exp ├── test0226.exp ├── test0231.exp ├── test0236.exp ├── test0260.exp ├── test0267.exp ├── test0270.ctr ├── test0272.exp ├── test0035.exp ├── test0050.ctr ├── test0071.exp ├── test0074.exp ├── test0092.exp ├── test0219.ctr ├── test0227.exp ├── test0261.exp ├── test0002.ctr ├── test0021.exp ├── test0037.exp ├── test0043.exp ├── test0058.exp ├── test0063.exp ├── test0084.exp ├── test0096.exp ├── test0115.exp ├── test0116.exp ├── test0172.exp ├── test0240.exp ├── test0264.ctr ├── test0268.exp ├── test0003.ctr ├── test0149.ctr ├── test0152.ctr ├── test0274.exp ├── test0280.exp ├── test0001.ctr ├── test0035.ctr ├── test0040.ctr ├── test0056.exp ├── test0097.ctr ├── test0114.exp ├── test0207.exp ├── test0215.exp ├── test0218.exp ├── test0265.ctr ├── test0277.exp ├── test0055.ctr ├── test0212.exp ├── test0216.exp ├── test0025.ctr ├── test0052.exp ├── test0118.exp ├── test0146.ctr ├── test0154.ctr ├── test0179.exp ├── test0190.exp ├── foreign │ └── a.out ├── test0004.ctr ├── test0081.exp ├── test0098.exp ├── test0099.exp ├── test0100.exp ├── test0177.exp ├── test0202.ctr ├── test0204.exp ├── test0208.exp ├── test0209.exp ├── test0210.exp ├── test0211.exp ├── test0217.exp ├── test0254.exp ├── test0276.ctr ├── test0042.exp ├── test0148.ctr ├── test0213.exp ├── test0220.exp ├── notest0262.exp ├── test0015.ctr ├── test0020.exp ├── test0086.exp ├── test0109.ctr ├── test0147.ctr ├── test0218.ctr ├── test0242.ctr ├── test0264.exp ├── test0265.exp ├── test0271.exp ├── test0137.exp ├── test0145.ctr ├── test0212.ctr ├── test0273.ctr ├── test0073.exp ├── test0117.exp ├── test0131.exp ├── test0207.ctr ├── test0246.exp ├── test0275.exp ├── test0038.ctr ├── test0101.ctr ├── test0106.ctr ├── test0123.exp ├── test0155.ctr ├── test0171.exp ├── test0195.ctr ├── test0261.ctr ├── test0267.ctr ├── test0278.ctr ├── test0006.ctr ├── test0108.exp ├── test0151.ctr ├── test0205.exp ├── test0214.exp ├── test0215.ctr ├── test0241.exp ├── plg.py ├── test0187.exp ├── test0233.ctr ├── test0245.ctr ├── test0256.exp ├── test0069.exp ├── test0155.exp ├── test0223.exp ├── test0224.ctr ├── test0234.ctr ├── test0235.ctr ├── test0110.ctr ├── test0147.exp ├── test0148.exp ├── test0151.exp ├── test0210.ctr ├── test0213.ctr ├── test0024.ctr ├── test0216.ctr ├── test0258.exp ├── test0139.ctr ├── test0149.exp ├── test0153.exp ├── test0154.exp ├── test0193.ctr ├── test0208.ctr ├── test0209.ctr ├── test0221.exp ├── test0228.ctr ├── test0230.ctr ├── test0250.ctr ├── ptest │ ├── main.ctr │ └── test.ctr ├── test0023.ctr ├── test0079.ctr ├── test0121.ctr ├── test0211.ctr ├── test0217.ctr ├── test0280.ctr ├── test0125.exp ├── test0206.ctr ├── test0272.ctr ├── test0283.ctr ├── test0266.ctr ├── test0071.ctr ├── test0105.ctr ├── test0181.exp ├── test0247.exp ├── test0060.exp ├── test0064.ctr ├── test0214.ctr ├── test0227.ctr ├── test0243.ctr ├── test0082.ctr ├── test0141.ctr ├── test0182.exp ├── plg.ctr ├── test0191.ctr ├── test0236.ctr ├── test0087.ctr ├── test0166.exp ├── test0271.ctr ├── test0122.ctr ├── test0030.ctr ├── test0112.ctr ├── test0222.ctr ├── test0257.ctr ├── test0051.ctr ├── test0080.exp ├── test0007.ctr ├── test0028.ctr ├── test0046.ctr ├── test0074.ctr ├── test0114.ctr ├── test0124.ctr ├── test0229.ctr ├── assets │ └── asset_mod_for_ast.ctr ├── test0133.exp ├── test0156.ctr ├── test0252.exp ├── test0238.exp ├── test0244.ctr ├── test0070.exp ├── test0076.ctr ├── test0077.exp ├── test0142.ctr ├── test0194.exp ├── test0188.exp ├── test0260.ctr ├── test0065.exp ├── test0143.ctr ├── test0017.ctr ├── test0045.ctr ├── test0126.exp ├── test0175.exp ├── test0254.ctr ├── test0029.ctr ├── test0048.ctr ├── test0094.ctr ├── test0259.ctr ├── test0275.ctr ├── test0057.ctr ├── test0047.ctr ├── test0129.ctr ├── test0152.exp ├── test0232.ctr ├── test0093.ctr ├── test0116.ctr ├── test0128.ctr ├── test0041.ctr ├── test0183.exp ├── test0263.ctr ├── test0059.ctr ├── test0158.exp ├── test0225.exp ├── test0011.ctr ├── test0075.exp ├── test0078.ctr ├── test0192.exp ├── test0247.ctr ├── test0273.exp ├── test0034.ctr ├── test0083.ctr ├── test0140.ctr ├── test0018.ctr ├── test0117.ctr ├── test0157.exp ├── test0062.exp ├── test0270.exp ├── test0111.ctr ├── test0158.ctr ├── test0032.ctr ├── test0075.ctr ├── test0123.ctr ├── test0246.ctr ├── test0225.ctr ├── test0013.exp ├── test0052.ctr ├── test0204.ctr ├── test0206.exp ├── test0027.ctr ├── test0031.ctr ├── test0078.exp ├── test0220.ctr ├── test0274.ctr ├── test0012.ctr ├── test0176.exp ├── test0102.ctr ├── test0197.ctr ├── test0200.ctr ├── test0251.ctr ├── test0284.exp ├── test0085.ctr ├── test0021.ctr ├── test0013.ctr ├── test0033.ctr ├── test0163.exp ├── test0198.ctr ├── test0239.exp ├── test0142.exp ├── test0145.exp ├── test0164.exp ├── test0069.ctr ├── test0103.exp ├── test0143.exp ├── test0203.ctr ├── test0249.ctr ├── test0162.exp ├── test0165.exp ├── test0167.exp ├── test0168.exp ├── test0169.exp ├── test0231.ctr ├── test0120.ctr ├── test0140.exp ├── test0022.ctr ├── test0153.ctr ├── test0196.ctr ├── test0201.ctr ├── test0241.ctr ├── test0054.ctr ├── test0092.ctr ├── test0100.ctr ├── test0193.exp ├── test0253.exp ├── test0058.ctr ├── test0104.ctr ├── test0277.ctr ├── test0049.ctr ├── test0256.ctr ├── test0088.ctr ├── test0127.exp ├── test0257.exp ├── test0020.ctr ├── test0036.ctr ├── test0008.ctr ├── test0026.ctr ├── test0174.exp ├── test0186.exp ├── test0192.ctr ├── test0041.exp ├── test0044.ctr ├── test0108.ctr ├── test0232.exp ├── test0248.exp ├── test0010.ctr ├── test0086.ctr ├── test0103.ctr ├── test0063.ctr ├── test0141.exp ├── test0229.exp ├── test0195.exp ├── test0056.ctr ├── test0009.ctr ├── test0070.ctr ├── test0014.ctr ├── test0282.ctr ├── test0080.ctr ├── test0043.ctr ├── test0104.exp ├── test0173.exp ├── test0189.exp └── test0199.ctr ├── plugins ├── python │ └── python.c ├── sdl │ ├── todo.h.in │ └── makefile ├── sharedobject │ └── sharedobject.c ├── ffi │ ├── test │ │ ├── sample.c │ │ ├── a.out │ │ ├── test.c │ │ └── test.ctr │ └── a.out ├── json │ ├── libjansson.a │ └── Makefile ├── request │ └── ccgi-1.2 │ │ ├── libccgi.a │ │ ├── examples │ │ ├── Makefile │ │ └── README │ │ ├── t │ │ └── Makefile │ │ └── README ├── termbox │ ├── libtermbox.so.1.0.0 │ └── test.ctr ├── curl │ └── Makefile ├── gmp │ └── Makefile ├── ctypes_DEPRECATED' │ └── Makefile ├── sfml │ ├── Makefile │ └── sfml.lo ├── fiber │ └── Makefile ├── keyboardmods │ └── makefile └── tcl │ └── makefile ├── Library ├── Data │ ├── String │ │ └── main.ctr │ ├── Array │ │ └── main.ctr │ ├── main.ctr │ ├── Set │ │ └── main.ctr │ └── Range.ctr ├── Graphics │ └── SDL │ │ ├── gfx.ctr │ │ └── main.ctr ├── Control │ ├── Coproc │ │ └── main.ctr │ ├── Class │ │ ├── Functor.ctr │ │ ├── List.ctr │ │ └── Classes.ctr │ ├── Method │ │ └── main.ctr │ └── Error │ │ └── NotImplementedError.ctr ├── Foreign │ ├── C │ │ ├── CParser │ │ │ └── main.ctr │ │ ├── errno.ctr │ │ └── Storable │ │ │ └── main.ctr │ └── Plugin │ │ └── main.ctr ├── Functional │ ├── Monad │ │ ├── main.ctr │ │ ├── Array.ctr │ │ └── Block.ctr │ ├── Category │ │ ├── Array.ctr │ │ └── Block.ctr │ └── TypeClass │ │ └── Category.ctr ├── Utils │ ├── AST.ctr │ ├── main.ctr │ ├── Fire │ │ └── fire.ctr │ ├── OneGateFlipper.ctr │ └── Timer │ │ └── main.ctr ├── Extensions.ctr └── AST │ └── main.ctr ├── autohell ├── doc │ ├── Makefile.am │ ├── ctr.1 │ ├── docs.ps │ ├── ctr.html │ ├── docs.html │ ├── pcre.txt │ ├── sman.ctr │ ├── ctr.html_e │ ├── ctrstyle.css │ ├── doxygen.conf │ └── grammar.txt ├── man │ └── Makefile.am ├── src │ ├── pcrs │ ├── base.c │ ├── fiber.c │ ├── file.c │ ├── lexer.c │ ├── plugins │ ├── utf8.c │ ├── util.c │ ├── world.c │ ├── citron.c │ ├── citron.h │ ├── config.h │ ├── marshal.c │ ├── memory.c │ ├── murmur3.c │ ├── murmur3.h │ ├── parser.c │ ├── reflect.c │ ├── siphash.c │ ├── siphash.h │ ├── symbol.c │ ├── symbol.h │ ├── system.c │ ├── walker.c │ ├── compiler.c │ ├── coroutine.c │ ├── coroutine.h │ ├── dictionary.h │ ├── generator.c │ ├── generator.h │ ├── importlib.c │ ├── lexer_plug.c │ ├── linkedlist.c │ ├── memory-ngc.h │ ├── pcre_split.h │ ├── citron_conv.h │ ├── collections.c │ ├── compilerstub.c │ ├── memory-boehm.h │ ├── base_extensions.c │ ├── citron_ensure.h │ ├── compilerutils.c │ ├── ctr_constants.c │ ├── grapheme_break.c │ ├── ctr_preprocessor.c │ └── compcompat_pthread.h ├── scripts │ ├── citron │ ├── mods │ ├── Library │ ├── basemods │ ├── sdl.ctr │ ├── heap.ctr │ ├── json.ctr │ ├── print.ctr │ ├── teash.ctr │ ├── iterable.ctr │ ├── requests.ctr │ ├── string.ctr │ ├── stringio.ctr │ ├── fileutils.ctr │ ├── functional.ctr │ ├── importlib.ctr │ ├── reflection.ctr │ ├── switchcase.ctr │ ├── ccompletion.ctr │ ├── collections.ctr │ ├── documentation.ctr │ ├── multiprocessing.ctr │ ├── one_liners.md │ └── Makefile.am ├── compile ├── depcomp ├── missing ├── config.guess ├── config.sub ├── install-sh ├── ltmain.sh ├── examples │ ├── fun │ │ ├── #magic.lsp# │ │ ├── magic.lsp │ │ └── lisp.scm │ ├── lol.test │ ├── tuple.ctr │ ├── Makefile.am │ ├── reverse.ctr │ ├── sdl │ │ ├── lol.bmp │ │ ├── boop.jpg │ │ ├── razavi.jpg │ │ ├── wowsers_italic.ttf │ │ └── bigD.ctr │ ├── shit │ │ ├── .ropeproject │ │ │ ├── history │ │ │ ├── objectdb │ │ │ └── globalnames │ │ ├── test.txt │ │ ├── test.py │ │ └── trash.ctr │ ├── serialization │ │ ├── .ropeproject │ │ │ ├── history │ │ │ ├── objectdb │ │ │ └── globalnames │ │ ├── serializing.rb │ │ ├── serializing.py │ │ ├── serializing.ctr │ │ └── serializing.pl │ ├── pragma.ctr │ ├── shit.ctr │ ├── all.ctr │ ├── hello.ctr │ ├── arrays.ctr │ ├── case.ctr │ ├── apply │ ├── reflect.ctr │ ├── fizzbuzz.ctr │ ├── json.ctr │ ├── boolean.ctr │ ├── mp.ctr │ └── shared.ctr └── Makefile.am ├── extensions ├── teash.ctr ├── json.ctr ├── reflection.ctr └── string.ctr ├── headergen ├── constexpr-cc.cpp ├── constexpr-cc.ctr └── constexpr-cc.hpp ├── integration ├── jupyter_kernel │ ├── README.rst │ └── citronkernel │ │ ├── .ipynb_checkpoints │ │ └── Untitled-checkpoint.ipynb │ │ └── __main__.py ├── pygments │ └── CitronLexer │ │ ├── .gitignore │ │ └── setup.py └── gml │ ├── gmbe.exe │ ├── gmbe.gb1 │ ├── gmbe.gmk │ ├── integ.ctr │ └── game_errors.log ├── mods ├── request │ └── .gitkeep └── percolator │ └── README.md ├── examples ├── fun │ ├── #magic.lsp# │ ├── magic.lsp │ └── lisp.scm ├── lol.test ├── tuple.ctr ├── Makefile.am ├── sdl │ ├── boop.jpg │ ├── lol.bmp │ ├── razavi.jpg │ ├── wowsers_italic.ttf │ └── bigD.ctr ├── reverse.ctr ├── shit │ ├── .ropeproject │ │ ├── history │ │ ├── objectdb │ │ └── globalnames │ ├── test.txt │ ├── test.py │ └── trash.ctr ├── serialization │ ├── .ropeproject │ │ ├── history │ │ ├── objectdb │ │ └── globalnames │ ├── serializing.rb │ ├── serializing.py │ ├── serializing.ctr │ └── serializing.pl ├── pragma.ctr ├── shit.ctr ├── all.ctr ├── hello.ctr ├── arrays.ctr ├── case.ctr ├── apply ├── reflect.ctr ├── fizzbuzz.ctr ├── json.ctr ├── boolean.ctr ├── mp.ctr └── shared.ctr ├── python ├── test.ctr └── citron │ └── parser │ ├── __pycache__ │ ├── ast.cpython-36.pyc │ └── token.cpython-36.pyc │ └── token.py ├── image └── citron.png ├── Makefile.am ├── exec.sh ├── siphash.h ├── docs └── ctrstyle.css ├── memory.c ├── preproctest.ctr ├── misc └── isgood.bash ├── .gitignore ├── config.h ├── pcrs └── INSTALL ├── mk.sh ├── plg.ctr ├── makefile.bsd ├── playground └── playground.html └── .gitmodules /citron_conv.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stdout: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /compilerutils.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ctr_constants.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /evalserver.ctr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hscomp/compiler.hs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test0130.ctr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/python/python.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/sdl/todo.h.in: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test0097.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0130.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0146.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0150.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0202.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0242.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0243.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0259.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0278.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0279.ctr: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0279.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test0282.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Library/Data/String/main.ctr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Library/Graphics/SDL/gfx.ctr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autohell/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autohell/man/Makefile.am: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autohell/src/pcrs: -------------------------------------------------------------------------------- 1 | ../../pcrs -------------------------------------------------------------------------------- /extensions/teash.ctr: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /headergen/constexpr-cc.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /headergen/constexpr-cc.ctr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /headergen/constexpr-cc.hpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test0005.exp: -------------------------------------------------------------------------------- 1 | 01234 2 | -------------------------------------------------------------------------------- /tests/test0007.exp: -------------------------------------------------------------------------------- 1 | meow! 2 | -------------------------------------------------------------------------------- /tests/test0010.exp: -------------------------------------------------------------------------------- 1 | meow! 2 | -------------------------------------------------------------------------------- /tests/test0011.exp: -------------------------------------------------------------------------------- 1 | meow! 2 | -------------------------------------------------------------------------------- /tests/test0016.exp: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /tests/test0018.exp: -------------------------------------------------------------------------------- 1 | MEOW! 2 | -------------------------------------------------------------------------------- /tests/test0024.exp: -------------------------------------------------------------------------------- 1 | Yes. 2 | -------------------------------------------------------------------------------- /tests/test0025.exp: -------------------------------------------------------------------------------- 1 | Yes. 2 | -------------------------------------------------------------------------------- /tests/test0038.exp: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /tests/test0040.exp: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /tests/test0050.exp: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /tests/test0051.exp: -------------------------------------------------------------------------------- 1 | 121 2 | -------------------------------------------------------------------------------- /tests/test0053.exp: -------------------------------------------------------------------------------- 1 | DONE 2 | -------------------------------------------------------------------------------- /tests/test0087.exp: -------------------------------------------------------------------------------- 1 | 18 2 | -------------------------------------------------------------------------------- /tests/test0093.exp: -------------------------------------------------------------------------------- 1 | 3332 2 | -------------------------------------------------------------------------------- /tests/test0094.exp: -------------------------------------------------------------------------------- 1 | 24 2 | -------------------------------------------------------------------------------- /tests/test0098.ctr: -------------------------------------------------------------------------------- 1 | ?>ab 2 | -------------------------------------------------------------------------------- /tests/test0099.ctr: -------------------------------------------------------------------------------- 1 | ?> 2 | -------------------------------------------------------------------------------- /tests/test0106.exp: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /tests/test0199.exp: -------------------------------------------------------------------------------- 1 | meow! 2 | -------------------------------------------------------------------------------- /tests/test0200.exp: -------------------------------------------------------------------------------- 1 | meow! 2 | -------------------------------------------------------------------------------- /tests/test0245.exp: -------------------------------------------------------------------------------- 1 | 14 2 | -------------------------------------------------------------------------------- /tests/test0283.exp: -------------------------------------------------------------------------------- 1 | 149 2 | -------------------------------------------------------------------------------- /Library/Control/Coproc/main.ctr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autohell/scripts/citron: -------------------------------------------------------------------------------- 1 | ../../eval -------------------------------------------------------------------------------- /autohell/scripts/mods: -------------------------------------------------------------------------------- 1 | ../../mods -------------------------------------------------------------------------------- /autohell/src/base.c: -------------------------------------------------------------------------------- 1 | ../../base.c -------------------------------------------------------------------------------- /autohell/src/fiber.c: -------------------------------------------------------------------------------- 1 | ../../fiber.c -------------------------------------------------------------------------------- /autohell/src/file.c: -------------------------------------------------------------------------------- 1 | ../../file.c -------------------------------------------------------------------------------- /autohell/src/lexer.c: -------------------------------------------------------------------------------- 1 | ../../lexer.c -------------------------------------------------------------------------------- /autohell/src/plugins: -------------------------------------------------------------------------------- 1 | ../../plugins -------------------------------------------------------------------------------- /autohell/src/utf8.c: -------------------------------------------------------------------------------- 1 | ../../utf8.c -------------------------------------------------------------------------------- /autohell/src/util.c: -------------------------------------------------------------------------------- 1 | ../../util.c -------------------------------------------------------------------------------- /autohell/src/world.c: -------------------------------------------------------------------------------- 1 | ../../world.c -------------------------------------------------------------------------------- /tests/test0012.exp: -------------------------------------------------------------------------------- 1 | meow!? 2 | -------------------------------------------------------------------------------- /tests/test0015.exp: -------------------------------------------------------------------------------- 1 | Hi!Hi! 2 | -------------------------------------------------------------------------------- /tests/test0017.exp: -------------------------------------------------------------------------------- 1 | 138889 2 | -------------------------------------------------------------------------------- /tests/test0019.exp: -------------------------------------------------------------------------------- 1 | HelloWorld 2 | -------------------------------------------------------------------------------- /tests/test0023.exp: -------------------------------------------------------------------------------- 1 | 8901.59030 2 | -------------------------------------------------------------------------------- /tests/test0031.exp: -------------------------------------------------------------------------------- 1 | hiboo!boo! 2 | -------------------------------------------------------------------------------- /tests/test0033.exp: -------------------------------------------------------------------------------- 1 | 123666 2 | -------------------------------------------------------------------------------- /tests/test0034.exp: -------------------------------------------------------------------------------- 1 | 123123 2 | -------------------------------------------------------------------------------- /tests/test0059.exp: -------------------------------------------------------------------------------- 1 | hellohello 2 | -------------------------------------------------------------------------------- /tests/test0066.exp: -------------------------------------------------------------------------------- 1 | Cl30patra 2 | -------------------------------------------------------------------------------- /tests/test0079.exp: -------------------------------------------------------------------------------- 1 | T1 < T2 2 | -------------------------------------------------------------------------------- /tests/test0105.exp: -------------------------------------------------------------------------------- 1 | LxLxLxL 2 | -------------------------------------------------------------------------------- /tests/test0112.exp: -------------------------------------------------------------------------------- 1 | Block 1. 2 | -------------------------------------------------------------------------------- /tests/test0120.exp: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /tests/test0124.exp: -------------------------------------------------------------------------------- 1 | Titlecase 2 | -------------------------------------------------------------------------------- /tests/test0132.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | -------------------------------------------------------------------------------- /tests/test0134.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | -------------------------------------------------------------------------------- /tests/test0135.exp: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | -------------------------------------------------------------------------------- /tests/test0201.exp: -------------------------------------------------------------------------------- 1 | meow!? 2 | -------------------------------------------------------------------------------- /tests/test0219.exp: -------------------------------------------------------------------------------- 1 | blah blah 2 | -------------------------------------------------------------------------------- /tests/test0222.exp: -------------------------------------------------------------------------------- 1 | h*o wo*d 2 | -------------------------------------------------------------------------------- /tests/test0244.exp: -------------------------------------------------------------------------------- 1 | Blaaaa 2 | -------------------------------------------------------------------------------- /tests/test0251.exp: -------------------------------------------------------------------------------- 1 | zeroone 2 | -------------------------------------------------------------------------------- /tests/test0269.exp: -------------------------------------------------------------------------------- 1 | OK 2 | OK 3 | -------------------------------------------------------------------------------- /tests/test0276.exp: -------------------------------------------------------------------------------- 1 | XXXXXXXXXX 2 | -------------------------------------------------------------------------------- /Library/Foreign/C/CParser/main.ctr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autohell/doc/ctr.1: -------------------------------------------------------------------------------- 1 | ../../docs/ctr.1 -------------------------------------------------------------------------------- /autohell/doc/docs.ps: -------------------------------------------------------------------------------- 1 | ../../docs/docs.ps -------------------------------------------------------------------------------- /autohell/scripts/Library: -------------------------------------------------------------------------------- 1 | ../../Library -------------------------------------------------------------------------------- /autohell/src/citron.c: -------------------------------------------------------------------------------- 1 | ../../citron.c -------------------------------------------------------------------------------- /autohell/src/citron.h: -------------------------------------------------------------------------------- 1 | ../../citron.h -------------------------------------------------------------------------------- /autohell/src/config.h: -------------------------------------------------------------------------------- 1 | ../../config.h -------------------------------------------------------------------------------- /autohell/src/marshal.c: -------------------------------------------------------------------------------- 1 | ../../marshal.c -------------------------------------------------------------------------------- /autohell/src/memory.c: -------------------------------------------------------------------------------- 1 | ../../memory.c -------------------------------------------------------------------------------- /autohell/src/murmur3.c: -------------------------------------------------------------------------------- 1 | ../../murmur3.c -------------------------------------------------------------------------------- /autohell/src/murmur3.h: -------------------------------------------------------------------------------- 1 | ../../murmur3.h -------------------------------------------------------------------------------- /autohell/src/parser.c: -------------------------------------------------------------------------------- 1 | ../../parser.c -------------------------------------------------------------------------------- /autohell/src/reflect.c: -------------------------------------------------------------------------------- 1 | ../../reflect.c -------------------------------------------------------------------------------- /autohell/src/siphash.c: -------------------------------------------------------------------------------- 1 | ../../siphash.c -------------------------------------------------------------------------------- /autohell/src/siphash.h: -------------------------------------------------------------------------------- 1 | ../../siphash.h -------------------------------------------------------------------------------- /autohell/src/symbol.c: -------------------------------------------------------------------------------- 1 | ../../symbol.c -------------------------------------------------------------------------------- /autohell/src/symbol.h: -------------------------------------------------------------------------------- 1 | ../../symbol.h -------------------------------------------------------------------------------- /autohell/src/system.c: -------------------------------------------------------------------------------- 1 | ../../system.c -------------------------------------------------------------------------------- /autohell/src/walker.c: -------------------------------------------------------------------------------- 1 | ../../walker.c -------------------------------------------------------------------------------- /integration/jupyter_kernel/README.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/sharedobject/sharedobject.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test0001.exp: -------------------------------------------------------------------------------- 1 | Hello World 2 | -------------------------------------------------------------------------------- /tests/test0002.exp: -------------------------------------------------------------------------------- 1 | HelloWorld! 2 | -------------------------------------------------------------------------------- /tests/test0003.exp: -------------------------------------------------------------------------------- 1 | Hello World 2 | -------------------------------------------------------------------------------- /tests/test0006.exp: -------------------------------------------------------------------------------- 1 | Hello World! 2 | -------------------------------------------------------------------------------- /tests/test0030.exp: -------------------------------------------------------------------------------- 1 | HelloHelloWorld 2 | -------------------------------------------------------------------------------- /tests/test0032.exp: -------------------------------------------------------------------------------- 1 | testtesttest 2 | -------------------------------------------------------------------------------- /tests/test0061.exp: -------------------------------------------------------------------------------- 1 | Y1Y2Y4Y5Y6Y7 2 | -------------------------------------------------------------------------------- /tests/test0082.exp: -------------------------------------------------------------------------------- 1 | Welcome visitor 2 | -------------------------------------------------------------------------------- /tests/test0109.exp: -------------------------------------------------------------------------------- 1 | I am myself. 2 | -------------------------------------------------------------------------------- /tests/test0136.exp: -------------------------------------------------------------------------------- 1 | False 2 | 0 3 | -------------------------------------------------------------------------------- /tests/test0191.exp: -------------------------------------------------------------------------------- 1 | START 2 | END 3 | -------------------------------------------------------------------------------- /tests/test0194.ctr: -------------------------------------------------------------------------------- 1 | 2 is 1. 2 | 3 | -------------------------------------------------------------------------------- /tests/test0228.exp: -------------------------------------------------------------------------------- 1 | Hello World 2 | -------------------------------------------------------------------------------- /tests/test0233.exp: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /tests/test0234.exp: -------------------------------------------------------------------------------- 1 | Array 2 | Map 3 | -------------------------------------------------------------------------------- /tests/test0235.exp: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /tests/test0266.exp: -------------------------------------------------------------------------------- 1 | True 2 | False 3 | -------------------------------------------------------------------------------- /tests/test0268.ctr: -------------------------------------------------------------------------------- 1 | my value is 1. 2 | -------------------------------------------------------------------------------- /autohell/doc/ctr.html: -------------------------------------------------------------------------------- 1 | ../../docs/ctr.html -------------------------------------------------------------------------------- /autohell/doc/docs.html: -------------------------------------------------------------------------------- 1 | ../../docs/docs.html -------------------------------------------------------------------------------- /autohell/doc/pcre.txt: -------------------------------------------------------------------------------- 1 | ../../docs/pcre.txt -------------------------------------------------------------------------------- /autohell/doc/sman.ctr: -------------------------------------------------------------------------------- 1 | ../../docs/sman.ctr -------------------------------------------------------------------------------- /autohell/scripts/basemods: -------------------------------------------------------------------------------- 1 | ../../basemods -------------------------------------------------------------------------------- /autohell/src/compiler.c: -------------------------------------------------------------------------------- 1 | ../../compiler.c -------------------------------------------------------------------------------- /autohell/src/coroutine.c: -------------------------------------------------------------------------------- 1 | ../../coroutine.c -------------------------------------------------------------------------------- /autohell/src/coroutine.h: -------------------------------------------------------------------------------- 1 | ../../coroutine.h -------------------------------------------------------------------------------- /autohell/src/dictionary.h: -------------------------------------------------------------------------------- 1 | ../../dictionary.h -------------------------------------------------------------------------------- /autohell/src/generator.c: -------------------------------------------------------------------------------- 1 | ../../generator.c -------------------------------------------------------------------------------- /autohell/src/generator.h: -------------------------------------------------------------------------------- 1 | ../../generator.h -------------------------------------------------------------------------------- /autohell/src/importlib.c: -------------------------------------------------------------------------------- 1 | ../../importlib.c -------------------------------------------------------------------------------- /autohell/src/lexer_plug.c: -------------------------------------------------------------------------------- 1 | ../../lexer_plug.c -------------------------------------------------------------------------------- /autohell/src/linkedlist.c: -------------------------------------------------------------------------------- 1 | ../../linkedlist.c -------------------------------------------------------------------------------- /autohell/src/memory-ngc.h: -------------------------------------------------------------------------------- 1 | ../../memory-ngc.h -------------------------------------------------------------------------------- /autohell/src/pcre_split.h: -------------------------------------------------------------------------------- 1 | ../../pcre_split.h -------------------------------------------------------------------------------- /tests/test0004.exp: -------------------------------------------------------------------------------- 1 | hohohohoho[a:Object] 2 | -------------------------------------------------------------------------------- /tests/test0014.exp: -------------------------------------------------------------------------------- 1 | ONETWOTHREEFOURTHREE 2 | -------------------------------------------------------------------------------- /tests/test0022.exp: -------------------------------------------------------------------------------- 1 | YepYepYepYepYepYep 2 | -------------------------------------------------------------------------------- /tests/test0029.exp: -------------------------------------------------------------------------------- 1 | firstsecond6653.5 2 | -------------------------------------------------------------------------------- /tests/test0045.exp: -------------------------------------------------------------------------------- 1 | hi there!got ya!oops 2 | -------------------------------------------------------------------------------- /tests/test0057.exp: -------------------------------------------------------------------------------- 1 | coffeebeercoffeebeer 2 | -------------------------------------------------------------------------------- /tests/test0064.exp: -------------------------------------------------------------------------------- 1 | equalunequalunequal 2 | -------------------------------------------------------------------------------- /tests/test0067.exp: -------------------------------------------------------------------------------- 1 | 530-1-1021212130 2 | -------------------------------------------------------------------------------- /tests/test0085.exp: -------------------------------------------------------------------------------- 1 | 9 2 | 36 3 | 7 4 | 8 5 | -------------------------------------------------------------------------------- /tests/test0101.exp: -------------------------------------------------------------------------------- 1 | value = Hello World! 2 | -------------------------------------------------------------------------------- /tests/test0159.exp: -------------------------------------------------------------------------------- 1 | Leaking memory... 2 | -------------------------------------------------------------------------------- /tests/test0160.exp: -------------------------------------------------------------------------------- 1 | Leaking memory... 2 | -------------------------------------------------------------------------------- /tests/test0161.exp: -------------------------------------------------------------------------------- 1 | Leaking memory... 2 | -------------------------------------------------------------------------------- /tests/test0170.exp: -------------------------------------------------------------------------------- 1 | Leaking memory... 2 | -------------------------------------------------------------------------------- /tests/test0185.exp: -------------------------------------------------------------------------------- 1 | Leaking memory... 2 | -------------------------------------------------------------------------------- /tests/test0197.exp: -------------------------------------------------------------------------------- 1 | hi there!got ya!oops 2 | -------------------------------------------------------------------------------- /tests/test0230.exp: -------------------------------------------------------------------------------- 1 | The cat goes meow 2 | -------------------------------------------------------------------------------- /tests/test0237.exp: -------------------------------------------------------------------------------- 1 | helloworldtreasure9 2 | -------------------------------------------------------------------------------- /tests/test0249.exp: -------------------------------------------------------------------------------- 1 | abc` 2 | 기나 긴 여행 3 | -------------------------------------------------------------------------------- /tests/test0250.exp: -------------------------------------------------------------------------------- 1 | Array ← 1 ; 2 ; 3 2 | -------------------------------------------------------------------------------- /Library/Data/Array/main.ctr: -------------------------------------------------------------------------------- 1 | import Utils. 2 | -------------------------------------------------------------------------------- /Library/Graphics/SDL/main.ctr: -------------------------------------------------------------------------------- 1 | import gfx. 2 | -------------------------------------------------------------------------------- /autohell/compile: -------------------------------------------------------------------------------- 1 | /usr/share/automake-1.15/compile -------------------------------------------------------------------------------- /autohell/depcomp: -------------------------------------------------------------------------------- 1 | /usr/share/automake-1.15/depcomp -------------------------------------------------------------------------------- /autohell/doc/ctr.html_e: -------------------------------------------------------------------------------- 1 | ../../docs/ctr.html_e -------------------------------------------------------------------------------- /autohell/doc/ctrstyle.css: -------------------------------------------------------------------------------- 1 | ../../docs/ctrstyle.css -------------------------------------------------------------------------------- /autohell/doc/doxygen.conf: -------------------------------------------------------------------------------- 1 | ../../docs/doxygen.conf -------------------------------------------------------------------------------- /autohell/doc/grammar.txt: -------------------------------------------------------------------------------- 1 | ../../docs/grammar.txt -------------------------------------------------------------------------------- /autohell/missing: -------------------------------------------------------------------------------- 1 | /usr/share/automake-1.15/missing -------------------------------------------------------------------------------- /autohell/scripts/sdl.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/sdl.ctr -------------------------------------------------------------------------------- /autohell/src/citron_conv.h: -------------------------------------------------------------------------------- 1 | ../../citron_conv.h -------------------------------------------------------------------------------- /autohell/src/collections.c: -------------------------------------------------------------------------------- 1 | ../../collections.c -------------------------------------------------------------------------------- /autohell/src/compilerstub.c: -------------------------------------------------------------------------------- 1 | ../../compilerstub.c -------------------------------------------------------------------------------- /autohell/src/memory-boehm.h: -------------------------------------------------------------------------------- 1 | ../../memory-boehm.h -------------------------------------------------------------------------------- /tests/test0028.exp: -------------------------------------------------------------------------------- 1 | yesa1x3.5yTruezFalseNil2 2 | -------------------------------------------------------------------------------- /tests/test0054.exp: -------------------------------------------------------------------------------- 1 | Found argument file.Nil 2 | -------------------------------------------------------------------------------- /tests/test0055.exp: -------------------------------------------------------------------------------- 1 | These tests are silent. 2 | -------------------------------------------------------------------------------- /tests/test0076.exp: -------------------------------------------------------------------------------- 1 | 3,2,1 2 | 1,2,3 3 | 3,2,1 4 | -------------------------------------------------------------------------------- /tests/test0083.exp: -------------------------------------------------------------------------------- 1 | meow 2 | munch! munch! 3 | -------------------------------------------------------------------------------- /tests/test0088.exp: -------------------------------------------------------------------------------- 1 | hohoho 2 | True 3 | 9 4 | -------------------------------------------------------------------------------- /tests/test0110.exp: -------------------------------------------------------------------------------- 1 | Test the exit message 2 | -------------------------------------------------------------------------------- /tests/test0121.exp: -------------------------------------------------------------------------------- 1 | Append this to a String 2 | -------------------------------------------------------------------------------- /tests/test0129.exp: -------------------------------------------------------------------------------- 1 | 6 2 | 64 3 | -20 4 | -1 5 | -------------------------------------------------------------------------------- /tests/test0138.exp: -------------------------------------------------------------------------------- 1 | Used memory not stable. 2 | -------------------------------------------------------------------------------- /tests/test0196.exp: -------------------------------------------------------------------------------- 1 | her royal highness Diva 2 | -------------------------------------------------------------------------------- /tests/test0263.exp: -------------------------------------------------------------------------------- 1 | Visitor 2 | Hello Visitor 3 | -------------------------------------------------------------------------------- /tests/test0281.exp: -------------------------------------------------------------------------------- 1 | 1 [] 2 | 1 (S emicolo n) 3 | -------------------------------------------------------------------------------- /autohell/scripts/heap.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/heap.ctr -------------------------------------------------------------------------------- /autohell/scripts/json.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/json.ctr -------------------------------------------------------------------------------- /autohell/scripts/print.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/print.ctr -------------------------------------------------------------------------------- /autohell/scripts/teash.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/teash.ctr -------------------------------------------------------------------------------- /autohell/src/base_extensions.c: -------------------------------------------------------------------------------- 1 | ../../base_extensions.c -------------------------------------------------------------------------------- /autohell/src/citron_ensure.h: -------------------------------------------------------------------------------- 1 | ../../citron_ensure.h -------------------------------------------------------------------------------- /autohell/src/compilerutils.c: -------------------------------------------------------------------------------- 1 | ../../compilerutils.c -------------------------------------------------------------------------------- /autohell/src/ctr_constants.c: -------------------------------------------------------------------------------- 1 | ../../ctr_constants.c -------------------------------------------------------------------------------- /autohell/src/grapheme_break.c: -------------------------------------------------------------------------------- 1 | ../../grapheme_break.c -------------------------------------------------------------------------------- /mods/request/.gitkeep: -------------------------------------------------------------------------------- 1 | placeholder for request.so 2 | -------------------------------------------------------------------------------- /tests/test0005.ctr: -------------------------------------------------------------------------------- 1 | 5 times: { :i Pen write: i. }. 2 | -------------------------------------------------------------------------------- /tests/test0008.exp: -------------------------------------------------------------------------------- 1 | setting a nameHellosunshine! 2 | -------------------------------------------------------------------------------- /tests/test0009.exp: -------------------------------------------------------------------------------- 1 | setting a nameHellosunshine! 2 | -------------------------------------------------------------------------------- /tests/test0026.exp: -------------------------------------------------------------------------------- 1 | 5104ellllollo字形聲63OrganWorks 2 | -------------------------------------------------------------------------------- /tests/test0044.exp: -------------------------------------------------------------------------------- 1 | 12world12hellothere2merryxmas 2 | -------------------------------------------------------------------------------- /tests/test0046.exp: -------------------------------------------------------------------------------- 1 | Cats have personel for that! 2 | -------------------------------------------------------------------------------- /tests/test0047.exp: -------------------------------------------------------------------------------- 1 | Cats have personel for that! 2 | -------------------------------------------------------------------------------- /tests/test0048.exp: -------------------------------------------------------------------------------- 1 | Cats have personel for that! 2 | -------------------------------------------------------------------------------- /tests/test0049.exp: -------------------------------------------------------------------------------- 1 | /tmp/test.txtHello!World!!1200 2 | -------------------------------------------------------------------------------- /tests/test0102.exp: -------------------------------------------------------------------------------- 1 | TrueTrueTrueFalseTrueFalse 2 | -------------------------------------------------------------------------------- /tests/test0150.ctr: -------------------------------------------------------------------------------- 1 | #Test empty block okay 2 | {}. 3 | -------------------------------------------------------------------------------- /tests/test0184.exp: -------------------------------------------------------------------------------- 1 | 282282282Leaking memory... 2 | -------------------------------------------------------------------------------- /tests/test0198.exp: -------------------------------------------------------------------------------- 1 | Cats have personel for that! 2 | -------------------------------------------------------------------------------- /Library/Data/main.ctr: -------------------------------------------------------------------------------- 1 | import Array Iterator Map Set. 2 | -------------------------------------------------------------------------------- /autohell/config.guess: -------------------------------------------------------------------------------- 1 | /usr/share/automake-1.15/config.guess -------------------------------------------------------------------------------- /autohell/config.sub: -------------------------------------------------------------------------------- 1 | /usr/share/automake-1.15/config.sub -------------------------------------------------------------------------------- /autohell/install-sh: -------------------------------------------------------------------------------- 1 | /usr/share/automake-1.15/install-sh -------------------------------------------------------------------------------- /autohell/ltmain.sh: -------------------------------------------------------------------------------- 1 | /usr/share/libtool/build-aux/ltmain.sh -------------------------------------------------------------------------------- /autohell/scripts/iterable.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/iterable.ctr -------------------------------------------------------------------------------- /autohell/scripts/requests.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/requests.ctr -------------------------------------------------------------------------------- /autohell/scripts/string.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/string.ctr -------------------------------------------------------------------------------- /autohell/scripts/stringio.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/stringio.ctr -------------------------------------------------------------------------------- /autohell/src/ctr_preprocessor.c: -------------------------------------------------------------------------------- 1 | ../../ctr_preprocessor.c -------------------------------------------------------------------------------- /tests/test0016.ctr: -------------------------------------------------------------------------------- 1 | a is 3 + 2 + 1. 2 | Pen write: a. 3 | -------------------------------------------------------------------------------- /tests/test0019.ctr: -------------------------------------------------------------------------------- 1 | Pen write: 'Hello', write: 'World'. 2 | -------------------------------------------------------------------------------- /tests/test0027.exp: -------------------------------------------------------------------------------- 1 | Length is:4Length is:5YesYesRunning 2 | -------------------------------------------------------------------------------- /tests/test0072.exp: -------------------------------------------------------------------------------- 1 | ho!ho!ooooowooo:wooo:wooo:lalalala 2 | -------------------------------------------------------------------------------- /tests/test0111.exp: -------------------------------------------------------------------------------- 1 | Block 1. 2 | Catch Block. 3 | a = 0 4 | -------------------------------------------------------------------------------- /tests/test0122.exp: -------------------------------------------------------------------------------- 1 | 10 / 2 = 5 2 | * 2 makes... 10 3 | -------------------------------------------------------------------------------- /tests/test0128.exp: -------------------------------------------------------------------------------- 1 | 24 2 | 10 3 | o2 4 | [sum:Block] 5 | -------------------------------------------------------------------------------- /tests/test0224.exp: -------------------------------------------------------------------------------- 1 | $$number of the Devil i$: 666 !!!! 2 | -------------------------------------------------------------------------------- /tests/test0226.exp: -------------------------------------------------------------------------------- 1 | Het Nederlands is een mooie taal. 2 | -------------------------------------------------------------------------------- /tests/test0231.exp: -------------------------------------------------------------------------------- 1 | hello world 2 | 3 | 4 | hi there 5 | -------------------------------------------------------------------------------- /tests/test0236.exp: -------------------------------------------------------------------------------- 1 | select * from users where id = 2 2 | -------------------------------------------------------------------------------- /tests/test0260.exp: -------------------------------------------------------------------------------- 1 | False 2 | False 3 | False 4 | False 5 | -------------------------------------------------------------------------------- /tests/test0267.exp: -------------------------------------------------------------------------------- 1 | aHello World How 2 | Are Ya ?\n 3 | -------------------------------------------------------------------------------- /tests/test0270.ctr: -------------------------------------------------------------------------------- 1 | q is (File list: 'nonexistant'). 2 | -------------------------------------------------------------------------------- /tests/test0272.exp: -------------------------------------------------------------------------------- 1 | | a | 2 | | a | 3 | -------------------------------------------------------------------------------- /autohell/scripts/fileutils.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/fileutils.ctr -------------------------------------------------------------------------------- /autohell/scripts/functional.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/functional.ctr -------------------------------------------------------------------------------- /autohell/scripts/importlib.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/importlib.ctr -------------------------------------------------------------------------------- /autohell/scripts/reflection.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/reflection.ctr -------------------------------------------------------------------------------- /autohell/scripts/switchcase.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/switchcase.ctr -------------------------------------------------------------------------------- /autohell/src/compcompat_pthread.h: -------------------------------------------------------------------------------- 1 | ../../compcompat_pthread.h -------------------------------------------------------------------------------- /examples/fun/#magic.lsp#: -------------------------------------------------------------------------------- 1 | ((defun test (lambda (a) a)) 10) 2 | -------------------------------------------------------------------------------- /examples/lol.test: -------------------------------------------------------------------------------- 1 | crap 2 | do 3 | shit 4 | done 5 | end 6 | -------------------------------------------------------------------------------- /examples/tuple.ctr: -------------------------------------------------------------------------------- 1 | var ra is [1]. 2 | Pen write: ra, brk. 3 | -------------------------------------------------------------------------------- /plugins/ffi/test/sample.c: -------------------------------------------------------------------------------- 1 | struct a { int a; char* b; } foo; 2 | -------------------------------------------------------------------------------- /tests/test0035.exp: -------------------------------------------------------------------------------- 1 | Can we escape a string with 'quotes' ? 2 | -------------------------------------------------------------------------------- /tests/test0050.ctr: -------------------------------------------------------------------------------- 1 | Pen write: (Shell call: 'echo hello'). 2 | -------------------------------------------------------------------------------- /tests/test0071.exp: -------------------------------------------------------------------------------- 1 | 1|2|3 2 | Hello,World,123,[:Object],Nil 3 | -------------------------------------------------------------------------------- /tests/test0074.exp: -------------------------------------------------------------------------------- 1 | Array:1,2,3,4,5,6 2 | Array:4,5,6,1,2,3 3 | -------------------------------------------------------------------------------- /tests/test0092.exp: -------------------------------------------------------------------------------- 1 | local 2 | global 3 | Hello World 4 | Bye 5 | -------------------------------------------------------------------------------- /tests/test0219.ctr: -------------------------------------------------------------------------------- 1 | a is Program input. 2 | Pen write: a, brk. -------------------------------------------------------------------------------- /tests/test0227.exp: -------------------------------------------------------------------------------- 1 | #1 = b 2 | #2 = c 3 | #3 = d 4 | #4 = e 5 | -------------------------------------------------------------------------------- /tests/test0261.exp: -------------------------------------------------------------------------------- 1 | ---- 2 | Message quota cannot change. 3 | -------------------------------------------------------------------------------- /autohell/scripts/ccompletion.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/ccompletion.ctr -------------------------------------------------------------------------------- /autohell/scripts/collections.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/collections.ctr -------------------------------------------------------------------------------- /autohell/scripts/documentation.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/documentation.ctr -------------------------------------------------------------------------------- /integration/pygments/CitronLexer/.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info 2 | *.pyc 3 | -------------------------------------------------------------------------------- /tests/test0002.ctr: -------------------------------------------------------------------------------- 1 | Pen write: 'Hello'. 2 | Pen write: 'World!'. 3 | -------------------------------------------------------------------------------- /tests/test0021.exp: -------------------------------------------------------------------------------- 1 | Yes, nine is less than ten.403Not true!Yep 2 | -------------------------------------------------------------------------------- /tests/test0037.exp: -------------------------------------------------------------------------------- 1 | a = 2 b = 3 a = 3 b = 7 x = 13 y = 2 p = 6 2 | -------------------------------------------------------------------------------- /tests/test0043.exp: -------------------------------------------------------------------------------- 1 | repeat everything:I say. and:everything:I do. 2 | -------------------------------------------------------------------------------- /tests/test0058.exp: -------------------------------------------------------------------------------- 1 | hi!xhello a = 22 and q = 2 and x = 2hello 2 | -------------------------------------------------------------------------------- /tests/test0063.exp: -------------------------------------------------------------------------------- 1 | Apples cost: cost 60 cent a piece.0123456 2 | -------------------------------------------------------------------------------- /tests/test0084.exp: -------------------------------------------------------------------------------- 1 | 101 2 | 102 3 | 103 4 | 101 5 | 102 6 | 103 7 | -------------------------------------------------------------------------------- /tests/test0096.exp: -------------------------------------------------------------------------------- 1 | Apples cost: cost 60 cent a piece.0123456 2 | -------------------------------------------------------------------------------- /tests/test0115.exp: -------------------------------------------------------------------------------- 1 | Caught!Caught!Caught!Caught!Nested Caught! 2 | -------------------------------------------------------------------------------- /tests/test0116.exp: -------------------------------------------------------------------------------- 1 | I can handle out-of-bound Command arguments. 2 | -------------------------------------------------------------------------------- /tests/test0172.exp: -------------------------------------------------------------------------------- 1 | True|Nil2True|Nil2True|Nil2Leaking memory... 2 | -------------------------------------------------------------------------------- /tests/test0240.exp: -------------------------------------------------------------------------------- 1 | 25.6 2 | 5 apples and 3 oranges 3 | ❤❤❤❤❤❤ 4 | -------------------------------------------------------------------------------- /tests/test0264.ctr: -------------------------------------------------------------------------------- 1 | Program forbidFork. 2 | Program new: { }. 3 | -------------------------------------------------------------------------------- /tests/test0268.exp: -------------------------------------------------------------------------------- 1 | timeout: the monitored command dumped core 2 | -------------------------------------------------------------------------------- /Library/Functional/Monad/main.ctr: -------------------------------------------------------------------------------- 1 | import Either Maybe Array Block. 2 | -------------------------------------------------------------------------------- /autohell/examples/fun/#magic.lsp#: -------------------------------------------------------------------------------- 1 | ((defun test (lambda (a) a)) 10) 2 | -------------------------------------------------------------------------------- /autohell/examples/lol.test: -------------------------------------------------------------------------------- 1 | crap 2 | do 3 | shit 4 | done 5 | end 6 | -------------------------------------------------------------------------------- /autohell/examples/tuple.ctr: -------------------------------------------------------------------------------- 1 | var ra is [1]. 2 | Pen write: ra, brk. 3 | -------------------------------------------------------------------------------- /autohell/scripts/multiprocessing.ctr: -------------------------------------------------------------------------------- 1 | ../../extensions/multiprocessing.ctr -------------------------------------------------------------------------------- /python/test.ctr: -------------------------------------------------------------------------------- 1 | Pen write: (String randomizeBytesWithLength: 10). 2 | -------------------------------------------------------------------------------- /tests/test0003.ctr: -------------------------------------------------------------------------------- 1 | greeter is 'Hello World'. 2 | Pen write: greeter. 3 | -------------------------------------------------------------------------------- /tests/test0149.ctr: -------------------------------------------------------------------------------- 1 | #NOAST 2 | #Test Parser error 3 | a is ( 3 + 2. 4 | -------------------------------------------------------------------------------- /tests/test0152.ctr: -------------------------------------------------------------------------------- 1 | #NOAST 2 | #Test parser error 3 | var is. 4 | 5 | -------------------------------------------------------------------------------- /tests/test0274.exp: -------------------------------------------------------------------------------- 1 | Array ← 2 ; 5 ; 8 2 | Array new 3 | Array new 4 | -------------------------------------------------------------------------------- /tests/test0280.exp: -------------------------------------------------------------------------------- 1 | (Map new) put:'key' at:'test', put:'123' at:123 2 | -------------------------------------------------------------------------------- /tests/test0001.ctr: -------------------------------------------------------------------------------- 1 | #this is a comment 2 | Pen write: 'Hello World'. 3 | 4 | -------------------------------------------------------------------------------- /tests/test0035.ctr: -------------------------------------------------------------------------------- 1 | Pen write: 'Can we escape a string with \'quotes\' ?'. 2 | -------------------------------------------------------------------------------- /tests/test0040.ctr: -------------------------------------------------------------------------------- 1 | x is 5. 2 | x times: { x +=: 1. }. 3 | Pen write: x. 4 | -------------------------------------------------------------------------------- /tests/test0056.exp: -------------------------------------------------------------------------------- 1 | 22Unknown method Nil::'value' was called2hello5True 2 | -------------------------------------------------------------------------------- /tests/test0097.ctr: -------------------------------------------------------------------------------- 1 | ?> 2 | 3 | 4 |

Hello this is a {Pen write: i, brk.} 5 | }. 6 | }% 7 | -------------------------------------------------------------------------------- /tests/plg.py: -------------------------------------------------------------------------------- 1 | x=2 2 | for _ in range(21): 3 | x *= x 4 | print ("21 times x*=x, xi=2 has %s digits" % (len(str(x)),)) 5 | -------------------------------------------------------------------------------- /tests/test0187.exp: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | 8 4 | 7 5 | 2 6 | 3 7 | 8 8 | 7 9 | 2 10 | 3 11 | 8 12 | 7 13 | Leaking memory... 14 | -------------------------------------------------------------------------------- /tests/test0233.ctr: -------------------------------------------------------------------------------- 1 | #Test Slurp in combination with Shell 2 | Pen write: ( Shell call: ( Slurp echo hello world obtain ) ). 3 | -------------------------------------------------------------------------------- /tests/test0245.ctr: -------------------------------------------------------------------------------- 1 | #relaxed eval 2 | var calc is 'x is ((3 pow: 2) + 2 - 1 * 7 / (25 sqrt))'. 3 | Pen write: calc eval, brk. 4 | -------------------------------------------------------------------------------- /tests/test0256.exp: -------------------------------------------------------------------------------- 1 | Child says: hello 2 | Child says: hello 3 | Child says: hello 4 | Child says: hello 5 | Child says: hello 6 | -------------------------------------------------------------------------------- /examples/shit/.ropeproject/globalnames: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/examples/shit/.ropeproject/globalnames -------------------------------------------------------------------------------- /tests/test0069.exp: -------------------------------------------------------------------------------- 1 | 9897NilNil 2 | left trimmed and right trimmed! 3 | <html>"html & entities"</html> 4 | -------------------------------------------------------------------------------- /tests/test0155.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Parser error, unexpected ^ ( tests/test0155.ctr: 3) 3 | -> Expected message. 4 | -------------------------------------------------------------------------------- /tests/test0223.exp: -------------------------------------------------------------------------------- 1 | True 2 | False 3 | True 4 | False 5 | True 6 | False 7 | True 8 | missing terminating ] for character class 9 | -------------------------------------------------------------------------------- /tests/test0224.ctr: -------------------------------------------------------------------------------- 1 | x is 6. 2 | who is 'the Devil'. 3 | ?>{$$the} Expected a dot (.). 4 | -------------------------------------------------------------------------------- /tests/test0148.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Parser error, unexpected { ( tests/test0148.ctr: 3) 3 | -> Expected a dot (.). 4 | -------------------------------------------------------------------------------- /tests/test0151.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Parser error, unexpected } ( tests/test0151.ctr: 6) 3 | -> Expected a dot (.). 4 | -------------------------------------------------------------------------------- /tests/test0210.ctr: -------------------------------------------------------------------------------- 1 | #can we forbid a program to write to disk ? 2 | Program forbidFileWrite. 3 | File new: '/tmp/bla.txt'. 4 | File delete. -------------------------------------------------------------------------------- /tests/test0213.ctr: -------------------------------------------------------------------------------- 1 | #Can we forbid a program to include other programs ? 2 | Program forbidInclude. 3 | File new: 'test.ctr', include. 4 | -------------------------------------------------------------------------------- /autohell/examples/shit/.ropeproject/history: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/autohell/examples/shit/.ropeproject/history -------------------------------------------------------------------------------- /autohell/examples/shit/.ropeproject/objectdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/autohell/examples/shit/.ropeproject/objectdb -------------------------------------------------------------------------------- /examples/fun/lisp.scm: -------------------------------------------------------------------------------- 1 | (begin 2 | (define fact (lambda (n) 3 | (if (<= n 1) 1 (* n (fact (- n 1)))))) 4 | 5 | (display (fact 5)) 6 | ) 7 | -------------------------------------------------------------------------------- /examples/serialization/.ropeproject/history: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/examples/serialization/.ropeproject/history -------------------------------------------------------------------------------- /examples/serialization/.ropeproject/objectdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/examples/serialization/.ropeproject/objectdb -------------------------------------------------------------------------------- /tests/test0024.ctr: -------------------------------------------------------------------------------- 1 | (3 between: 1 and: 20 ) ifTrue: { Pen write: 'Yes.'. }. 2 | (3 between: 19 and: 20 ) ifTrue: { Pen write: 'Yes.'. }. 3 | -------------------------------------------------------------------------------- /tests/test0216.ctr: -------------------------------------------------------------------------------- 1 | #forbid file read also forbids reading environment vars 2 | Program forbidFileRead. 3 | a is Program env: 'QUERY_STRING'. -------------------------------------------------------------------------------- /tests/test0258.exp: -------------------------------------------------------------------------------- 1 | True 2 | True 3 | True 4 | True 5 | True 6 | True 7 | True 8 | True 9 | Other process 10 | False 11 | True 12 | -------------------------------------------------------------------------------- /autohell/examples/shit/.ropeproject/globalnames: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/autohell/examples/shit/.ropeproject/globalnames -------------------------------------------------------------------------------- /examples/serialization/.ropeproject/globalnames: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/examples/serialization/.ropeproject/globalnames -------------------------------------------------------------------------------- /tests/test0139.ctr: -------------------------------------------------------------------------------- 1 | #Test whether we can set memory limit and create an out-of-memory error 2 | Broom memoryLimit: 10. #wat too low 3 | a is 1. 4 | -------------------------------------------------------------------------------- /tests/test0149.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Parser error, unexpected end of program ( tests/test0149.ctr: 4) 3 | -> Expected a dot (.). 4 | -------------------------------------------------------------------------------- /tests/test0153.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Parser error, unexpected end of program ( tests/test0153.ctr: 3) 3 | -> Expected a dot (.). 4 | -------------------------------------------------------------------------------- /tests/test0154.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Parser error, unexpected . ( tests/test0154.ctr: 3) 3 | -> Expected a message recipient. 4 | -------------------------------------------------------------------------------- /tests/test0193.ctr: -------------------------------------------------------------------------------- 1 | # Proper parse error with line number 2 | a is ' 3 | line number 4... '. 4 | Pen write: 'testje.ctr' + grep: 'Shell'. 5 | 6 | -------------------------------------------------------------------------------- /tests/test0208.ctr: -------------------------------------------------------------------------------- 1 | #can we forbid a program to write to disk ? 2 | Program forbidFileWrite. 3 | File new: '/tmp/bla.txt'. 4 | File write: 'Hello'. -------------------------------------------------------------------------------- /tests/test0209.ctr: -------------------------------------------------------------------------------- 1 | #can we forbid a program to write to disk ? 2 | Program forbidFileWrite. 3 | File new: '/tmp/bla.txt'. 4 | File append: 'Hello'. -------------------------------------------------------------------------------- /tests/test0221.exp: -------------------------------------------------------------------------------- 1 | -rood|-rood 2 | -groen|-groen 3 | -blauw|-blauw 4 | -rood|-rood 5 | 6 | -groen|-groen 7 | 8 | -blauw|-blauw 9 | -------------------------------------------------------------------------------- /tests/test0228.ctr: -------------------------------------------------------------------------------- 1 | #Can we use +=: to append to strings? 2 | var str is 'Hello'. 3 | str +=: ' '. 4 | str +=: 'World'. 5 | Pen write: str, brk. 6 | -------------------------------------------------------------------------------- /tests/test0230.ctr: -------------------------------------------------------------------------------- 1 | #String interpolation doesn't work at the end of string #85 2 | catcall is 'meow'. 3 | Pen write: 'The cat goes $$catcall'. 4 | -------------------------------------------------------------------------------- /tests/test0250.ctr: -------------------------------------------------------------------------------- 1 | #Test Array with arrow symbol notation 2 | a is Array ← 1 ; 2 ; 3. #Can we form an array using ← ? 3 | Pen write: a, brk. 4 | -------------------------------------------------------------------------------- /autohell/examples/fun/lisp.scm: -------------------------------------------------------------------------------- 1 | (begin 2 | (define fact (lambda (n) 3 | (if (<= n 1) 1 (* n (fact (- n 1)))))) 4 | 5 | (display (fact 5)) 6 | ) 7 | -------------------------------------------------------------------------------- /extensions/reflection.ctr: -------------------------------------------------------------------------------- 1 | Object on: 'setProperty:to:' do: { :pn :val 2 | Reflect addPrivateVariable: pn. 3 | Reflect set: pn to: val. 4 | }. 5 | -------------------------------------------------------------------------------- /tests/ptest/main.ctr: -------------------------------------------------------------------------------- 1 | Reflect addGlobalVariable: 'Test'. 2 | Test is Object new. 3 | Test on: 'woot' do: {Pen write: 'Test woot\'d', brk. ^'Woot'.}. 4 | -------------------------------------------------------------------------------- /tests/test0023.ctr: -------------------------------------------------------------------------------- 1 | Pen write: 2 + 3 factorial. 2 | Pen write: 60 * 30 + 3 / 2. 3 | Pen write: 20 + 5 * 4 - 10. 4 | Pen write: 20 + ( 5 * 4 ) - 10. 5 | -------------------------------------------------------------------------------- /tests/test0079.ctr: -------------------------------------------------------------------------------- 1 | time is Clock new time. 2 | Clock wait: 1 sec. 3 | time2 is Clock new time. 4 | (time2 > time) ifTrue: { Pen write: 'T1 < T2'. }. 5 | -------------------------------------------------------------------------------- /tests/test0121.ctr: -------------------------------------------------------------------------------- 1 | #Test String append message 2 | x is 'Append this'. 3 | y is 'to a String'. 4 | Pen write: ('' append: x, append: ' ', append: y). 5 | -------------------------------------------------------------------------------- /tests/test0211.ctr: -------------------------------------------------------------------------------- 1 | #can we forbid a program to write to disk ? 2 | Program forbidFileWrite. 3 | File new: '/tmp/bla.txt'. 4 | File writeBytes: 'Hello'. -------------------------------------------------------------------------------- /tests/test0217.ctr: -------------------------------------------------------------------------------- 1 | #forbid file read also forbids reading environment vars 2 | Program forbidFileWrite. 3 | a is Program env: 'QUERY_STRING' val: 123. -------------------------------------------------------------------------------- /tests/test0280.ctr: -------------------------------------------------------------------------------- 1 | x is Map new put: 'test' at: 'key', put: 123 at: '123'. 2 | x is x kvmap: {:kv ^kv reverse.}. 3 | 4 | Pen write: x, brk. 5 | 6 | -------------------------------------------------------------------------------- /autohell/examples/serialization/.ropeproject/history: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/autohell/examples/serialization/.ropeproject/history -------------------------------------------------------------------------------- /python/citron/parser/__pycache__/ast.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/python/citron/parser/__pycache__/ast.cpython-36.pyc -------------------------------------------------------------------------------- /tests/test0125.exp: -------------------------------------------------------------------------------- 1 | file contains: hello 2 | read 2 bytes: "he" 3 | read 3 more bytes: "llo" 4 | Bytes written: 8 5 | Finally, file contains: hello friend! 6 | -------------------------------------------------------------------------------- /tests/test0206.ctr: -------------------------------------------------------------------------------- 1 | #test whether can fire custom messages to objects - error message test 2 | str is 'write:'. 3 | Pen message: 'write:' arguments: 0. 4 | -------------------------------------------------------------------------------- /tests/test0272.ctr: -------------------------------------------------------------------------------- 1 | str is 'a' paddingLeft: 10. 2 | Pen write: '| $$str |', brk. 3 | str is 'a' paddingRight: 10. 4 | Pen write: '| $$str |', brk. 5 | 6 | -------------------------------------------------------------------------------- /tests/test0283.ctr: -------------------------------------------------------------------------------- 1 | var o is Object new. 2 | 50 times: {:i 3 | o on: 'test$$i' do: {^const i + 100.}. 4 | }. 5 | 6 | Pen write: (o test49), brk. 7 | 8 | -------------------------------------------------------------------------------- /autohell/examples/serialization/.ropeproject/objectdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/autohell/examples/serialization/.ropeproject/objectdb -------------------------------------------------------------------------------- /python/citron/parser/__pycache__/token.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/python/citron/parser/__pycache__/token.cpython-36.pyc -------------------------------------------------------------------------------- /tests/test0266.ctr: -------------------------------------------------------------------------------- 1 | #Can we use String contains:? 2 | Pen write: ('Hello World' contains: 'World'), brk. 3 | Pen write: ('Hello World' contains: 'Bye'), brk. 4 | -------------------------------------------------------------------------------- /autohell/examples/serialization/.ropeproject/globalnames: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/citron/master/autohell/examples/serialization/.ropeproject/globalnames -------------------------------------------------------------------------------- /examples/pragma.ctr: -------------------------------------------------------------------------------- 1 | #:oneLineExpressions 2 | Pen on: 'test' do: { Pen write: 'test\n'. ^me. } 3 | Pen test 4 | #:oneLineExpressions 5 | 6 | Pen do test done. 7 | 8 | -------------------------------------------------------------------------------- /tests/test0071.ctr: -------------------------------------------------------------------------------- 1 | a is Array < 1 ; 2 ; 3. 2 | Pen write: (a join: '|'), brk. 3 | Pen write: ((Array < 'Hello' ; 'World' ; 123 ; (Object new) ; Nil) join: ','). 4 | -------------------------------------------------------------------------------- /tests/test0105.ctr: -------------------------------------------------------------------------------- 1 | #Test pipelines 2 | mapUp is { :i :v :m m put: ((m @ i) upper) at: i. }. 3 | a is 'lololol' split: 'o', map: mapUp, join: 'x'. 4 | Pen write: a. 5 | -------------------------------------------------------------------------------- /tests/test0181.exp: -------------------------------------------------------------------------------- 1 | this text contains: 2 words. 2 | Sala 3 | this text contains: 2 words. 4 | Sala 5 | this text contains: 2 words. 6 | Sala 7 | Leaking memory... 8 | -------------------------------------------------------------------------------- /tests/test0247.exp: -------------------------------------------------------------------------------- 1 | Array ← 97 ; 98 ; 99 2 | 3 3 | Array ← 234 ; 184 ; 176 ; 235 ; 130 ; 152 ; 32 ; 234 ; 184 ; 180 ; 32 ; 236 ; 151 ; 172 ; 237 ; 150 ; 137 4 | 17 5 | -------------------------------------------------------------------------------- /plugins/request/ccgi-1.2/examples/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -I .. 2 | 3 | dump.cgi: dump.cgi.o 4 | $(CC) -o dump.cgi dump.cgi.o -L .. -lccgi 5 | 6 | dump.cgi.o: dump.cgi.c 7 | -------------------------------------------------------------------------------- /tests/test0060.exp: -------------------------------------------------------------------------------- 1 | HelloWorld 2 | 2 left in array. 3 | WorldHelloNil 4 | 0 left in array. 5 | Nil 6 | 2 left in array. 7 | HiThere 8 | 0 left in array. 9 | Nil 10 | -------------------------------------------------------------------------------- /tests/test0064.ctr: -------------------------------------------------------------------------------- 1 | ('b' = 'b') ifTrue: { Pen write: 'equal'.}. 2 | ('a' !=: 'b') ifTrue: { Pen write: 'unequal'.}. 3 | ('a' !=: 'b') ifTrue: { Pen write: 'unequal'.}. 4 | -------------------------------------------------------------------------------- /tests/test0214.ctr: -------------------------------------------------------------------------------- 1 | #Can we kill a program with a limited number of ticks ? 2 | Program remainingMessages: 15. 3 | 200 times: { :i 4 | Pen write: i, brk. 5 | }. 6 | 7 | -------------------------------------------------------------------------------- /tests/test0227.ctr: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | q is ('a,b,c,d,e' split: ','). 5 | 6 | q shift. 7 | q each: { :i :x 8 | 9 | Pen write: '#' + i + ' = ' + x, brk. 10 | }. 11 | -------------------------------------------------------------------------------- /tests/test0243.ctr: -------------------------------------------------------------------------------- 1 | #Test eval whitelist custom message 2 | 3 | x is Object new. 4 | x on: 'test' do: { ^ True. }. 5 | 6 | (x test) ifTrue: { 7 | 'x test' eval. 8 | }. 9 | -------------------------------------------------------------------------------- /autohell/examples/pragma.ctr: -------------------------------------------------------------------------------- 1 | #:oneLineExpressions 2 | Pen on: 'test' do: { Pen write: 'test\n'. ^me. } 3 | Pen test 4 | #:oneLineExpressions 5 | 6 | Pen do test done. 7 | 8 | -------------------------------------------------------------------------------- /tests/test0082.ctr: -------------------------------------------------------------------------------- 1 | Butler is Object new. 2 | Butler on: 'greet:' do: { :name 3 | Pen write: 'Welcome ' + name. 4 | }. 5 | james is Butler new. 6 | james greet: 'visitor'. 7 | -------------------------------------------------------------------------------- /tests/test0141.ctr: -------------------------------------------------------------------------------- 1 | #NOAST 2 | #Test stacktrace over multiple files 3 | Pen write: 'Test Stack trace over multiple files.', brk. 4 | File new: 'tests/test0140.ctr', include. 5 | -------------------------------------------------------------------------------- /tests/test0182.exp: -------------------------------------------------------------------------------- 1 | 1.6 2 | True 3 | Number 4 | Boolean 5 | 1.6 6 | True 7 | Number 8 | Boolean 9 | 1.6 10 | True 11 | Number 12 | Boolean 13 | Leaking memory... 14 | -------------------------------------------------------------------------------- /examples/serialization/serializing.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | data = JSON.parse(File.read('generated (1).json')) 4 | stri = JSON.unparse(data) 5 | stri #Ruby's not lazy either! 6 | -------------------------------------------------------------------------------- /integration/jupyter_kernel/citronkernel/.ipynb_checkpoints/Untitled-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 2 6 | } 7 | -------------------------------------------------------------------------------- /misc/isgood.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | result=`./ctr $1` 3 | dest="${1:0: -4}.exp" 4 | touch $dest 5 | echo "$result" > $dest 6 | echo "Stored result of program in expectation file." 7 | -------------------------------------------------------------------------------- /tests/plg.ctr: -------------------------------------------------------------------------------- 1 | Broom autoAlloc: True. 2 | BigInteger. 3 | x is 2 toBigInt. 4 | 21 times: { x *=: x. }. 5 | Pen writeln: '21 times x*=:x xi=2 has %s digits' % [(x toString length)]. 6 | -------------------------------------------------------------------------------- /examples/serialization/serializing.py: -------------------------------------------------------------------------------- 1 | import json 2 | with open("generated (1).json") as js: 3 | ldd = json.load(js) 4 | (json.dumps(ldd)) #Python is not lazy, so this is fine 5 | 6 | -------------------------------------------------------------------------------- /tests/test0191.ctr: -------------------------------------------------------------------------------- 1 | #after a return statement, no statements may be executed 2 | Pen write: ( { 3 | Pen write: 'START', brk. 4 | ^ 'END'. 5 | Pen write: 'DONT', brk. 6 | } run ), brk. -------------------------------------------------------------------------------- /tests/test0236.ctr: -------------------------------------------------------------------------------- 1 | #Using Slurp for integration of other languages... 2 | query is Slurp new. 3 | query select: '*', from users where: 'id = 2'. 4 | Pen write: (query obtain), brk. 5 | -------------------------------------------------------------------------------- /autohell/examples/serialization/serializing.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | data = JSON.parse(File.read('generated (1).json')) 4 | stri = JSON.unparse(data) 5 | stri #Ruby's not lazy either! 6 | -------------------------------------------------------------------------------- /examples/shit.ctr: -------------------------------------------------------------------------------- 1 | var *** is Pen. 2 | *** on: '****:' do: {:s me `write: s.}. 3 | *** on: '*****' do: {me `brk.}. 4 | var ****** is {:*** *** ****: **, *****. }. 5 | ****** applyTo: 'lol'. 6 | -------------------------------------------------------------------------------- /tests/test0087.ctr: -------------------------------------------------------------------------------- 1 | #Test Closure 2 | multiplier is { :m ^ { :x ^ (my f * x). } set: 'f' value: m. }. 3 | double is multiplier applyTo: 2. 4 | q is double applyTo: 9. 5 | Pen write: q. #18 6 | -------------------------------------------------------------------------------- /tests/test0166.exp: -------------------------------------------------------------------------------- 1 | You should be able to append something to a string!You should be able to append something to a string!You should be able to append something to a string!Leaking memory... 2 | -------------------------------------------------------------------------------- /tests/test0271.ctr: -------------------------------------------------------------------------------- 1 | Pen 2 | red write: 'H', 3 | yellow write: 'e', 4 | green write: 'l', 5 | cyan write: 'l', 6 | blue write: 'o', 7 | purple write: '!', 8 | resetColor tab line brk. 9 | -------------------------------------------------------------------------------- /autohell/examples/serialization/serializing.py: -------------------------------------------------------------------------------- 1 | import json 2 | with open("generated (1).json") as js: 3 | ldd = json.load(js) 4 | (json.dumps(ldd)) #Python is not lazy, so this is fine 5 | 6 | -------------------------------------------------------------------------------- /tests/test0122.ctr: -------------------------------------------------------------------------------- 1 | #Test multiplyBy and divideBy 2 | x is 10. 3 | x /=: 2. 4 | Pen write: '10 / 2 = '. 5 | Pen write: x, brk. 6 | x *=: 2. 7 | Pen write: ' * 2 makes... '. 8 | Pen write: x, brk. 9 | -------------------------------------------------------------------------------- /autohell/examples/shit.ctr: -------------------------------------------------------------------------------- 1 | var *** is Pen. 2 | *** on: '****:' do: {:s me `write: s.}. 3 | *** on: '*****' do: {me `brk.}. 4 | var ****** is {:*** *** ****: **, *****. }. 5 | ****** applyTo: 'lol'. 6 | -------------------------------------------------------------------------------- /examples/shit/test.txt: -------------------------------------------------------------------------------- 1 | POST /149v5mv1 HTTP/1.1 2 | DICKHERE<<< 3 | Content-Disposition: form-data; name="upload"; filename="test" 4 | Content-Type: text/plain 5 | lol 6 | #RAD 7 | 8 | DICKHERE<<< 9 | -------------------------------------------------------------------------------- /tests/test0030.ctr: -------------------------------------------------------------------------------- 1 | #test assignment, strings etc copied by value: HelloHelloWorld 2 | a is 'Hello'. 3 | c is a. 4 | Pen write: a. 5 | c is 'World'. 6 | Pen write: a. 7 | a is '!'. 8 | Pen write: c. 9 | -------------------------------------------------------------------------------- /tests/test0112.ctr: -------------------------------------------------------------------------------- 1 | #Nil error should not be caught. 2 | { 3 | Pen write: 'Block 1.\n'. 4 | True break. 5 | Pen write: 'No'. 6 | } catch: { 7 | Pen write: 'You should not see me\n'. 8 | }, run. 9 | -------------------------------------------------------------------------------- /tests/test0222.ctr: -------------------------------------------------------------------------------- 1 | #Replace the sequences ell and rl with a * --> h*o wo*d 2 | var newString is ('hello world' findPattern: '([eor])([l]+)' do: { :match 3 | ^ '*'. 4 | }). 5 | Pen write: newString,brk. -------------------------------------------------------------------------------- /tests/test0257.ctr: -------------------------------------------------------------------------------- 1 | #Child may not join. 2 | x is Program new: { :child 3 | Pen write: 'hello1\n'. 4 | child join. 5 | Pen write: 'hello2\n'. 6 | }. 7 | 8 | x join. 9 | Program join. 10 | -------------------------------------------------------------------------------- /integration/jupyter_kernel/citronkernel/__main__.py: -------------------------------------------------------------------------------- 1 | from ipykernel.kernelapp import IPKernelApp 2 | from .citronkernel import CitronKernel 3 | 4 | IPKernelApp.launch_instance(kernel_class=CitronKernel) 5 | -------------------------------------------------------------------------------- /autohell/examples/shit/test.txt: -------------------------------------------------------------------------------- 1 | POST /149v5mv1 HTTP/1.1 2 | DICKHERE<<< 3 | Content-Disposition: form-data; name="upload"; filename="test" 4 | Content-Type: text/plain 5 | lol 6 | #RAD 7 | 8 | DICKHERE<<< 9 | -------------------------------------------------------------------------------- /plugins/ffi/test/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct a { 5 | int a; 6 | char* b; 7 | }; 8 | 9 | void test(struct a b) { 10 | printf("%d %s\n", b.a, b.b); 11 | } 12 | -------------------------------------------------------------------------------- /tests/test0051.ctr: -------------------------------------------------------------------------------- 1 | x is Object new. 2 | x on: 'getA' do: { 3 | my a is 2. 4 | a is 1. 5 | Pen write: a. 6 | Pen write: my a. 7 | }. 8 | a is 3. 9 | x getA. 10 | Pen write: a. #121, dynamic scope 11 | -------------------------------------------------------------------------------- /tests/test0080.exp: -------------------------------------------------------------------------------- 1 | 1,2 2 | 1,2,3 3 | 1,2,3,Nil,Nil,Nil,Nil,Nil,Nil,Nil,4 4 | Nil,Nil,Nil,Nil,Nil,Nil,Nil,4 5 | 9,Nil,Nil,Nil,Nil,Nil,Nil,Nil,Nil,Nil,4 6 | Uncatched error has occurred. 7 | Index out of bounds. 8 | -------------------------------------------------------------------------------- /examples/all.ctr: -------------------------------------------------------------------------------- 1 | var objs is Reflect getContext @ 0 @ 0 fmap: {:name ^name + ' :: ' + (Reflect getMethodsOf: (Reflect getObject: name), reverse join: '\n').}. 2 | 3 | Pen write: (objs reverse join: '\n\n'), brk. 4 | -------------------------------------------------------------------------------- /tests/test0007.ctr: -------------------------------------------------------------------------------- 1 | Cat is Object new. 2 | Cat on: 'make' do: { 3 | var cat is Object new. 4 | cat on: 'meow' do: { 5 | Pen write: 'meow!'. 6 | }. 7 | ^cat. 8 | }. 9 | cat is Cat make. 10 | cat meow. 11 | -------------------------------------------------------------------------------- /tests/test0028.ctr: -------------------------------------------------------------------------------- 1 | (('abcdef' from: 2 to: 6 - 1) = 'cde') ifTrue: { Pen write: 'yes'.}. 2 | Pen write: 'a' + 1. 3 | Pen write: 'x' + 3.5. 4 | Pen write: 'y' + True. 5 | Pen write: 'z' + False + Nil + 2. 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/test0046.ctr: -------------------------------------------------------------------------------- 1 | cat is Object new. 2 | cat on: 'work' do: { 3 | thisBlock error: 'Cats have personel for that!'. 4 | Pen write: 'dont print this!'. 5 | }. 6 | { cat work. } catch: { :e Pen write: e. }, run. 7 | -------------------------------------------------------------------------------- /tests/test0074.ctr: -------------------------------------------------------------------------------- 1 | #Test Array + operator 2 | a is Array < 1 ; 2 ; 3. 3 | b is Array < 4 ; 5 ; 6. 4 | c is a + b. 5 | Pen write: 'Array:' + (c join: ','), brk. 6 | Pen write: 'Array:' + ((b + a) join: ','), brk. 7 | -------------------------------------------------------------------------------- /tests/test0114.ctr: -------------------------------------------------------------------------------- 1 | #test array key value iteration (added later) 2 | welcome is Array < 'Hello' ; 'World' ; 'Welcome' ; 'To' ; 'Citron'. 3 | welcome each: { :key :value 4 | Pen write: key + ':'+ value, brk. 5 | }. 6 | -------------------------------------------------------------------------------- /tests/test0124.ctr: -------------------------------------------------------------------------------- 1 | #Test ucfirst-like messages to capitalize strings 2 | Pen 3 | write: ('title' upper1st), 4 | write: ('' upper1st), 5 | write: ('Case' lower1st), 6 | write: ('' lower1st), 7 | brk. 8 | -------------------------------------------------------------------------------- /tests/test0229.ctr: -------------------------------------------------------------------------------- 1 | #test hash function 2 | Pen write: ('hello' hashWithKey: '1234567890123456'), brk. 3 | Pen write: ('hello' hashWithKey: '1234567890123456'), brk. 4 | Pen write: ('hello' hashWithKey: '123'), brk. 5 | -------------------------------------------------------------------------------- /tests/assets/asset_mod_for_ast.ctr: -------------------------------------------------------------------------------- 1 | #To be loaded in test no95. 2 | Pen write: 'Hello World'. 3 | Pen brk. 4 | Pen write: 'Greetings from a'. 5 | Pen brk. 6 | Pen write: 'Dynamically ' + 'loaded ' + externalVar, brk. 7 | -------------------------------------------------------------------------------- /tests/test0133.exp: -------------------------------------------------------------------------------- 1 | len: 8 2 | len2: 8 3 | len: 8 4 | len2: 8 5 | len: 8 6 | len2: 8 7 | len: 8 8 | len2: 8 9 | len: 8 10 | len2: 8 11 | len: 8 12 | len2: 8 13 | len: 8 14 | len2: 8 15 | len: 8 16 | len2: 8 17 | -------------------------------------------------------------------------------- /tests/test0156.ctr: -------------------------------------------------------------------------------- 1 | #NOAST 2 | #Test too many contexts open 3 | 4 | j is 1. 5 | 6 | func is { 7 | 8 | Pen write: 'Nested call #' + j, brk. 9 | j +=: 1. 10 | 11 | func run. 12 | }. 13 | 14 | func run. 15 | -------------------------------------------------------------------------------- /tests/test0252.exp: -------------------------------------------------------------------------------- 1 | 1981-01-05 13:15:13 2 | 1981-1-5 13:15:13 W1 t347548513 UTC 3 | 1981-1-5 14:15:13 W1 t347548513 Europe/Amsterdam 4 | Nil 5 | Clock1 14 6 | Clock2 08 7 | Clock1 14 8 | Clock2 06 9 | Clock3 13 10 | -------------------------------------------------------------------------------- /autohell/examples/all.ctr: -------------------------------------------------------------------------------- 1 | var objs is Reflect getContext @ 0 @ 0 fmap: {:name ^name + ' :: ' + (Reflect getMethodsOf: (Reflect getObject: name), reverse join: '\n').}. 2 | 3 | Pen write: (objs reverse join: '\n\n'), brk. 4 | -------------------------------------------------------------------------------- /examples/hello.ctr: -------------------------------------------------------------------------------- 1 | var Butler is Object new. 2 | Butler on: 'greet:' do: { :name 3 | Pen write: 'Welcome ' + name. 4 | }. 5 | var james is Butler new. 6 | james greet: 'visitor'. 7 | 8 | import export: james as: 'James'. 9 | -------------------------------------------------------------------------------- /tests/test0238.exp: -------------------------------------------------------------------------------- 1 | Array ← 1 ; 2 ; 3 2 | 3 3 | Array ← 1 ; 2 ; 3 4 | (Map new) put:1 at:2 5 | Array ← 1 ; (Array ← 9) ; True 6 | 9 7 | (Map new) put:(Array ← 1) at:(Array ← 2) 8 | Nil 9 | Array new 10 | (Map new) 11 | -------------------------------------------------------------------------------- /tests/test0244.ctr: -------------------------------------------------------------------------------- 1 | #It should not be possible to 'trick' eval whitelists by overriding native message with custom message 2 | Array on: '<' do: { 3 | Pen write: 'Blaaaa', brk. 4 | }. 5 | q is 'x is Array < 1'. 6 | q eval. 7 | -------------------------------------------------------------------------------- /tests/test0070.exp: -------------------------------------------------------------------------------- 1 | I got: 3 numbers. 2 | number #0:1 3 | number #1:2 4 | number #2:3 5 | We serve 6 | ->Tea 7 | ->Coffee 8 | ->Milk 9 | ->Orange Juice 10 | ->Water 11 | Tea,Coffee,Milk,Orange Juice,Water 12 | 1||2||3 13 | -------------------------------------------------------------------------------- /tests/test0076.ctr: -------------------------------------------------------------------------------- 1 | a is Array < 3 ; 2 ; 1. 2 | Pen write: ( a join: ',' ), brk. 3 | a sort: { :i :j ^ ( i - j ). }. 4 | Pen write: ( a join: ',' ), brk. 5 | a sort: { :i :j ^ ( j - i ). }. 6 | Pen write: ( a join: ',' ), brk. 7 | -------------------------------------------------------------------------------- /tests/test0077.exp: -------------------------------------------------------------------------------- 1 | String,Number 2 | String,Boolean 3 | Number,String 4 | Number,Boolean 5 | Boolean,Number 6 | Boolean,Number 7 | Boolean,String 8 | Boolean,String 9 | === String test === 10 | 123 11 | False 12 | True 13 | -------------------------------------------------------------------------------- /tests/test0142.ctr: -------------------------------------------------------------------------------- 1 | #NOAST 2 | #If an object does not understand a message 3 | #and it does not know about respondTo:(and:)*, 4 | #it should trigger an error. 5 | x is Object new. 6 | x doesNotUnderstand this. 7 | y doYouExist. 8 | -------------------------------------------------------------------------------- /tests/test0194.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Number cannot be constructed by 2 3 | #1 2 (tests/test0194.ctr: 1) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 1 | 2 is 1. 7 | ~~~~^ 8 | -------------------------------------------------------------------------------- /autohell/examples/hello.ctr: -------------------------------------------------------------------------------- 1 | var Butler is Object new. 2 | Butler on: 'greet:' do: { :name 3 | Pen write: 'Welcome ' + name. 4 | }. 5 | var james is Butler new. 6 | james greet: 'visitor'. 7 | 8 | import export: james as: 'James'. 9 | -------------------------------------------------------------------------------- /python/citron/parser/token.py: -------------------------------------------------------------------------------- 1 | from ast import ASTToken 2 | class CtrToken(ASTToken): 3 | """docstring for CtrToken.""" 4 | def __init__(self, type, value = ""): 5 | super().__init__(type) 6 | self.value = value 7 | -------------------------------------------------------------------------------- /tests/test0188.exp: -------------------------------------------------------------------------------- 1 | 0123 2 | 4321 3 | BLOCK 1 4 | BLOCK 2 5 | 012 6 | 321 7 | 0123 8 | 4321 9 | BLOCK 1 10 | BLOCK 2 11 | 012 12 | 321 13 | 0123 14 | 4321 15 | BLOCK 1 16 | BLOCK 2 17 | 012 18 | 321 19 | Leaking memory... 20 | -------------------------------------------------------------------------------- /tests/test0260.ctr: -------------------------------------------------------------------------------- 1 | #Can we obtain the pid of a child? 2 | 3 | Pen write: Program pid isNil, brk. 4 | 5 | q is Program new: { :x 6 | Pen write: x pid isNil, brk. 7 | }. 8 | 9 | q join. 10 | Pen write: (q pid isNil), brk. 11 | -------------------------------------------------------------------------------- /Library/Functional/Category/Array.ctr: -------------------------------------------------------------------------------- 1 | import Library/Functional/TypeClass/Category. 2 | 3 | Array inheritFrom: Category, 4 | on: 'compose:' do: {:other 5 | ^me + other. 6 | }, 7 | on: 'id' do: { 8 | ^me. 9 | }. 10 | -------------------------------------------------------------------------------- /tests/test0065.exp: -------------------------------------------------------------------------------- 1 | a=4.5, b=4 2 | a=4, b=24 3 | a=4.5, b=5 4 | a=4.5, b=4 5 | a=4.5, b=5 6 | a=4.2, b=4 7 | 4 8 | 666 9 | 0.9092974268 10 | -2.1850398633 11 | 0.6931471806 12 | 7.3890560989 13 | 1.1071487178 14 | 7 15 | 8 16 | 6 17 | -------------------------------------------------------------------------------- /tests/test0143.ctr: -------------------------------------------------------------------------------- 1 | #NOAST 2 | #If an object does not understand a message, 3 | #and it does not know about respondTo:(and:)*, 4 | #it should trigger an error. 5 | x is Object new. 6 | x doesNotUnderstand this. 7 | y doYouExist: (3 * 6). 8 | -------------------------------------------------------------------------------- /examples/shit/test.py: -------------------------------------------------------------------------------- 1 | a,b = 0,1 2 | #try: 3 | for i in range(0,10**5): 4 | b,a=a,b 5 | b = b+a 6 | print (f"i:${i}") 7 | #except: 8 | # with open('fib%s.txt'%i, 'w') as f: 9 | # f.write(str(b)) 10 | print (b) 11 | -------------------------------------------------------------------------------- /examples/shit/trash.ctr: -------------------------------------------------------------------------------- 1 | Broom memoryLimit: 1000000. 2 | var a is 0. 3 | var b is 1. 4 | 5 | (10 pow: 6) times: {:i 6 | Pen write: 'i:$$i', brk. 7 | b is a + b. 8 | a is b - a. 9 | }. 10 | Pen write: 'a:$$a b:$$b', brk. 11 | -------------------------------------------------------------------------------- /tests/test0017.ctr: -------------------------------------------------------------------------------- 1 | a is 3 + 2 + 10 + 1 - 3. 2 | Pen write: a. 3 | b is 2 + 3 factorial. 4 | Pen write: b. 5 | c is 3 factorial + 2. 6 | Pen write: c. 7 | d is 2 + (3 factorial). 8 | Pen write: d. 9 | Pen write: 2 + 3 factorial + 1. 10 | -------------------------------------------------------------------------------- /tests/test0045.ctr: -------------------------------------------------------------------------------- 1 | { 2 | Pen write: 'hi there!'. 3 | thisBlock error: 'oops'. 4 | Pen write: 'hi there!'. 5 | { Pen write: 'dont print this'. } run. 6 | } catch: { :e 7 | Pen write: 'got ya!'. 8 | Pen write: e. 9 | }, run. 10 | -------------------------------------------------------------------------------- /tests/test0126.exp: -------------------------------------------------------------------------------- 1 | Hello I can write to console using fluid API! 2 | Confirmed. Target file does not exist. 3 | Confirmed. Source file does not exist. 4 | Confirmed. Target file has been created by shell. 5 | Contents of file is:hello world 6 | -------------------------------------------------------------------------------- /tests/test0175.exp: -------------------------------------------------------------------------------- 1 | hello world - can we use strings.. without leaking 100s of bytes ?!!hello world - can we use strings.. without leaking 100s of bytes ?!!hello world - can we use strings.. without leaking 100s of bytes ?!!Leaking memory... 2 | -------------------------------------------------------------------------------- /tests/test0254.ctr: -------------------------------------------------------------------------------- 1 | #can we subtract time? 2 | 3 | x is Clock new hour: 10, minute: 0, second: 0, year:2017, day:10, month:7. 4 | Pen write: x, brk. 5 | x subtract: 1 hour. 6 | Pen write: x, brk. 7 | x subtract: -1 hour. 8 | Pen write: x, brk. 9 | -------------------------------------------------------------------------------- /autohell/examples/shit/test.py: -------------------------------------------------------------------------------- 1 | a,b = 0,1 2 | #try: 3 | for i in range(0,10**5): 4 | b,a=a,b 5 | b = b+a 6 | print (f"i:${i}") 7 | #except: 8 | # with open('fib%s.txt'%i, 'w') as f: 9 | # f.write(str(b)) 10 | print (b) 11 | -------------------------------------------------------------------------------- /tests/test0029.ctr: -------------------------------------------------------------------------------- 1 | #test explicit message chaining using , 2 | Pen write: 'first', write: 'second'. 3 | #test chaining with unary message. 4 | Pen write: 3 factorial, write: 3 factorial. 5 | #and binary message 6 | Pen write: 3 + 2, write: 7 / 2. 7 | -------------------------------------------------------------------------------- /tests/test0048.ctr: -------------------------------------------------------------------------------- 1 | { 2 | var cat is Object new. 3 | cat on: 'work' do: { 4 | thisBlock error: 'Cats have personel for that!'. 5 | Pen write: 'dont print this!'. 6 | }. 7 | cat work. 8 | } catch: { :e 9 | Pen write: e. 10 | }, run. 11 | -------------------------------------------------------------------------------- /tests/test0094.ctr: -------------------------------------------------------------------------------- 1 | #Test recursion 2 | f is { :x 3 | var result is 0. 4 | (x = 1) ifTrue: { 5 | result is 1. 6 | }, else: { 7 | result is x * (f applyTo: (x - 1)). 8 | }. 9 | ^ result. 10 | }. 11 | Pen write: (f applyTo: 4). #24. 12 | -------------------------------------------------------------------------------- /tests/test0259.ctr: -------------------------------------------------------------------------------- 1 | key is '--Citron-->0'. 2 | Program log: key. 3 | 4 | key is '--Citron-->1'. 5 | Program warning: key. 6 | 7 | key is '--Citron-->2'. 8 | Program error: key. 9 | 10 | key is '--Citron-->3'. 11 | Program alert: key. 12 | -------------------------------------------------------------------------------- /tests/test0275.ctr: -------------------------------------------------------------------------------- 1 | #More sort tests... 2 | 3 | a is Array < 6 ; 5 ; 4 ; 3 ; 2 ; 1. 4 | Pen write: a, brk. 5 | 6 | a shift. 7 | Pen write: a, brk. 8 | 9 | a sort: { :a :b 10 | ^ (a > b). 11 | }. 12 | 13 | Pen write: a, brk. 14 | 15 | 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.lo 4 | *.Tpo 5 | *.Po 6 | *.so 7 | *.c~ 8 | *.h~ 9 | ctr 10 | *.js 11 | *.yml 12 | plg.ctr 13 | namedstruct.ctr 14 | docs 15 | tools/* 16 | sync.sh 17 | integration/vscode 18 | integration/gdb 19 | tut 20 | .bac 21 | -------------------------------------------------------------------------------- /autohell/examples/shit/trash.ctr: -------------------------------------------------------------------------------- 1 | Broom memoryLimit: 1000000. 2 | var a is 0. 3 | var b is 1. 4 | 5 | (10 pow: 6) times: {:i 6 | Pen write: 'i:$$i', brk. 7 | b is a + b. 8 | a is b - a. 9 | }. 10 | Pen write: 'a:$$a b:$$b', brk. 11 | -------------------------------------------------------------------------------- /examples/arrays.ctr: -------------------------------------------------------------------------------- 1 | File new: 'extensions/collections.ctr', include. 2 | 3 | var t is Array < 2 ; 1 ; 3 ; 4. 4 | 5 | var l is [1,2]. 6 | 7 | Pen write: l, brk. 8 | 9 | l is l filter: {:i:v ^0 !=: (v - 1).}. 10 | 11 | Pen write: l, brk. 12 | -------------------------------------------------------------------------------- /tests/test0057.ctr: -------------------------------------------------------------------------------- 1 | #Test whether assign is copy-by-value for arrays. 2 | cafe is Array new. 3 | cafe push: 'coffee'. 4 | cafe push: 'beer'. 5 | Pen write: (cafe at: 0), write: (cafe at: 1). 6 | pub is cafe. 7 | Pen write: (pub at: 0), write: (pub at: 1). 8 | -------------------------------------------------------------------------------- /Library/Functional/Monad/Array.ctr: -------------------------------------------------------------------------------- 1 | import Library/Functional/TypeClass/Monad. 2 | 3 | Array 4 | inheritFrom: Monad, 5 | on: 'unit:' do: {:v ^[v].}, 6 | on: 'bind:' do: {:fn 7 | var thisContext is me. 8 | ^me fmap: fn, sum. 9 | }. 10 | -------------------------------------------------------------------------------- /autohell/examples/arrays.ctr: -------------------------------------------------------------------------------- 1 | File new: 'extensions/collections.ctr', include. 2 | 3 | var t is Array < 2 ; 1 ; 3 ; 4. 4 | 5 | var l is [1,2]. 6 | 7 | Pen write: l, brk. 8 | 9 | l is l filter: {:i:v ^0 !=: (v - 1).}. 10 | 11 | Pen write: l, brk. 12 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | #ifndef WITH_AUTOMAKE 2 | # ifndef CTR_STD_EXTENSION_PATH 3 | # define CTR_STD_EXTENSION_PATH "." 4 | # endif 5 | #else 6 | # ifndef CTR_STD_EXTENSION_PATH 7 | # define CTR_STD_EXTENSION_PATH WITH_AUTOMAKE 8 | # endif 9 | #endif 10 | -------------------------------------------------------------------------------- /pcrs/INSTALL: -------------------------------------------------------------------------------- 1 | 2 | To build PCRS, you will need pcre 3.0 or later and gcc. 3 | 4 | Installation is easy: ./configure && make && make install 5 | Debug mode can be enabled with --enable-debug. 6 | 7 | There is a simple demo application (pcrsed) included. 8 | 9 | -------------------------------------------------------------------------------- /tests/test0047.ctr: -------------------------------------------------------------------------------- 1 | { 2 | var cat is Object new. 3 | cat on: 'work' do: { 4 | thisBlock error: 'Cats have personel for that!'. 5 | Pen write: 'dont print this!'. 6 | }. 7 | { cat work. } run. 8 | } catch: { :e 9 | Pen write: e. 10 | }, run. 11 | -------------------------------------------------------------------------------- /tests/test0129.ctr: -------------------------------------------------------------------------------- 1 | #test array product 2 | a is Array < 1 ; 2 ; 3. 3 | Pen write: a product, brk.#6 4 | Pen write: (Array < 2 ; 4 ; 8) product, brk. #64 5 | Pen write: (Array < -2 ; 10) product, brk. #-20 6 | Pen write: (Array < 0.5 ; -2) product, brk. #-1 7 | -------------------------------------------------------------------------------- /tests/test0152.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Key not found: is 3 | #1 is (tests/test0152.ctr: 3) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 1 | 7 | 2 | #Test parser error 8 | 3 | var is. 9 | ~~~~~^ 10 | -------------------------------------------------------------------------------- /tests/test0232.ctr: -------------------------------------------------------------------------------- 1 | #Test Slurp Object 2 | x is Slurp new. 3 | x + 3. 4 | Pen write: (x obtain), brk. 5 | x echo: 'Hello world'. 6 | Pen write: (x obtain), brk. 7 | x tellme: 123 and: 987. #This should fail...maybe change that? 8 | Pen write: (x obtain), brk. 9 | -------------------------------------------------------------------------------- /plugins/curl/Makefile: -------------------------------------------------------------------------------- 1 | 2 | name = curl 3 | 4 | all: 5 | gcc -g ${EXTRAS} -c $(name).c -Wall -Wno-unused-function -fpic -o $(name).o 6 | gcc -shared -o libctr$(name).so $(name).o -l$(name) 7 | mkdir -p ../../mods/curl 8 | cp libctr$(name).so ../../mods/curl/ 9 | -------------------------------------------------------------------------------- /tests/test0093.ctr: -------------------------------------------------------------------------------- 1 | #Tests local scope. (3332) 2 | var q is 2. 3 | c is 0. 4 | f is { 5 | c +=: 1. 6 | var x is 1. 7 | (c < 3) ifTrue: { 8 | var q is 0. 9 | f run. 10 | }. 11 | x +=: 2. 12 | Pen write: x. 13 | }. 14 | f run. 15 | Pen write: q. 16 | -------------------------------------------------------------------------------- /tests/test0116.ctr: -------------------------------------------------------------------------------- 1 | #Command argument should NOT segfault when out-of-bounds, issue#10 2 | wrong is Program argument: -10. 3 | (wrong = Nil) ifTrue: { 4 | Pen write: 'I can handle out-of-bound Command arguments.\n'. 5 | }, else: { 6 | Pen write: 'Fail\n'. 7 | }. 8 | -------------------------------------------------------------------------------- /tests/test0128.ctr: -------------------------------------------------------------------------------- 1 | #test array sum 2 | a is Array < 9 ; 8 ; 7. 3 | Pen write: (a sum), brk. #24 4 | a is Array < 1 ; 9. 5 | Pen write: (a sum), brk. #10 6 | a is Array < 'o' ; 2. 7 | Pen write: (a sum), brk. #2 8 | Pen write: (Array new sum), brk. #Empty block 9 | -------------------------------------------------------------------------------- /tests/test0041.ctr: -------------------------------------------------------------------------------- 1 | #a non existing message should not trigger an error or produce any output. 2 | Pen nonexistantmessage. 3 | Pen nonexistantmessage: 'b'. 4 | Pen nonexistantmessage: 'b' more: 123. 5 | Pen nonexistantmessage: 'b' more: 123 andMore: (Pen more). 6 | 7 | -------------------------------------------------------------------------------- /tests/test0183.exp: -------------------------------------------------------------------------------- 1 | False 2 | Object 3 | True 4 | False 5 | [o:Object] 6 | [o:Object] 7 | False 8 | Object 9 | True 10 | False 11 | [o:Object] 12 | [o:Object] 13 | False 14 | Object 15 | True 16 | False 17 | [o:Object] 18 | [o:Object] 19 | Leaking memory... 20 | -------------------------------------------------------------------------------- /tests/test0263.ctr: -------------------------------------------------------------------------------- 1 | #Array Shifting bug... test 2 | i is Object new. 3 | i on: 'greet:' do: { :name 4 | Pen write: 'Hello $$name', brk. 5 | }. 6 | a is Array < 'greet:' ; 'Visitor'. 7 | b is a shift. 8 | Pen write: a @ 0, brk. 9 | i message: b arguments: a. 10 | -------------------------------------------------------------------------------- /examples/case.ctr: -------------------------------------------------------------------------------- 1 | import Library/Data/SwitchCase. 2 | 3 | a is 'value'. 4 | 5 | a case: 'value' do: { 6 | var value is my value. 7 | Pen write: 'Single select switch-case: $$value ', brk. 8 | }, 9 | case: 'lol' do: { Pen write: 'what?', brk. }, switch. 10 | -------------------------------------------------------------------------------- /tests/test0059.ctr: -------------------------------------------------------------------------------- 1 | #Objects in arrays need to be preserved as well 2 | #if their containing array is still in scope 3 | z is Array new. 4 | { 5 | var x is 'hello'. 6 | z push: x. 7 | } run. 8 | Pen write: (z at: 0). 9 | Broom sweep. 10 | Pen write: (z at: 0). 11 | -------------------------------------------------------------------------------- /tests/test0158.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | File has already been opened. 3 | #1 open: (tests/test0158.ctr: 17) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 15 | 7 | 16 | 8 | 17 | f open: 'r+'. 9 | ~~~~~~~~~^ 10 | -------------------------------------------------------------------------------- /tests/test0225.exp: -------------------------------------------------------------------------------- 1 | 1 is an odd number. 2 | 2 is an even number. 3 | 3 is an odd number. 4 | 4 is an even number. 5 | 5 is an odd number. 6 | 6 is an even number. 7 | 7 is an odd number. 8 | 8 is an even number. 9 | 9 is an odd number. 10 | 10 is an even number. 11 | -------------------------------------------------------------------------------- /Library/Utils/Fire/fire.ctr: -------------------------------------------------------------------------------- 1 | var Fire is Object new. 2 | Fire on: 'of:' do: {:obj 3 | ^me cnew: { context => obj. }. 4 | }. 5 | Fire on: 'fire:withArgs:' do: {:meth:args 6 | ^my context message: meth arguments: args. 7 | }. 8 | 9 | import export: Fire as: 'Fire'. 10 | -------------------------------------------------------------------------------- /tests/test0011.ctr: -------------------------------------------------------------------------------- 1 | #Test Simplified OOP - basic override 2 | Animal is Object new. 3 | Animal on: 'makeSound' do: { 4 | Pen write: '?'. 5 | }. 6 | Cat is Animal new. 7 | Cat on: 'makeSound' do: { 8 | Pen write: 'meow!'. 9 | }. 10 | Tom is Cat new. 11 | Tom makeSound. 12 | -------------------------------------------------------------------------------- /tests/test0075.exp: -------------------------------------------------------------------------------- 1 | Can we count to 10 using a whileTrue loop ? 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | 10 12 | Can we count back from 10 to 0 using a whileFalse loop ? 13 | 10 14 | 9 15 | 8 16 | 7 17 | 6 18 | 5 19 | 4 20 | 3 21 | 2 22 | 1 23 | 0 24 | -------------------------------------------------------------------------------- /tests/test0078.ctr: -------------------------------------------------------------------------------- 1 | #Test whether we can include files. 2 | myVar is 123. 3 | Pen write: 'Start include test', brk. 4 | (File new: 'tests/test0077.ctr') include. 5 | Pen brk write: 'End include test', brk. 6 | Pen write: 'Are my variables still intact?'. 7 | Pen brk write: myVar. 8 | -------------------------------------------------------------------------------- /tests/test0192.exp: -------------------------------------------------------------------------------- 1 | Can we count to 10 using a whileTrue loop ? 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | 10 12 | Can we count back from 10 to 0 using a whileFalse loop ? 13 | 10 14 | 9 15 | 8 16 | 7 17 | 6 18 | 5 19 | 4 20 | 3 21 | 2 22 | 1 23 | 0 24 | -------------------------------------------------------------------------------- /tests/test0247.ctr: -------------------------------------------------------------------------------- 1 | #test whether we can split a string into bytes 2 | 3 | q is 'abc'. 4 | x is q toByteArray. 5 | Pen write: x, brk. 6 | Pen write: x count, brk. 7 | 8 | q is '기나 긴 여행'. 9 | x is q toByteArray. 10 | Pen write: x, brk. 11 | Pen write: (x count), brk. 12 | -------------------------------------------------------------------------------- /tests/test0273.exp: -------------------------------------------------------------------------------- 1 | Array ← 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' ; 'x' 2 | -------------------------------------------------------------------------------- /Library/Control/Class/Functor.ctr: -------------------------------------------------------------------------------- 1 | Classes new: 'Functor' contract: {:obj 2 | #apply:, compose: 3 | var terms is ['apply:', 'compose:']. 4 | ^(Reflect getMethodsOf: obj) filter: {:i:v ^terms contains: v.}, count = (terms count). 5 | }. 6 | Classes Functor classify: CodeBlock. 7 | -------------------------------------------------------------------------------- /autohell/examples/case.ctr: -------------------------------------------------------------------------------- 1 | import Library/Data/SwitchCase. 2 | 3 | a is 'value'. 4 | 5 | a case: 'value' do: { 6 | var value is my value. 7 | Pen write: 'Single select switch-case: $$value ', brk. 8 | }, 9 | case: 'lol' do: { Pen write: 'what?', brk. }, switch. 10 | -------------------------------------------------------------------------------- /examples/apply: -------------------------------------------------------------------------------- 1 | File new: 'extensions/fileutils.ctr', include. 2 | 3 | var test is Nil. 4 | { test is Queue new. } catch: {:e Pen red write: e, brk. }, run. 5 | 6 | import import: (Array < 'Queue'). 7 | 8 | test is Queue new. 9 | 10 | Pen resetColor write: test, brk. 11 | -------------------------------------------------------------------------------- /tests/test0034.ctr: -------------------------------------------------------------------------------- 1 | a is Object new. 2 | x is 0. 3 | a on: 'test1' do: { 4 | x is 123. 5 | }. 6 | a test1. 7 | #x should not be 0. 8 | Pen write: x. 9 | b is Object new. 10 | b on: 'test2' do: { 11 | #x should be 123... dyn scope 12 | Pen write: x. 13 | }. 14 | b test2. 15 | -------------------------------------------------------------------------------- /tests/test0083.ctr: -------------------------------------------------------------------------------- 1 | 2 | Animal is Object new. 3 | Animal on: 'eat' do: { 4 | Pen write: 'munch! munch!'. 5 | }. 6 | 7 | Cat is Animal new. 8 | Cat on: 'eat' do: { 9 | Pen write: 'meow', brk. 10 | me `eat. 11 | }. 12 | 13 | 14 | blackCat is Cat new. 15 | blackCat eat. 16 | -------------------------------------------------------------------------------- /tests/test0140.ctr: -------------------------------------------------------------------------------- 1 | #NOAST 2 | #Test stack trace 3 | Pen write: 'Trigger an error'. 4 | #NonExistingObject doSomething. 5 | # 6 | # 7 | # 8 | { Pen write: 'aaa'. 9 | { 10 | # 11 | thisBlock error: 'Hi!'. 12 | } run. 13 | # 14 | # 15 | } run. 16 | 17 | # 18 | # 19 | -------------------------------------------------------------------------------- /autohell/examples/apply: -------------------------------------------------------------------------------- 1 | File new: 'extensions/fileutils.ctr', include. 2 | 3 | var test is Nil. 4 | { test is Queue new. } catch: {:e Pen red write: e, brk. }, run. 5 | 6 | import import: (Array < 'Queue'). 7 | 8 | test is Queue new. 9 | 10 | Pen resetColor write: test, brk. 11 | -------------------------------------------------------------------------------- /tests/test0018.ctr: -------------------------------------------------------------------------------- 1 | Animal is Object new. 2 | Animal on: 'sound:' do: { :s my sound is s. }. 3 | Animal on: 'makeSound' do: { Pen write: my sound. }. 4 | Cat is Animal new. 5 | Cat on: 'init' do: { my sound is 'MEOW!'.}. 6 | Cat on: 'meow' do: { me makeSound. }. 7 | Cat init. 8 | Cat meow. 9 | -------------------------------------------------------------------------------- /tests/test0117.ctr: -------------------------------------------------------------------------------- 1 | #Plugin test 2 | 3 | whatever is Map cnew: { 4 | put: 64 at: 'string', 5 | put: 'string' at: 0, 6 | put: [1, 2, ['Array?']] at: 'Not_An_Array', 7 | put: (Map new put: Nil at: 1234) at: 'poof'. 8 | }. 9 | 10 | Pen writeln: (JSON serialize: whatever). 11 | -------------------------------------------------------------------------------- /tests/test0157.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'blah' was called 3 | #1 blah (tests/test0157.ctr: 11) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 9 | 7 | 10 | f is Object new. 8 | 11 | f blah. 9 | ~~~~~~~~~^ 10 | -------------------------------------------------------------------------------- /tests/test0062.exp: -------------------------------------------------------------------------------- 1 | Expected on: argument to be of type string. 2 | Expected argument do: to be of type block. 3 | Division by zero. 4 | Unknown method String::'?' was called 5 | OSHITOCRAPNo direct conversion to type Number, nor any implicit cast to it arises from the use of type String 6 | OK 7 | -------------------------------------------------------------------------------- /tests/test0270.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Failed to open folder. 3 | #2 list: (tests/test0270.ctr: 1) 4 | #1 q (tests/test0270.ctr: 1) 5 | ------------------------------------ 6 | The probable cause of the exception: 7 | 1 | q is (File list: 'nonexistant'). 8 | ~~~~~~~~~~~~~~~~~~^ 9 | -------------------------------------------------------------------------------- /tests/test0111.ctr: -------------------------------------------------------------------------------- 1 | #Test error handling thru mute should not have 2 | #side effects 3 | a is 0. 4 | { 5 | Pen write: 'Block 1.\n'. 6 | thisBlock error: 'Err'. 7 | a is 1. 8 | } catch: { 9 | Pen write: 'Catch Block.\n'. 10 | Pen write: 'a = ' + a, brk. #a should be 0! 11 | }, run. 12 | -------------------------------------------------------------------------------- /tests/test0158.ctr: -------------------------------------------------------------------------------- 1 | #File operations should not leak memory 2 | 3 | usedMemory1 is 0. 4 | usedMemory2 is 0. 5 | usedMemory3 is 0. 6 | usedMemory4 is 0. 7 | 8 | Broom mode: 0. 9 | 10 | f is File new: '/tmp/none.txt'. 11 | f open: 'r+'. 12 | 13 | 14 | 15 | 16 | 17 | f open: 'r+'. 18 | -------------------------------------------------------------------------------- /Library/Functional/Category/Block.ctr: -------------------------------------------------------------------------------- 1 | import Library/Functional/TypeClass/Category. 2 | 3 | CodeBlock 4 | inheritFrom: Category, 5 | on: 'compose:' do: {:self:other 6 | ^\:*args const other applyAll: [(const self applyAll: args)]. 7 | }, 8 | on: 'id' do: { 9 | ^me. 10 | }. 11 | -------------------------------------------------------------------------------- /Library/Functional/Monad/Block.ctr: -------------------------------------------------------------------------------- 1 | import Library/Functional/TypeClass/Monad. 2 | 3 | CodeBlock 4 | inheritFrom: Monad, 5 | on: 'unit:' do: (\:x \:_ x), 6 | on: 'bind:' do: {:k 7 | var f is me. 8 | var thisContext is me. 9 | ^\:r k applyTo: (f applyTo: r) and: r. 10 | }. 11 | -------------------------------------------------------------------------------- /plugins/ffi/test/test.ctr: -------------------------------------------------------------------------------- 1 | ra is CTypes structWithFormat: 'sip'. 2 | str is CTypes fromString: 'test'. 3 | ra pack: [1, str]. 4 | Pen writeln: (ra unpack). 5 | rc is CIF new setABI: 0 return: Nil argTypes: [ra]. 6 | rb is CTypes loadLibrary: './a.out'. 7 | rd is rb test. 8 | rc call: rd withArgs: [ra]. 9 | -------------------------------------------------------------------------------- /tests/test0032.ctr: -------------------------------------------------------------------------------- 1 | #test assignment to my... testtesttest 2 | a is Object new. 3 | a on: 'init' do: { 4 | var v is 'test'. 5 | my value is v. 6 | my value2 is my value. 7 | var x is my value2. 8 | Pen write: x. 9 | Pen write: my value. 10 | Pen write: my value2. 11 | }. 12 | a init. 13 | -------------------------------------------------------------------------------- /tests/test0075.ctr: -------------------------------------------------------------------------------- 1 | i is 0. 2 | Pen write: 'Can we count to 10 using a whileTrue loop ?', brk. 3 | { i +=: 1. ^ (i <=: 10). } whileTrue: { Pen write: i, brk. }. 4 | Pen write: 'Can we count back from 10 to 0 using a whileFalse loop ?', brk. 5 | { i -=: 1. ^ (i >=: 0). } whileTrue: { Pen write: i, brk. }. 6 | -------------------------------------------------------------------------------- /tests/test0123.ctr: -------------------------------------------------------------------------------- 1 | #Test positive and negative messages. 2 | Pen write: 'If hope is 0.1...\n'. 3 | hope is 0.2. 4 | ( hope pos ) ifTrue: { Pen write: 'Still a little hope for humanity\n'. }. 5 | Pen write: 'If hope is -1...\n'. 6 | hope is -1. 7 | (hope neg) ifTrue: { Pen write: 'No hope left\n'. }. 8 | -------------------------------------------------------------------------------- /tests/test0246.ctr: -------------------------------------------------------------------------------- 1 | #Test whether we can split a string in an array of single unicode points 2 | 3 | q is 'abc'. 4 | x is q characters. 5 | Pen write: x, brk. 6 | Pen write: x count, brk. 7 | 8 | q is '기나 긴 여행'. 9 | x is q characters. 10 | Pen write: x, brk. 11 | Pen write: (x count), brk. 12 | -------------------------------------------------------------------------------- /plugins/request/ccgi-1.2/examples/README: -------------------------------------------------------------------------------- 1 | dump.html is a sample web form that POSTs to dump.cgi. 2 | 3 | dump.cgi displays all the form data and uploads 4 | files to /tmp/cgi-upload-* 5 | 6 | To build dump.cgi: make 7 | 8 | Install dump.cgi and dump.html on a web server and 9 | browse dump.html. 10 | -------------------------------------------------------------------------------- /Library/Utils/OneGateFlipper.ctr: -------------------------------------------------------------------------------- 1 | var OneGateFlipper is Object new on: 'new' do: { ^me cnew: {my value is False.}. }. 2 | OneGateFlipper on: 'set' do: { my value is True. }. 3 | OneGateFlipper on: 'get' do: { var v is my value. my value is False. ^v. }. 4 | 5 | import export: OneGateFlipper as: 'OneGateFlipper'. 6 | -------------------------------------------------------------------------------- /tests/test0225.ctr: -------------------------------------------------------------------------------- 1 | #count from 1 to 10 and list the even and odd numbers, tests whether falsy comparisons work 2 | 1 to: 10 step: 1 do: { :i 3 | var type is ''. 4 | ( i mod: 2 ) ifTrue: { type is 'odd'. }. 5 | ( i mod: 2 ) ifFalse: { type is 'even'. }. 6 | Pen write: '$$i is an $$type number.', brk. 7 | }. 8 | -------------------------------------------------------------------------------- /Library/Control/Class/List.ctr: -------------------------------------------------------------------------------- 1 | Classes new: 'List' contract: {:obj 2 | var terms is ['length', 'at:', 'push:', 'pop', 'join:']. 3 | ^(Reflect getMethodsOf: obj) filter: {:i:v ^terms contains: v.}, count = (terms count). 4 | }. 5 | 6 | Array learn: 'length' means: 'count'. 7 | 8 | Classes List classify: Array. 9 | -------------------------------------------------------------------------------- /autohell/scripts/one_liners.md: -------------------------------------------------------------------------------- 1 | # Citron CMD One-liners 2 | 3 | + List files and folders with separate colors 4 | 5 | - ```citron -e "(File list: '.') each: {:i :f (((f @ 'type') = 'folder') either: {Pen green write: (f @ 'file'), resetColor brk. } or: {Pen write: (f @ 'file'), resetColor brk.} ) run. }" 6 | ``` 7 | -------------------------------------------------------------------------------- /examples/serialization/serializing.ctr: -------------------------------------------------------------------------------- 1 | var i is 0. 2 | {^True.} whileTrue: { 3 | ((i +=: 1) = 10) break. 4 | var map is JSON parse: (File new: 'generated (1).json', read) genericType: Map. 5 | var x is JSON serialize: map. 6 | x length. #Force evaluation, string length adds nothing to the time. 7 | }. 8 | -------------------------------------------------------------------------------- /plugins/gmp/Makefile: -------------------------------------------------------------------------------- 1 | default: all 2 | 3 | all: compile link copy 4 | 5 | compile: 6 | cc ${EXTRAS} -c gmp.c -Wall -fPIC -g3 -o gmp.o 7 | 8 | link: 9 | cc -shared -o libctrbiginteger.so -lgmp gmp.o 10 | 11 | copy: 12 | mkdir -p ../../mods/biginteger 13 | cp -f libctrbiginteger.so ../../mods/biginteger 14 | -------------------------------------------------------------------------------- /plugins/sdl/makefile: -------------------------------------------------------------------------------- 1 | all: clean compile copy 2 | 3 | clean: 4 | rm -f *.o *.so 5 | 6 | compile: 7 | ${CC} ${EXTRAS} -shared -fPIC -lSDL_gfx -lSDL_ttf -lSDL_image `sdl-config --libs --cflags` sdl.c -o sdl.so 8 | 9 | copy: 10 | rm -f ../../mods/sdl/libctrsdl.so 11 | cp sdl.so ../../mods/sdl/libctrsdl.so 12 | -------------------------------------------------------------------------------- /tests/test0013.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'`makeSound' was called 3 | #1 `makeSound (tests/test0013.ctr: 12) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 10 | 7 | 11 | Tom is Cat new. 8 | 12 | Tom `makeSound. 9 | ~~~~~~~~~~~~~~~~~^ 10 | -------------------------------------------------------------------------------- /plugins/ctypes_DEPRECATED'/Makefile: -------------------------------------------------------------------------------- 1 | all: comp link copy 2 | 3 | comp: 4 | cc -c ctypes.c -Wall -Werror -fPIC -g3 -o ct.o 5 | 6 | link: 7 | cc -shared -o libctrctypes.so ct.o 8 | 9 | copy: 10 | cp -f libctrctypes.so ../../mods/ctypes 11 | 12 | clean: 13 | rm libctrctypes.so ct.o 14 | 15 | default: all 16 | -------------------------------------------------------------------------------- /tests/test0052.ctr: -------------------------------------------------------------------------------- 1 | items is Map new. 2 | items put: 'green' at: 'color-1'. 3 | items put: 'orange' at: 'color-2'. 4 | items put: 'red' at: 'color-3'. 5 | i is 0. 6 | s is ''. 7 | items each: { :key :color 8 | Pen write: 'color #' + i + ' is: ' + color + ' '. 9 | i +=: 1. 10 | }. 11 | Pen write: i + ' colors!'. 12 | -------------------------------------------------------------------------------- /tests/test0204.ctr: -------------------------------------------------------------------------------- 1 | #Test whether we canNOT access elements below tail (that have been shift off) 2 | a is Array < 1 ; 2 ; 3. 3 | Pen write: a count, brk. 4 | Pen write: a @ 1, brk. 5 | a shift. 6 | Pen write: a count, brk. 7 | Pen write: a @ 1, brk. 8 | a shift. 9 | Pen write: a count, brk. 10 | Pen write: a @ 1, brk. -------------------------------------------------------------------------------- /tests/test0206.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Dynamic message expects array. 3 | #1 message:arguments: (tests/test0206.ctr: 3) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 1 | 7 | 2 | str is 'write:'. 8 | 3 | Pen message: 'write:' arguments: 0. 9 | ~~~~~~~~~~~~~^ 10 | -------------------------------------------------------------------------------- /autohell/examples/serialization/serializing.ctr: -------------------------------------------------------------------------------- 1 | var i is 0. 2 | {^True.} whileTrue: { 3 | ((i +=: 1) = 10) break. 4 | var map is JSON parse: (File new: 'generated (1).json', read) genericType: Map. 5 | var x is JSON serialize: map. 6 | x length. #Force evaluation, string length adds nothing to the time. 7 | }. 8 | -------------------------------------------------------------------------------- /tests/test0027.ctr: -------------------------------------------------------------------------------- 1 | Pen write: 'Length is:' + 'ABCD' length. 2 | x is 'ABCDE'. 3 | Pen write: 'Length is:' + x length. 4 | (('ABC' length + 1 = 4) & (2 !=: 3)) not not ifTrue: { Pen write: 'Yes'. }. 5 | (((3 > 4) | (4 > 2)) & (True | False) & (True ? True) not ) ifTrue: { Pen write: 'Yes'. }. 6 | { Pen write: 'Running'. } run. 7 | -------------------------------------------------------------------------------- /tests/test0031.ctr: -------------------------------------------------------------------------------- 1 | #test assignment objects, assignment by reference: hiboo!boo! 2 | a is Object new. 3 | a on: 'setVal:' do: { :v my value is v. }. 4 | a on: 'getVal' do: { ^ my value. }. 5 | a setVal: 'hi'. 6 | Pen write: a getVal. 7 | b is a. 8 | b setVal: 'boo!'. 9 | Pen write: a getVal. 10 | Pen write: b getVal. 11 | -------------------------------------------------------------------------------- /tests/test0078.exp: -------------------------------------------------------------------------------- 1 | Start include test 2 | String,Number 3 | String,Boolean 4 | Number,String 5 | Number,Boolean 6 | Boolean,Number 7 | Boolean,Number 8 | Boolean,String 9 | Boolean,String 10 | === String test === 11 | 123 12 | False 13 | True 14 | 15 | End include test 16 | Are my variables still intact? 17 | 123 18 | -------------------------------------------------------------------------------- /tests/test0220.ctr: -------------------------------------------------------------------------------- 1 | #can we compare with Nil? 2 | Pen write: ( 'hello' = Nil ), brk. 3 | Pen write: ( 'hello' !=: Nil ), brk. 4 | Pen write: ( 2 > Nil ), brk. 5 | Pen write: ( 2 < Nil ), brk. 6 | Pen write: ( 2 >=: Nil ), brk. 7 | Pen write: ( 2 <=: Nil ), brk. 8 | Pen write: ( True = Nil ), brk. 9 | Pen write: ( False !=: Nil ), brk. -------------------------------------------------------------------------------- /tests/test0274.ctr: -------------------------------------------------------------------------------- 1 | #Can we extract a column from an array? 2 | a is Array < 3 | (Array < 1 ; 2 ; 3) ; 4 | (Array < 4 ; 5 ; 6) ; 5 | (Array < 7 ; 8 ; 9) 6 | . 7 | 8 | b is a column: 1. 9 | Pen write: b, brk. 10 | 11 | b is a column: 20. 12 | Pen write: b, brk. 13 | 14 | b is a column: -100. 15 | Pen write: b, brk. 16 | -------------------------------------------------------------------------------- /integration/pygments/CitronLexer/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup ( 4 | name='citronlexer', 5 | packages=find_packages(), 6 | entry_points = 7 | """ 8 | [pygments.lexers] 9 | citronlexer = citronlexer.lexer:CitronLexer 10 | """, 11 | ) 12 | -------------------------------------------------------------------------------- /tests/test0012.ctr: -------------------------------------------------------------------------------- 1 | #Test Simplified OOP - override and call super 2 | Animal is Object new. 3 | Animal on: 'makeSound' do: { 4 | Pen write: '?'. 5 | }. 6 | Cat is Animal new. 7 | Cat on: 'makeSound' do: { 8 | Pen write: 'meow!'. 9 | me `makeSound. #call makeSound on parent. 10 | }. 11 | Tom is Cat new. 12 | Tom makeSound. 13 | -------------------------------------------------------------------------------- /tests/test0176.exp: -------------------------------------------------------------------------------- 1 | Text Length: 10 2 | Text Length in bytes: 10 3 | Character at 2:r 4 | Byte at 2:114 5 | 5 6 | Text Length: 10 7 | Text Length in bytes: 10 8 | Character at 2:r 9 | Byte at 2:114 10 | 5 11 | Text Length: 10 12 | Text Length in bytes: 10 13 | Character at 2:r 14 | Byte at 2:114 15 | 5 16 | Leaking memory... 17 | -------------------------------------------------------------------------------- /plugins/sfml/Makefile: -------------------------------------------------------------------------------- 1 | comp: 2 | cc -c sfml.c -Wall -Werror -fPIC -o sfml.o 3 | link: 4 | cc -shared -o libctrsfml.so sfml.o -lcsfml-graphics -lcsfml-window -lcsfml-system 5 | copy: 6 | cp -f libctrsfml.so ../../mods 7 | clean: 8 | rm -f *.o *.so 9 | all: comp link copy 10 | debug: g3comp g3link copy 11 | default: all 12 | 13 | -------------------------------------------------------------------------------- /plugins/sfml/sfml.lo: -------------------------------------------------------------------------------- 1 | # sfml.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/sfml.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='sfml.o' 12 | 13 | -------------------------------------------------------------------------------- /tests/test0102.ctr: -------------------------------------------------------------------------------- 1 | #Test boolean nor 2 | motive is False. 3 | opportunity is False. 4 | Pen write: (motive ! opportunity). 5 | Pen write: (motive not & opportunity not). 6 | #Test boolean equality messages 7 | Pen write: (True = True). 8 | Pen write: (True !=: True). 9 | Pen write: (True !=: False). 10 | Pen write: (True = False). 11 | -------------------------------------------------------------------------------- /tests/test0197.ctr: -------------------------------------------------------------------------------- 1 | #Like test 45 but with continous GC (mode 4) to test for GC regressions. 2 | 3 | Broom mode: 4. 4 | { 5 | Pen write: 'hi there!'. 6 | thisBlock error: 'oops'. 7 | Pen write: 'hi there!'. 8 | { Pen write: 'dont print this'. } run. 9 | } catch: { :e 10 | Pen write: 'got ya!'. 11 | Pen write: e. 12 | }, run. 13 | -------------------------------------------------------------------------------- /tests/test0200.ctr: -------------------------------------------------------------------------------- 1 | #Like test 11 but with continous GC (mode 4) to test for GC regressions. 2 | Broom mode: 4. 3 | 4 | Animal is Object new. 5 | Animal on: 'makeSound' do: { 6 | Pen write: '?'. 7 | }. 8 | Cat is Animal new. 9 | Cat on: 'makeSound' do: { 10 | Pen write: 'meow!'. 11 | }. 12 | Tom is Cat new. 13 | Tom makeSound. 14 | -------------------------------------------------------------------------------- /tests/test0251.ctr: -------------------------------------------------------------------------------- 1 | #Can we use the unicode return arrow instead of the ascii one? 2 | 3 | Number on: 'describe' do: { 4 | var text is Nil. 5 | ( equals: 0 ) ifTrue: { 6 | text is 'zero'. 7 | }. 8 | ( equals: 1 ) ifTrue: { 9 | text is 'one'. 10 | }. 11 | ↑ text. 12 | }. 13 | 14 | Pen write: 0 describe + 1 describe, brk. 15 | -------------------------------------------------------------------------------- /tests/test0284.exp: -------------------------------------------------------------------------------- 1 | Python statistics: 2 | ran command: len( " " * (2000 - i) ), 3 | total time: 73028, 4 | best time: 23, 5 | average over 2000 : 36.514 6 | Citron statistics: 7 | ran command: (' ' * (2000 - i)) length, 8 | total time: 189023, 9 | best time: 17, 10 | average over 2000 : 94.5115 11 | -------------------------------------------------------------------------------- /tests/test0085.ctr: -------------------------------------------------------------------------------- 1 | #Functions test 2 | q is { ^9. } run. #yields 9 3 | Pen write: q, brk. 4 | q is { :a ^ a * a. } applyTo: 6. #yields 36 5 | Pen write: q, brk. 6 | q is { :a :b ^ (a + b). } applyTo: 3 and: 4. #yields 7 7 | Pen write: q, brk. 8 | q is { :a :b :c ^ (a + b + c). } applyTo: 3 and: 4 and: 1. #yields 8 9 | Pen write: q, brk. 10 | -------------------------------------------------------------------------------- /Library/Data/Range.ctr: -------------------------------------------------------------------------------- 1 | #Range is NOT a lazy iterator 2 | Number on: 'to:' do: {:end 3 | var f is Array new. 4 | me to: end step: 1 do: {:i 5 | f push: i. 6 | }. 7 | ^f. 8 | }. 9 | Number on: 'to:step:' do: {:end:step 10 | var f is Array new. 11 | me to: end step: step do: {:i 12 | f push: i. 13 | }. 14 | ^f. 15 | }. 16 | -------------------------------------------------------------------------------- /mk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #MK Script 3 | #Written by AnotherTest 4 | #Decides which makefile to use 5 | OS=$(uname -s) 6 | if [ "$OS" = "OpenBSD" -o "$OS" = "FreeBSD" ]; then 7 | echo "using BSD Makefile." 8 | make -f makefile.bsd 9 | else 10 | echo "using Linux Makefile." 11 | make -f makefile 12 | fi 13 | 14 | #Clear object files 15 | rm *.o 16 | -------------------------------------------------------------------------------- /mods/percolator/README.md: -------------------------------------------------------------------------------- 1 | # Percolator plugin 2 | 3 | This is where you put the Percolator plugin for example. 4 | In this folder there should be a file named `libctrpercolator.so`. 5 | 6 | This file will be loaded automatically whenever you access the Percolator object. 7 | 8 | Example: 9 | 10 | Percolator new --> loads the .so file! 11 | -------------------------------------------------------------------------------- /tests/test0021.ctr: -------------------------------------------------------------------------------- 1 | (2 < 9) ifTrue: { Pen write: 'Yes, nine is less than ten.'. }. 2 | (9 < 2) ifTrue: { Pen write: 'My logic fails'. }. 3 | Pen write: (-2 + 6). 4 | Pen write: (-3 - -3). 5 | TrueIsNice is 3. 6 | Pen write: TrueIsNice. 7 | FalseIsBad is 'Not true!'. 8 | Pen write: FalseIsBad. 9 | NilIsEmpty is 'Yep'. 10 | Pen write: NilIsEmpty. 11 | -------------------------------------------------------------------------------- /examples/reflect.ctr: -------------------------------------------------------------------------------- 1 | var Nen is Pen cnew : { 2 | my lol is Nil. 3 | me on: 'write:' do: { :s me `write: s, brk. }.#` 4 | }. 5 | 6 | 7 | var x is Reflect getMethodsOf: Nen. 8 | Nen write: x, brk. 9 | Nen write: (Reflect getPropertiesOf: Nen), brk. 10 | 11 | (Reflect objectExists: 'ImportLib') ifTrue: { ImportLib export: Nen as: 'ReflectTest'. }. 12 | -------------------------------------------------------------------------------- /plugins/fiber/Makefile: -------------------------------------------------------------------------------- 1 | all: comp link copy 2 | 3 | comp: 4 | cc -c ctr_fiber.c -Wall -Werror -fPIC -g3 -o ctf.o 5 | #cc -c libfiber-uc.c -fPIC -g3 -o libfiber.o 6 | 7 | link: 8 | cc -shared -o libctrfiber.so ctf.o 9 | 10 | copy: 11 | cp -f libctrfiber.so ../../mods/fiber 12 | 13 | clean: 14 | rm libctrfiber.so ctf.o 15 | 16 | default: all 17 | -------------------------------------------------------------------------------- /tests/test0013.ctr: -------------------------------------------------------------------------------- 1 | #Test Simplified OOP - not allowed to send `message from the outside! 2 | Animal is Object new. 3 | Animal on: 'makeSound' do: { 4 | Pen write: '?'. 5 | }. 6 | Cat is Animal new. 7 | Cat on: 'makeSound' do: { 8 | Pen write: 'meow!'. 9 | me `makeSound. #call makeSound on parent. 10 | }. 11 | Tom is Cat new. 12 | Tom `makeSound. 13 | -------------------------------------------------------------------------------- /tests/test0033.ctr: -------------------------------------------------------------------------------- 1 | #test assignment to my, same as 32 but with objects 2 | x is Object new. 3 | x on: 'set:' do: { :v my val is v. }. 4 | x on: 'get' do: { ^ my val. }. 5 | a is Object new. 6 | a on: 'init' do: { 7 | var y is x new. 8 | y set: 123. 9 | var q is x new. 10 | q set: 666. 11 | Pen write: (y get) , write: (q get). 12 | }. 13 | a init. 14 | -------------------------------------------------------------------------------- /tests/test0163.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'exists:' was called 3 | #1 exists: (tests/test0163.ctr: 11) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 9 | 7 | 10 | f is File new: '/tmp/citron_test_file.txt'. 8 | 11 | f exists: { f delete. }. 9 | ~~~~~~~~~~~^ 10 | 12 | f open: 'w'. 11 | -------------------------------------------------------------------------------- /tests/test0198.ctr: -------------------------------------------------------------------------------- 1 | #Like test 47 but with continous GC (mode 4) to test for GC regressions. 2 | 3 | Broom mode: 4. 4 | { 5 | var cat is Object new. 6 | cat on: 'work' do: { 7 | thisBlock error: 'Cats have personel for that!'. 8 | Pen write: 'dont print this!'. 9 | }. 10 | { cat work. } run. 11 | } catch: { :e 12 | Pen write: e. 13 | }, run. 14 | -------------------------------------------------------------------------------- /tests/test0239.exp: -------------------------------------------------------------------------------- 1 | True 2 | 100 3 | 666 4 | False 5 | Array ← 'hello' ; 'world' ; True ; Nil ; 666 ; 1 6 | (Map new) put:Nil at:Nil 7 | helloworldTrueNil6661 8 | Error noted: toNumber must return a number. 9 | Error noted: toNumber must return a number. 10 | Error noted: toNumber must return a number. 11 | Error noted: toNumber must return a number. 12 | -------------------------------------------------------------------------------- /plg.ctr: -------------------------------------------------------------------------------- 1 | import Library/Data/Iterator. 2 | 3 | Pen writeln: 'Took %d cycles' % [(Clock timeExecutionOf: { 4 | var it is Iterator elementsOf: [1,2,3,4,5]. 5 | it each: {:v Pen writeln: v. }. 6 | })]. 7 | 8 | Pen writeln: 'Took %d cycles' % [(Clock timeExecutionOf: { 9 | var it is [1,2,3,4,5]. 10 | it each_v: {:v Pen writeln: v. }. 11 | })]. 12 | -------------------------------------------------------------------------------- /tests/test0142.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'doesNotUnderstand' was called 3 | #1 doesNotUnderstand (tests/test0142.ctr: 6) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 4 | 7 | 5 | x is Object new. 8 | 6 | x doesNotUnderstand this. 9 | ~~~~~~~~~~~~~~~~~~~~~^ 10 | 7 | y doYouExist. 11 | -------------------------------------------------------------------------------- /tests/test0145.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Oops 3 | #3 error: (tests/test0145.ctr: 4) 4 | #2 times: (tests/test0145.ctr: 3) 5 | #1 times: (tests/test0145.ctr: 2) 6 | ------------------------------------ 7 | The probable cause of the exception: 8 | 2 | 9 | 3 | 3 times: { 10 | 4 | thisBlock error: 'Oops'. 11 | ~~~~~~~~~~~~~~~~~~~^ 12 | 5 | }. 13 | -------------------------------------------------------------------------------- /tests/test0164.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'exists:' was called 3 | #1 exists: (tests/test0164.ctr: 11) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 9 | 7 | 10 | f is File new: '/tmp/citron_test_file.txt'. 8 | 11 | f exists: { f delete. }. 9 | ~~~~~~~~~~~^ 10 | 12 | f write: 'hello'. 11 | -------------------------------------------------------------------------------- /Library/Foreign/C/errno.ctr: -------------------------------------------------------------------------------- 1 | var _errno is CTypes loadLibrary: Nil, errno. 2 | var _strerror is CTypes loadLibrary: Nil, strerror. 3 | var _strerror_ty is CIF new setABI: 0 return: (CTypes pointer) argTypes: [(CTypes sint)]. 4 | 5 | var g_strerror is { 6 | ^const _strerror_ty call: const _strerror withArgs: [(const _errno derefAs: CTypes sint, get)], readCString. 7 | }. 8 | -------------------------------------------------------------------------------- /autohell/examples/reflect.ctr: -------------------------------------------------------------------------------- 1 | var Nen is Pen cnew : { 2 | my lol is Nil. 3 | me on: 'write:' do: { :s me `write: s, brk. }.#` 4 | }. 5 | 6 | 7 | var x is Reflect getMethodsOf: Nen. 8 | Nen write: x, brk. 9 | Nen write: (Reflect getPropertiesOf: Nen), brk. 10 | 11 | (Reflect objectExists: 'ImportLib') ifTrue: { ImportLib export: Nen as: 'ReflectTest'. }. 12 | -------------------------------------------------------------------------------- /plugins/request/ccgi-1.2/t/Makefile: -------------------------------------------------------------------------------- 1 | # set OPENSSL_LIB to the directory containing openssl libcrypto 2 | 3 | OPENSSL_LIB = /usr/lib 4 | 5 | CFLAGS = -I .. 6 | LDFLAGS = -L .. -L $(OPENSSL_LIB) 7 | 8 | all: test.sh test 9 | ./test.sh 10 | 11 | test: test.o ../libccgi.a 12 | $(CC) -o test $(LDFLAGS) test.o -lccgi -lcrypto 13 | 14 | test.o: test.c ../ccgi.h 15 | -------------------------------------------------------------------------------- /tests/test0069.ctr: -------------------------------------------------------------------------------- 1 | #More String Tests 2 | #9897[Nil][Nil] 3 | Pen write: ('abc' byteAt: 1). 4 | Pen write: ('a' byteAt: 0). 5 | Pen write: ('zzz' byteAt: 10). 6 | Pen write: ('zzz' byteAt: -10). 7 | Pen brk. 8 | Pen write: (' left trimmed ' leftTrim) + ( 'and right trimmed ' rightTrim) + '!', brk. 9 | Pen write: '"html & entities"' htmlEscape. 10 | -------------------------------------------------------------------------------- /tests/test0103.exp: -------------------------------------------------------------------------------- 1 | 9 2 | a Object '[Object:Object]' is NOT Nil. 3 | a Boolean 'True' is NOT Nil. 4 | a Boolean 'False' is NOT Nil. 5 | a Boolean 'False' is NOT Nil. 6 | a Number '1' is NOT Nil. 7 | a Number '0' is NOT Nil. 8 | a String 'Str' is NOT Nil. 9 | a String '' is NOT Nil. 10 | a Block '[:Block]' is NOT Nil. 11 | but.. Nil is.. certainly NIL! 12 | -------------------------------------------------------------------------------- /tests/test0143.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'doesNotUnderstand' was called 3 | #1 doesNotUnderstand (tests/test0143.ctr: 6) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 4 | 7 | 5 | x is Object new. 8 | 6 | x doesNotUnderstand this. 9 | ~~~~~~~~~~~~~~~~~~~~~^ 10 | 7 | y doYouExist: (3 * 6). 11 | -------------------------------------------------------------------------------- /tests/test0203.ctr: -------------------------------------------------------------------------------- 1 | #Test too many contexts open icw GC mode 4 2 | #to demonstrate why there should be no early return in open_context() 3 | #as proposed in GH80/84 4 | 5 | Broom mode: 4. 6 | Broom autoAlloc: True. 7 | j is 1. 8 | 9 | func is { 10 | 11 | Pen write: 'Nested call #' + j, brk. 12 | j +=: 1. 13 | 14 | func run. 15 | }. 16 | 17 | func run. 18 | -------------------------------------------------------------------------------- /tests/test0249.ctr: -------------------------------------------------------------------------------- 1 | #test whether we can append a raw byte to a string. 2 | str is 'abc'. 3 | str appendByte: 96. 4 | Pen write: str, brk. 5 | 6 | q is Array < 234 ; 184 ; 176 ; 235 ; 130 ; 152 ; 32 ; 234 ; 184 ; 180 ; 32 ; 236 ; 151 ; 172 ; 237 ; 150 ; 137. 7 | 8 | a is ''. 9 | 10 | q each: { :i :b 11 | a appendByte: b. 12 | }. 13 | 14 | Pen write: a, brk. 15 | -------------------------------------------------------------------------------- /extensions/string.ctr: -------------------------------------------------------------------------------- 1 | String on: 'insert:at:' do: {:str:idx 2 | ^(me from: 0 to: idx) + str + (me from: idx to: me length). 3 | }. 4 | String on: 'removeFrom:to:' do: {:st:en 5 | ^(me from: 0 to: st) + (me from: en to: me length). 6 | }. 7 | String on: 'removeFrom:length:' do: {:st:ln 8 | ^(me from: 0 to: st) + (me from: (st + ln) to: me length). 9 | }. 10 | -------------------------------------------------------------------------------- /tests/test0162.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'exists:' was called 3 | #1 exists: (tests/test0162.ctr: 11) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 9 | 7 | 10 | f is File new: '/tmp/citron_test_file.txt'. 8 | 11 | f exists: { f delete. }. 9 | ~~~~~~~~~~~^ 10 | 12 | f write: 'hello world'. 11 | -------------------------------------------------------------------------------- /tests/test0165.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'exists:' was called 3 | #1 exists: (tests/test0165.ctr: 11) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 9 | 7 | 10 | f is File new: '/tmp/citron_test_file.txt'. 8 | 11 | f exists: { f delete. }. 9 | ~~~~~~~~~~~^ 10 | 12 | f write: 'hello world'. 11 | -------------------------------------------------------------------------------- /tests/test0167.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'exists:' was called 3 | #1 exists: (tests/test0167.ctr: 11) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 9 | 7 | 10 | f is File new: '/tmp/citron_test_file.txt'. 8 | 11 | f exists: { f delete. }. 9 | ~~~~~~~~~~~^ 10 | 12 | f write: 'hello world'. 11 | -------------------------------------------------------------------------------- /tests/test0168.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'exists:' was called 3 | #1 exists: (tests/test0168.ctr: 11) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 9 | 7 | 10 | f is File new: '/tmp/citron_test_file.txt'. 8 | 11 | f exists: { f delete. }. 9 | ~~~~~~~~~~~^ 10 | 12 | f write: 'hello world'. 11 | -------------------------------------------------------------------------------- /tests/test0169.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'exists:' was called 3 | #1 exists: (tests/test0169.ctr: 11) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 9 | 7 | 10 | f is File new: '/tmp/citron_test_file.txt'. 8 | 11 | f exists: { f delete. }. 9 | ~~~~~~~~~~~^ 10 | 12 | f write: 'hello world'. 11 | -------------------------------------------------------------------------------- /tests/test0231.ctr: -------------------------------------------------------------------------------- 1 | #Test the slurp object 2 | Slurp hello world. 3 | Pen write: (Slurp obtain), brk. #print 'hello world' 4 | Pen write: (Slurp obtain), brk. #then an empty line 5 | Slurp hello world. 6 | x is Slurp new. 7 | Pen write: (x obtain), brk. #another empty line, not hello... 8 | x hi there. 9 | Pen write: (x obtain), brk. #hi there, no space in front... 10 | -------------------------------------------------------------------------------- /Library/Utils/Timer/main.ctr: -------------------------------------------------------------------------------- 1 | var Timer is Object new. 2 | Timer on: 'timeBlock:' do: {:blk 3 | ^Clock timeExecutionOf: blk. 4 | }. 5 | Timer on: 'timeBlock:withArguments:' do: {:blk :args 6 | ^Clock timeExecutionOf: { 7 | const blk message: 'applyTo:' arguments: const args. 8 | }. 9 | }. 10 | 11 | import return: Timer. 12 | import export: Timer as: 'Timer'. 13 | -------------------------------------------------------------------------------- /examples/fizzbuzz.ctr: -------------------------------------------------------------------------------- 1 | # Fizz Buzz 2 | 3 | 1 to: 100 step: 1 do: { :i 4 | var f is 'Fizz'. 5 | var b is 'Buzz'. 6 | 7 | var s is i toString. 8 | i mod: 15, = 0 ifTrue: { 9 | s is f + b. 10 | }, ifFalse: { 11 | i mod: 3, = 0 ifTrue: { 12 | s is f. 13 | }. 14 | i mod: 5, = 0 ifTrue: { 15 | s is b. 16 | }. 17 | }. 18 | Pen write: ' $$s \n'. 19 | }. 20 | -------------------------------------------------------------------------------- /examples/json.ctr: -------------------------------------------------------------------------------- 1 | var json is '{"pen": 1043, "lol": [1, 3, 5, {"pen": "test"}]}'. 2 | 3 | var test is JSON parse: json. 4 | Pen write: test, brk. 5 | test is Object cnew: {my pen is 1043. my lol is Array new < 1 ; 3 ; 5 ; (Object cnew: {my pen is 'test'.}).}. 6 | #var test is Array new < 1 ; 3 ; 5 ; (Object cnew: {my dick is 'test"'.}). 7 | Pen write: (JSON serialize: test), brk. 8 | -------------------------------------------------------------------------------- /tests/test0120.ctr: -------------------------------------------------------------------------------- 1 | #Demonstrates/tests how to override the Pen object alias to implement 2 | #output buffering 3 | ? is Object new. 4 | ? on: 'init' do: { 5 | my buffer is ''. 6 | }. 7 | ? on: '>' do: { :str 8 | my buffer is my buffer + str. 9 | }. 10 | ? on: 'buffer' do: { ^ my buffer. }. 11 | ? init. 12 | ?>world=: 3) ifTrue: { Pen write: 'Yep'. }. 2 | (3 <=: 3) ifTrue: { Pen write: 'Yep'. }. 3 | (3 >=: 4) ifTrue: { Pen write: 'Nope'. }. 4 | (4 <=: 8) ifTrue: { Pen write: 'Yep'. }. 5 | (3 >=: 5 ) ifTrue: { Pen write: 'No'. }. 6 | ( 0 <=: 3 ) ifTrue: { Pen write: 'Yep'. }. 7 | ( 2 = 2 ) ifTrue: { Pen write: 'Yep'. }. 8 | ( 2.9 = 2.9 ) ifTrue: { Pen write: 'Yep'. }. 9 | -------------------------------------------------------------------------------- /tests/test0153.ctr: -------------------------------------------------------------------------------- 1 | #NOAST 2 | Nil averylongmessagethatcausesanerrorinthesystemaverylongmessagethatcausesanerrorinthesystemaverylongmessagethatcausesanerrorinthesystemaverylongmessagethatcausesanerrorinthesystemaverylongmessagethatcausesanerrorinthesystemaverylongmessagethatcausesanerrorinthesystemaverylongmessagethatcausesanerrorinthesystemaverylongmessagethatcausesanerrorinthesystem 3 | -------------------------------------------------------------------------------- /tests/test0196.ctr: -------------------------------------------------------------------------------- 1 | animal is Object new. 2 | 3 | animal on: 'name:' do: { :n 4 | my name is n. 5 | }. 6 | 7 | 8 | animal name: 'Diva'. 9 | 10 | animal on: 'name' do: { 11 | ^ my name. 12 | }. 13 | 14 | cat is animal new. 15 | 16 | cat name: 'Diva'. 17 | 18 | cat on: 'name' do: { 19 | ^ 'her royal highness ' 20 | + (me `name). 21 | }. 22 | 23 | Pen write: cat name. 24 | -------------------------------------------------------------------------------- /tests/test0201.ctr: -------------------------------------------------------------------------------- 1 | #Like test 12 but with continous GC (mode 4) to test for GC regressions. 2 | Broom mode: 4. 3 | 4 | Animal is Object new. 5 | Animal on: 'makeSound' do: { 6 | Pen write: '?'. 7 | }. 8 | Cat is Animal new. 9 | Cat on: 'makeSound' do: { 10 | Pen write: 'meow!'. 11 | me `makeSound. #call makeSound on parent. 12 | }. 13 | Tom is Cat new. 14 | Tom makeSound. 15 | -------------------------------------------------------------------------------- /tests/test0241.ctr: -------------------------------------------------------------------------------- 1 | #quotes should be escaped in strings! 2 | Q is (39 toByte). 3 | 4 | q is Array < ('Quotes ' + Q + ' are evil?') ; 1. 5 | x is q toString. 6 | Pen write: x, brk. 7 | y is x eval. 8 | Pen write: y @ 0, brk. 9 | 10 | q is Map put: Q at: (Q + 'quote' + Q). 11 | x is q toString. 12 | Pen write: x, brk. 13 | y is x eval. 14 | Pen write: y @ '\'quote\'', brk. 15 | -------------------------------------------------------------------------------- /autohell/examples/fizzbuzz.ctr: -------------------------------------------------------------------------------- 1 | # Fizz Buzz 2 | 3 | 1 to: 100 step: 1 do: { :i 4 | var f is 'Fizz'. 5 | var b is 'Buzz'. 6 | 7 | var s is i toString. 8 | i mod: 15, = 0 ifTrue: { 9 | s is f + b. 10 | }, ifFalse: { 11 | i mod: 3, = 0 ifTrue: { 12 | s is f. 13 | }. 14 | i mod: 5, = 0 ifTrue: { 15 | s is b. 16 | }. 17 | }. 18 | Pen write: ' $$s \n'. 19 | }. 20 | -------------------------------------------------------------------------------- /autohell/examples/json.ctr: -------------------------------------------------------------------------------- 1 | var json is '{"pen": 1043, "lol": [1, 3, 5, {"pen": "test"}]}'. 2 | 3 | var test is JSON parse: json. 4 | Pen write: test, brk. 5 | test is Object cnew: {my pen is 1043. my lol is Array new < 1 ; 3 ; 5 ; (Object cnew: {my pen is 'test'.}).}. 6 | #var test is Array new < 1 ; 3 ; 5 ; (Object cnew: {my dick is 'test"'.}). 7 | Pen write: (JSON serialize: test), brk. 8 | -------------------------------------------------------------------------------- /plugins/keyboardmods/makefile: -------------------------------------------------------------------------------- 1 | default: all 2 | 3 | all: compile link copy 4 | 5 | compile: 6 | cc ${EXTRAS} -c keyboardmods.c -Wall -fPIC -g3 -Wno-unused-function -Wno-format -o keyboardmods.o 7 | link: 8 | cc -shared -o libctrkeyboardmods.so keyboardmods.o 9 | 10 | copy: 11 | mkdir -p ../../basemods/keyboardmods 12 | cp -f libctrkeyboardmods.so ../../basemods/keyboardmods 13 | -------------------------------------------------------------------------------- /tests/test0054.ctr: -------------------------------------------------------------------------------- 1 | (Program argCount) times: { :i 2 | ((Program argument: i) !=: '-r') ifTrue: { 3 | (((Program argument: i) indexOf: '.ast') > -1) ifTrue: { 4 | Pen write: 'Found argument file.'. 5 | }. 6 | (((Program argument: i) indexOf: '.ctr') > -1) ifTrue: { 7 | Pen write: 'Found argument file.'. 8 | }. 9 | }. 10 | }. 11 | Pen write: (Program argument: 999). 12 | -------------------------------------------------------------------------------- /tests/test0092.ctr: -------------------------------------------------------------------------------- 1 | #Scope tests 2 | var g is 'global'. 3 | { var g is 'local'. Pen write: g, brk. } run. #local 4 | Pen write: g, brk. #global 5 | message is 'Bye'. 6 | var Secret is Object new. 7 | Secret on: 'test' do: { 8 | var message is 'Hello'. 9 | my message is 'World'. 10 | Pen write: message + ' ' + my message, brk. 11 | }. 12 | Secret test. 13 | Pen write: message. 14 | -------------------------------------------------------------------------------- /tests/test0100.ctr: -------------------------------------------------------------------------------- 1 | ?> 2 | 3 | 5 |

Hello this is a

6 |

The string '' has: ...

7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/test0193.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Key not found: me 3 | #3 me (tests/test0193.ctr: 4) 4 | #2 + (tests/test0193.ctr: 4) 5 | #1 write:grep: (tests/test0193.ctr: 4) 6 | ------------------------------------ 7 | The probable cause of the exception: 8 | 2 | 9 | 3 | line number 4... '. 10 | 4 | Pen write: 'testje.ctr' + grep: 'Shell'. 11 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 12 | -------------------------------------------------------------------------------- /tests/test0253.exp: -------------------------------------------------------------------------------- 1 | 2017-07-13 20:00:00 2 | 2017-07-13 21:00:00 3 | 2017-07-13 21:19:00 4 | 2017-07-13 21:20:00 5 | 2017-07-13 21:21:00 6 | 2017-07-13 21:21:19 7 | 2017-07-13 21:21:20 8 | 2017-07-13 21:21:21 9 | 2019-07-13 21:21:21 10 | 2020-07-13 21:21:21 11 | 2020-12-13 20:21:21 12 | 2021-01-13 20:21:21 13 | 2021-02-01 20:21:21 14 | 2021-02-01 21:21:21 15 | 2021-02-01 21:21:21 16 | -------------------------------------------------------------------------------- /autohell/examples/boolean.ctr: -------------------------------------------------------------------------------- 1 | # Smalltalkish Boolean 2 | 3 | Boolean on: 'ifTrue:ifFalse:' do: { :trueBlock :falseBlock 4 | me ifTrue: trueBlock. 5 | me ifFalse: falseBlock. 6 | }. 7 | 8 | 1 to: 10 step: 1 do: { :i 9 | i % 2 = 0 ifTrue: { 10 | Pen write: i, write: ' is an even number.\n'. 11 | } ifFalse: { 12 | Pen write: i, write: ' is an odds number.\n'. 13 | }. 14 | }. 15 | -------------------------------------------------------------------------------- /autohell/examples/mp.ctr: -------------------------------------------------------------------------------- 1 | File new: 'extensions/fileutils.ctr', include. 2 | ImportLib import: 'Multiprocessing' as: 'mp'. 3 | 4 | 5 | var children is mp from: 0 to: 16 numProcs: 15 do: { :i :pnum 6 | Pen write: 'test $$i', brk. 7 | } options: 'v'. 8 | 9 | (children count) times: { :i 10 | (children @ i) message: 'run'. 11 | }. 12 | 13 | (children @ ((children count) - 1)) join. 14 | -------------------------------------------------------------------------------- /tests/test0058.ctr: -------------------------------------------------------------------------------- 1 | #GC should not destroy blocks that have a reference 2 | Pen write: 'hi!'. 3 | a is 2. 4 | x is 2. 5 | { var c is 3. Pen write: 'x'. var t is 1. Broom sweep. } run. 6 | Broom sweep. 7 | q is 2. 8 | a is 22. 9 | t is { var d is 3. var z is 'hello'. Pen write: z.}. 10 | t run. 11 | Broom sweep. 12 | Pen write: ' a = ' + a + ' and q = ' + q + ' and x = ' + x. 13 | t run. 14 | -------------------------------------------------------------------------------- /tests/test0104.ctr: -------------------------------------------------------------------------------- 1 | #Test regular numeric for-loop 2 | 3 | 1 to: 6 step: 1 do: { :i 4 | Pen write: 'This is step #' + i, brk. 5 | }. 6 | 7 | 3 to: -2 step: -1 do: { :i 8 | Pen write: 'This is step #' + i, brk. 9 | }. 10 | 11 | 0 to: 0 step: 1 do: { :i 12 | Pen write: 'NEVER!', brk. 13 | }. 14 | 15 | -3 to: 2 step: 0.5 do: { :i 16 | Pen write: 'This is step #' + i, brk. 17 | }. 18 | -------------------------------------------------------------------------------- /tests/test0277.ctr: -------------------------------------------------------------------------------- 1 | var Person is Object new. 2 | 3 | Person on: 'greetingFor:' do: {:person ^'Hello, ' + person toString.}. 4 | Person on: 'introduce' do: {^'Hello.'.}. 5 | 6 | var Semicolon is Person new. 7 | Semicolon on: 'introduce' do: {^'I\'m AnotherTest and I\'m an alcoholoc.'.}. 8 | 9 | 10 | Pen write: (Semicolon greetingFor: 'Everyone') + '. ' + Semicolon introduce, brk. 11 | -------------------------------------------------------------------------------- /tests/test0049.ctr: -------------------------------------------------------------------------------- 1 | f1 is File new: 'notafile'. 2 | f2 is File new: '/tmp/test.txt'. 3 | (f2 exists) ifTrue: { f2 delete.}. 4 | Pen write: f2 path. 5 | f2 write: 'Hello!'. 6 | f2 append: 'World!'. 7 | Pen write: f2 read. 8 | (f2 exists) ifTrue: { Pen write: '!'. }. 9 | (f1 exists) ifTrue: { Pen write: '!'. }. 10 | Pen write: f2 size, write: f1 size. 11 | f2 delete. Pen write: f2 size. 12 | 13 | -------------------------------------------------------------------------------- /tests/test0256.ctr: -------------------------------------------------------------------------------- 1 | #Can we fork multiple childs and send them messages? 2 | children is Array new. 3 | 5 times: { :i 4 | var q is Program new: { :pro 5 | Clock wait: 1. 6 | pro listen: { :message 7 | Pen write: 'Child says: ' + message, brk. 8 | }. 9 | 10 | }. 11 | children push: q. 12 | }. 13 | children each: { :i :child 14 | child message: 'hello'. 15 | child join. 16 | }. 17 | -------------------------------------------------------------------------------- /Library/Control/Class/Classes.ctr: -------------------------------------------------------------------------------- 1 | # import main. 2 | 3 | var Classes is Map new. 4 | Classes on: 'new:contract:' do: {:name :contract 5 | me at: name, isNil ifFalse: {thisBlock error: 'Redefintion of existing class $$name'.}. 6 | me put: (Class new init: contract) at: name. 7 | }. 8 | 9 | Classes on: 'respondTo:' do: {:name ^me at: name.}. 10 | 11 | import export: Classes as: 'Classes'. 12 | -------------------------------------------------------------------------------- /tests/test0088.ctr: -------------------------------------------------------------------------------- 1 | #Test scope, common scenarios 2 | santaLaugh is 'ho'. 3 | laugh is ''. 4 | 3 times: { laugh is laugh + santaLaugh. }.#This should capture and modify dynamically 5 | Pen write: laugh, brk. 6 | 7 | locked is False. 8 | security is True. 9 | security ifTrue: { locked is True. }. 10 | Pen write: locked, brk. 11 | 12 | n is 7. 13 | (True) ifTrue: { n is 9. }. 14 | Pen write: n. 15 | -------------------------------------------------------------------------------- /tests/test0127.exp: -------------------------------------------------------------------------------- 1 | Confirmed. Target file does not exist. 2 | hello world 3 | Uncaught error has occurred. 4 | Unknown method Object::'open' was called 5 | #1 open (tests/test0127.ctr: 19) 6 | ------------------------------------ 7 | The probable cause of the exception: 8 | 17 | 9 | 18 | 10 | 19 | f open. #not good 11 | ~~~~~~~~~^ 12 | 20 | q is f readBytes: 1. #but should not cause segfault 13 | -------------------------------------------------------------------------------- /tests/test0257.exp: -------------------------------------------------------------------------------- 1 | hello1 2 | Uncaught error has occurred. 3 | a child process can not join. 4 | #3 join (tests/test0257.ctr: 4) 5 | #2 new: (tests/test0257.ctr: 2) 6 | #1 x (tests/test0257.ctr: 2) 7 | ------------------------------------ 8 | The probable cause of the exception: 9 | 2 | 10 | 3 | Pen write: 'hello1\n'. 11 | 4 | child join. 12 | ~~~~~~~~~~~~~^ 13 | 5 | Pen write: 'hello2\n'. 14 | -------------------------------------------------------------------------------- /Library/Foreign/C/Storable/main.ctr: -------------------------------------------------------------------------------- 1 | import Library/Foreign/C/C_Types: ['c_uint8', 'c_ptr', 'load_library']. 2 | 3 | var thisexec is load_library applyTo: 'thisexec'. 4 | 5 | var cache is c_uint8. 6 | 7 | var readMem is \:p:sz p readBytes: sz. #Read sz bytes starting at p 8 | var writeMem is \:p:bytes bytes each_v: \:byte p derefSet: (cache set: byte). #Write all the bytes in @bytes into memory starting at p 9 | -------------------------------------------------------------------------------- /autohell/scripts/Makefile.am: -------------------------------------------------------------------------------- 1 | extensiondir = $(datadir)/@PACKAGE@/extensions 2 | extension_DATA = *.ctr 3 | bin_SCRIPTS = citron 4 | install-data-local: 5 | rm -rf $(datadir)/@PACKAGE@/Library 6 | rm -rf $(datadir)/@PACKAGE@/mods 7 | rm -rf $(datadir)/@PACKAGE@/basemods 8 | cp -Lrf mods $(datadir)/@PACKAGE@/ 9 | cp -Lrf Library $(datadir)/@PACKAGE@/ 10 | cp -Lrf basemods $(datadir)/@PACKAGE@/ 11 | -------------------------------------------------------------------------------- /tests/test0020.ctr: -------------------------------------------------------------------------------- 1 | (Nil = Nil) ifTrue: { Pen write: 'Nil is Nil!'.}. 2 | (2 > 1) ifTrue: { Pen write: 'YES'. }. 3 | (2 > 3) ifTrue: { Pen write: 'NO'. }. 4 | (2 > 3) ifFalse: { Pen write: 'Nonono..'.}. 5 | True ifTrue: { Pen write: 'TRUE is TRUE!'. }. 6 | (True) ifTrue: { Pen write: 'TRUE is TRUE!'. }. 7 | False ifFalse: { Pen write: 'FALSE is FALSE!'. }. 8 | (False) ifFalse: { Pen write: 'FALSE is FALSE!'. }. 9 | -------------------------------------------------------------------------------- /tests/test0036.ctr: -------------------------------------------------------------------------------- 1 | Broom autoAlloc: True. 2 | 3 | 1000 times: { 4 | var a is 'First'. 5 | var b is 'Second'. 6 | a is b. 7 | var garbageMaker is Object new. 8 | garbageMaker on: 'putGarbageOnScreen' do: { 9 | var x is 1. 10 | var y is 2. 11 | Broom sweep. 12 | }. 13 | garbageMaker putGarbageOnScreen. 14 | Pen write: a. 15 | #dont remove your own code block. 16 | Broom sweep. 17 | }. 18 | -------------------------------------------------------------------------------- /tests/test0008.ctr: -------------------------------------------------------------------------------- 1 | Greeter is Object new. 2 | Greeter on: 'make' do: { 3 | var greeter is Object new. 4 | greeter on: 'name:' do: { :name 5 | Pen write: 'setting a name'. 6 | my myName is name. 7 | }. 8 | greeter on: 'greet' do: { 9 | Pen write: 'Hello'. 10 | Pen write: my myName. 11 | }. 12 | ^greeter. 13 | }. 14 | greeter is Greeter make. 15 | greeter name: 'sunshine!'. 16 | greeter greet. 17 | -------------------------------------------------------------------------------- /tests/test0026.ctr: -------------------------------------------------------------------------------- 1 | Pen write: 'Hello' bytes. 2 | Pen write: 'Great' bytes + 5. 3 | Pen write: '象形' bytes - '象形' length. 4 | Pen write: ('Hello!' from: 1 to: 4). 5 | Pen write: ('Hello!' from: 2 to: 5). 6 | a is 2. 7 | b is 5. 8 | Pen write: ('Hello!' from: a to: b). 9 | Pen write: ('形声字形聲字' from: 2 to: 5). 10 | Pen write: '形声字形聲字' length. 11 | Pen write: '形声a' length. 12 | Pen write: 'Organ' + 'Works'. 13 | -------------------------------------------------------------------------------- /tests/test0174.exp: -------------------------------------------------------------------------------- 1 | number of RGB codes in palette: 3 2 | RGB code of green is: #0F0 3 | All colors in palette: blue:#00Fgreen:#0F0red:#F00 4 | number of RGB codes in palette: 3 5 | RGB code of green is: #0F0 6 | All colors in palette: blue:#00Fgreen:#0F0red:#F00 7 | number of RGB codes in palette: 3 8 | RGB code of green is: #0F0 9 | All colors in palette: blue:#00Fgreen:#0F0red:#F00 10 | Leaking memory... 11 | -------------------------------------------------------------------------------- /tests/test0186.exp: -------------------------------------------------------------------------------- 1 | False 2 | True 3 | False 4 | True 5 | False 6 | True 7 | False 8 | True 9 | False 10 | True 11 | False 12 | True 13 | False 14 | True 15 | False 16 | True 17 | False 18 | True 19 | False 20 | True 21 | False 22 | True 23 | False 24 | True 25 | False 26 | True 27 | False 28 | True 29 | False 30 | True 31 | False 32 | True 33 | False 34 | True 35 | False 36 | True 37 | Leaking memory... 38 | -------------------------------------------------------------------------------- /Library/AST/main.ctr: -------------------------------------------------------------------------------- 1 | var PLAIN_TYPES is ['LTRSTRING', 'LTRNIL', 'LTRNUM', 'LTRBOOLTRUE', 'LTRBOOLFALSE', 'REFERENCE']. 2 | 3 | AST on: 'dump' do: { 4 | var dump is Array < [(me type), (me)]. 5 | (me count = 0) & (const PLAIN_TYPES contains: me type) ifTrue: { ^[(me type), me]. }. 6 | me each_v: {:ast 7 | dump push: ast dump. 8 | }. 9 | ^dump. 10 | }. 11 | 12 | import constructors.#, descriptors. 13 | -------------------------------------------------------------------------------- /examples/shared.ctr: -------------------------------------------------------------------------------- 1 | var ra is Reflect newSharedObject. 2 | var i is Reflect newSharedObject. 3 | Reflect link: i to: 1. 4 | Pen write: i, brk. 5 | 6 | ra on: 'test' do: {i +=: 1. Pen write: 'test' + i, brk.}. 7 | 8 | var c is Program new: {:c Pen write: 'in child: $$i', brk. ra test. Pen write: 'in child after test: $$i', brk.}. 9 | 10 | c join. 11 | 12 | Pen write: 'in parent: $$i', brk. 13 | Broom sweep. 14 | -------------------------------------------------------------------------------- /plugins/tcl/makefile: -------------------------------------------------------------------------------- 1 | default: all 2 | 3 | all: compile copy 4 | 5 | compile: 6 | gcc ${EXTRAS} -I/software/tcl-7.4/include -I/software/tk-4.0/include -I/software/x11r5_dev/Include -L/software/tcl-7.4/lib -L/software/tk-4.0/lib -L/software/x11r5_dev/lib -ltk -ltcl -lX11 -lcitron -rdynamic -fpic -shared tcl.c -o libctrtcl.so 7 | 8 | copy: 9 | mkdir -p ../../mods/tcl 10 | cp -f libctrtcl.so ../../mods/tcl 11 | -------------------------------------------------------------------------------- /tests/ptest/test.ctr: -------------------------------------------------------------------------------- 1 | var th is Thread new: { 2 | Pen writeln: '\nThread %s finished in %s ticks' % [(Thread name), (Clock timeExecutionOf: { 3 | 500 times: {:i 4 | Pen write: i + ', '. 5 | }. 6 | })]. 7 | }. 8 | Pen writeln: 'Thread %s finished in %s ticks.' % [(Thread name), (Clock timeExecutionOf: { 9 | th run. 10 | Clock wait: 300000. 11 | th join. 12 | })]. 13 | -------------------------------------------------------------------------------- /tests/test0192.ctr: -------------------------------------------------------------------------------- 1 | #Like test 75 but with continous GC (mode 4) to test for GC regressions. 2 | 3 | Broom mode: 4. 4 | 5 | i is 0. 6 | Pen write: 'Can we count to 10 using a whileTrue loop ?', brk. 7 | { i +=: 1. ^ (i <=: 10). } whileTrue: { Pen write: i, brk. }. 8 | Pen write: 'Can we count back from 10 to 0 using a whileFalse loop ?', brk. 9 | { i -=: 1. ^ (i >=: 0). } whileTrue: { Pen write: i, brk. }. 10 | -------------------------------------------------------------------------------- /Library/Functional/TypeClass/Category.ctr: -------------------------------------------------------------------------------- 1 | import Library/Control/Error/NotImplementedError. 2 | var Category is Object new. 3 | Category on: 'compose:' do: { 4 | thisBlock error: (NotImplementedError $ 'Category#compose:'). 5 | }, 6 | on: 'id' do: { 7 | thisBlock error: (NotImplementedError $ 'Category#id'). 8 | }, 9 | on: '<' do: {:o 10 | ^me compose: o. 11 | }. 12 | 13 | import export: Category as: 'Category'. 14 | -------------------------------------------------------------------------------- /autohell/examples/shared.ctr: -------------------------------------------------------------------------------- 1 | var ra is Reflect newSharedObject. 2 | var i is Reflect newSharedObject. 3 | Reflect link: i to: 1. 4 | Pen write: i, brk. 5 | 6 | ra on: 'test' do: {i +=: 1. Pen write: 'test' + i, brk.}. 7 | 8 | var c is Program new: {:c Pen write: 'in child: $$i', brk. ra test. Pen write: 'in child after test: $$i', brk.}. 9 | 10 | c join. 11 | 12 | Pen write: 'in parent: $$i', brk. 13 | Broom sweep. 14 | -------------------------------------------------------------------------------- /tests/test0041.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Unknown method Object::'nonexistantmessage' was called 3 | #1 nonexistantmessage (tests/test0041.ctr: 2) 4 | ------------------------------------ 5 | The probable cause of the exception: 6 | 1 | #a non existing message should not trigger an error or produce any output. 7 | 2 | Pen nonexistantmessage. 8 | ~~~~~~~~~~~~~~~~~~~~~~~~^ 9 | 3 | Pen nonexistantmessage: 'b'. 10 | -------------------------------------------------------------------------------- /tests/test0044.ctr: -------------------------------------------------------------------------------- 1 | list is Array new. 2 | list push: 'hello'. 3 | Pen write: list count. 4 | list push: 'world'. 5 | Pen write: list count. 6 | Pen write: list pop, write: list count. 7 | list push: 'there'. 8 | Pen write: list count. 9 | Pen write: (list at: 0), write: (list at: 1). 10 | list put: 'xmas' at: 1. 11 | list put: 'merry' at: 0. 12 | Pen write: list count. 13 | Pen write: (list at: 0), write: (list at: 1). 14 | -------------------------------------------------------------------------------- /tests/test0108.ctr: -------------------------------------------------------------------------------- 1 | #Test odd an even messages. 2 | (7 odd) ifTrue: { Pen write: '7 is an ODD NUMBER', brk. }, else: { Pen write: 'WRONG!'. }. 3 | (4 even) ifTrue: { Pen write: '4 is an EVEN NUMBER', brk. }, else: { Pen write: 'WRONG!'. }. 4 | (5 even) ifTrue: { Pen write: 'WRONG!'. }, else: { Pen write: '5 is NOT AN EVEN NUMBER', brk. }. 5 | (6 odd) ifTrue: { Pen write: 'WRONG!'. }, else: { Pen write: '6 is NOT AN ODD NUMBER', brk. }. 6 | -------------------------------------------------------------------------------- /tests/test0232.exp: -------------------------------------------------------------------------------- 1 | + 3 2 | echo Hello world 3 | Uncaught error has occurred. 4 | Unknown method Object::'tellme:and:' was called 5 | #1 tellme:and: (tests/test0232.ctr: 7) 6 | ------------------------------------ 7 | The probable cause of the exception: 8 | 5 | 9 | 6 | Pen write: (x obtain), brk. 10 | 7 | x tellme: 123 and: 987. #This should fail...maybe change that? 11 | ~~~~~~~~~~^ 12 | 8 | Pen write: (x obtain), brk. 13 | -------------------------------------------------------------------------------- /tests/test0248.exp: -------------------------------------------------------------------------------- 1 | String 2 | Array ← ((Map new) put:(Array ← ((Map new) put:'2017-01-01' at:'created', put:'' at:'body', put:'home' at:'title') ; ((Map new) put:'Author Inc.' at:'body', put:'aboutus(c)' at:'title')) at:'pages', put:'domain' at:'mywebsite.com') 3 | Author Inc. 4 | String 5 | (Map new) put:'2017-01-01' at:'created', put:'' at:'body', put:'home' at:'title' 6 | -------------------------------------------------------------------------------- /makefile.bsd: -------------------------------------------------------------------------------- 1 | CFLAGS = -pedantic-errors -std=gnu99 -mtune=native -O2 2 | OBJS = siphash.o utf8.o memory.o util.o base.o collections.o file.o system.o \ 3 | world.o reflect.o lexer.o parser.o walker.o citron.o 4 | 5 | .SUFFIXES: .o .c 6 | 7 | all:ctr 8 | 9 | install: ctr 10 | cp ./ctr /usr/bin/ctr 11 | 12 | ctr: $(OBJS) 13 | $(CC) $(OBJS) -O2 -rdynamic -lm -o ctr.html 14 | 15 | clean: 16 | rm -rf ${OBJS} ctr 17 | 18 | -------------------------------------------------------------------------------- /plugins/request/ccgi-1.2/README: -------------------------------------------------------------------------------- 1 | You may need to edit Makefile and t/Makefile to specify where 2 | your openssl include files and libraries are located. To build 3 | without openssl see the comments in Makefile. 4 | 5 | To build: make 6 | 7 | To test: make test (requires openssl) 8 | 9 | To install: 10 | copy libccgi.a to a lib directory such as /usr/local/lib 11 | copy ccgi.h to an include directory such as /usr/local/include 12 | -------------------------------------------------------------------------------- /examples/serialization/serializing.pl: -------------------------------------------------------------------------------- 1 | use lib qw(..); 2 | 3 | use JSON qw( ); 4 | 5 | my $filename = 'generated (1).json'; 6 | 7 | my $json_text = do { 8 | open(my $json_fh, "<:encoding(UTF-8)", $filename) 9 | or die("Can't open \$filename\": $!\n"); 10 | local $/; 11 | <$json_fh> 12 | }; 13 | 14 | my $json = JSON->new; 15 | my $data = $json->decode($json_text); 16 | 17 | my $json_text = JSON->new->utf8->encode($data); 18 | 19 | -------------------------------------------------------------------------------- /tests/test0010.ctr: -------------------------------------------------------------------------------- 1 | #Test Crude OO (BlackScripty), basic 2 | Animal is Object new. 3 | Animal on: 'make' do: { 4 | var animal is Object new. 5 | animal on: 'makeSound' do: { 6 | Pen write: my sound. 7 | }. 8 | ^animal. 9 | }. 10 | Cat is Object new. 11 | Cat on: 'make' do: { 12 | var cat is Animal make. 13 | cat on: 'init' do: { 14 | my sound is 'meow!'. 15 | }. 16 | cat init. 17 | ^cat. 18 | }. 19 | tom is Cat make. 20 | tom makeSound. 21 | -------------------------------------------------------------------------------- /tests/test0086.ctr: -------------------------------------------------------------------------------- 1 | #Scope tests 2 | { var q is 1. { Pen write: q. } run. } run. #prints 1. 3 | Pen brk. 4 | { var q is 1. { q is 2. Pen write: q. } run. } run. #prints 2. 5 | Pen brk. 6 | f is { q is 2. }. { var q is 1. f run. Pen write: q. } run. 7 | Pen brk. 8 | { var q is 1. { x is 2. Pen write: x. } run. } #Not allowed x is not defined 9 | catch: { Pen write: 'Error, cannot assign, key not found: x, forgot to use var ?'. }, run. 10 | Pen brk. 11 | -------------------------------------------------------------------------------- /tests/test0103.ctr: -------------------------------------------------------------------------------- 1 | #Nil tests 2 | a is Array < Object ; True ; False ; Boolean ; 1 ; Number ; 'Str' ; String ; {}. 3 | Pen write: (a count), brk. 4 | (a count) times: { :i 5 | Pen write: 6 | 'a ' + 7 | ((a @ i) type) + 8 | ' \''+((a @ i))+'\' '+ 9 | ' is ' + 10 | (((a @ i) isNil) either: '' or: 'NOT') + 11 | ' Nil.', 12 | brk. 13 | }. 14 | Pen write: 'but.. Nil is.. ' + ((Nil isNil) either: 'certainly NIL!' or: 'not NIL??'), brk. 15 | -------------------------------------------------------------------------------- /autohell/examples/serialization/serializing.pl: -------------------------------------------------------------------------------- 1 | use lib qw(..); 2 | 3 | use JSON qw( ); 4 | 5 | my $filename = 'generated (1).json'; 6 | 7 | my $json_text = do { 8 | open(my $json_fh, "<:encoding(UTF-8)", $filename) 9 | or die("Can't open \$filename\": $!\n"); 10 | local $/; 11 | <$json_fh> 12 | }; 13 | 14 | my $json = JSON->new; 15 | my $data = $json->decode($json_text); 16 | 17 | my $json_text = JSON->new->utf8->encode($data); 18 | 19 | -------------------------------------------------------------------------------- /Library/Control/Method/main.ctr: -------------------------------------------------------------------------------- 1 | var send_message is Object new. 2 | 3 | send_message on: 'respondTo:' do: {:msg 4 | ^{:obj:*args ^obj message: const msg arguments: args. }. 5 | }. 6 | send_message on: '&' do: {:msg 7 | ^{:obj:*args ^obj message: const msg arguments: args. }. 8 | }. 9 | send_message on: 'name:apply:' do: {:msg:as 10 | ^{:obj:*args ^obj message: const msg arguments: const as + args. }. 11 | }. 12 | import export: send_message as: '&Meth'. 13 | -------------------------------------------------------------------------------- /examples/sdl/bigD.ctr: -------------------------------------------------------------------------------- 1 | var window is SDL new init. 2 | var red is Color rgb: [255,0,0]. 3 | var r is 30. 4 | var buf is window newBufferWithWidth: 2 * r andHeight: 2 * r. 5 | buf filledCircle_x0: r y0: r r0: r color: red. 6 | 7 | window blit: buf fromRect: Nil toRect: (SDL newRectWithX: 320 - r andY: 240 andW: 0 andH: 0). 8 | window filledEllipse_x0: 320 y0: 240 - (2 * r) r0: r r1: 2 * r color: red. 9 | 10 | window update. 11 | 12 | Program waitForInput. 13 | -------------------------------------------------------------------------------- /autohell/examples/sdl/bigD.ctr: -------------------------------------------------------------------------------- 1 | var window is SDL new init. 2 | var red is Color rgb: [255,0,0]. 3 | var r is 30. 4 | var buf is window newBufferWithWidth: 2 * r andHeight: 2 * r. 5 | buf filledCircle_x0: r y0: r r0: r color: red. 6 | 7 | window blit: buf fromRect: Nil toRect: (SDL newRectWithX: 320 - r andY: 240 andW: 0 andH: 0). 8 | window filledEllipse_x0: 320 y0: 240 - (2 * r) r0: r r1: 2 * r color: red. 9 | 10 | window update. 11 | 12 | Program waitForInput. 13 | -------------------------------------------------------------------------------- /tests/test0063.ctr: -------------------------------------------------------------------------------- 1 | #test custom binary message 2 | Product is Object new. 3 | Product on: 'a' do: { :price 4 | Pen write: 'cost '+ price. 5 | }. 6 | Apples is Product new. 7 | Pen write: 'Apples cost: '. 8 | Apples a 60. 9 | Pen write: ' cent a piece.'. 10 | #and now a funny unicode one... a very cool trick! 11 | #let's extend the number object with a unicode times equivalent! 12 | Number on: '×' do: { :b 13 | me times: b. 14 | }. 15 | 7 × { :i Pen write: i. }. 16 | -------------------------------------------------------------------------------- /tests/test0141.exp: -------------------------------------------------------------------------------- 1 | Test Stack trace over multiple files. 2 | Trigger an erroraaaUncaught error has occurred. 3 | Hi! 4 | #4 error: (/home/ali/Documents/ProjectCitron/citron/tests/test0140.ctr: 11) 5 | #3 run (/home/ali/Documents/ProjectCitron/citron/tests/test0140.ctr: 12) 6 | #2 run (/home/ali/Documents/ProjectCitron/citron/tests/test0140.ctr: 15) 7 | #1 include (tests/test0141.ctr: 4) 8 | ------------------------------------ 9 | The probable cause of the exception: 10 | -------------------------------------------------------------------------------- /tests/test0229.exp: -------------------------------------------------------------------------------- 1 | 17466716115803712783 2 | 17466716115803712783 3 | Uncaught error has occurred. 4 | Key must be exactly 16 bytes long. 5 | #2 hashWithKey: (tests/test0229.ctr: 4) 6 | #1 write: (tests/test0229.ctr: 4) 7 | ------------------------------------ 8 | The probable cause of the exception: 9 | 2 | 10 | 3 | Pen write: ('hello' hashWithKey: '1234567890123456'), brk. 11 | 4 | Pen write: ('hello' hashWithKey: '123'), brk. 12 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 13 | -------------------------------------------------------------------------------- /Library/Control/Error/NotImplementedError.ctr: -------------------------------------------------------------------------------- 1 | var NotImplementedError is Object cnew: { 2 | message => ''. 3 | }, on: '$' do: {:msg 4 | ^me cnew: { 5 | message => msg. 6 | }. 7 | }, on: 'new' do: { 8 | ^me cnew: { 9 | message => ''. 10 | }. 11 | }, on: 'type' do: { 12 | ^'NotImplementedError'. 13 | }, on: 'toString' do: { 14 | ^'%s is/are not implemented' % [my message]. 15 | }. 16 | 17 | import export: NotImplementedError as: 'NotImplementedError'. 18 | -------------------------------------------------------------------------------- /tests/test0195.exp: -------------------------------------------------------------------------------- 1 | Uncaught error has occurred. 2 | Division by zero. 3 | #2 / (tests/test0195.ctr: 4) 4 | #1 a (tests/test0195.ctr: 4) 5 | ------------------------------------ 6 | The probable cause of the exception: 7 | 2 | 8 | 3 | line 3 '. 9 | 4 | a is 1 / 0. #line 4, not 3.mrespondTo:and:mrespondTo:and:and:and:and:and:mrespondTo:and:and:and:and:mrespondTo:and:and:and:mrespondTo:and:and:m:mrespondTo:and:mrespondTo:m was already loadedm[ctr]::module m 10 | ~~~~~~~~~~^ 11 | -------------------------------------------------------------------------------- /playground/playground.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Citron Playground 6 | 7 | 8 |
9 | 10 |
11 | 12 | 13 | 18 | 19 | -------------------------------------------------------------------------------- /plugins/termbox/test.ctr: -------------------------------------------------------------------------------- 1 | Broom autoAlloc: True. 2 | #Broom mode: 0. 3 | 4 | import ctrterm. 5 | 6 | Termbox init. 7 | mid_w is Termbox width / 2 floor. 8 | mid_h is Termbox height / 2 floor. 9 | mid is [mid_w, mid_h]. 10 | alt is False. 11 | 12 | 500 times: { 13 | Termbox change_cell: mid toChar: -1 colors: [1,2]. 14 | Clock wait: 10000. 15 | Termbox present. 16 | }. 17 | 18 | Pen writeln: 'out of loop'. 19 | 20 | Termbox shutdown. 21 | Pen writeln: 'Shutdown'. 22 | -------------------------------------------------------------------------------- /tests/test0056.ctr: -------------------------------------------------------------------------------- 1 | z is Object new. 2 | z on: 'value:' do: { :v 3 | my value is v. 4 | ^ me. 5 | }. 6 | z on: 'value' do: { ^ my value. }. 7 | (z value: 1) value: 2. 8 | Pen write: z value. 9 | x is z. 10 | Pen write: x value. 11 | z is Nil. 12 | { 13 | Pen write: z value. #should error 14 | } catch: {:e Pen write: e.}, run. 15 | Pen write: x value. #x should still have a reference to the object z had 16 | Pen write: 'hello'. 17 | Pen write: 3 + 2. 18 | Pen write: (3 > 2). 19 | -------------------------------------------------------------------------------- /tests/test0009.ctr: -------------------------------------------------------------------------------- 1 | Greeter is Object new. 2 | Greeter on: 'make' do: { 3 | var greeter is Object new. 4 | greeter on: 'name:' do: { :name 5 | Pen write: 'setting a name'. 6 | my myName is name. 7 | }. 8 | greeter on: 'performGreeting' do: { 9 | Pen write: 'Hello'. 10 | Pen write: my myName. 11 | }. 12 | greeter on: 'greet' do: { 13 | me performGreeting. 14 | }. 15 | ^greeter. 16 | }. 17 | greeter is Greeter make. 18 | greeter name: 'sunshine!'. 19 | greeter greet. 20 | -------------------------------------------------------------------------------- /tests/test0070.ctr: -------------------------------------------------------------------------------- 1 | numbers is '1,2,3' split: ','. 2 | Pen write: 'I got: ' + numbers count + ' numbers.' ,brk. 3 | 3 times: { :i Pen write: 'number #' + i + ':' + (numbers at: i), brk.}. 4 | beverages is 'Tea Or Coffee Or Milk Or Orange Juice Or Water'. 5 | beverages is beverages split: ' Or '. 6 | Pen write: 'We serve', brk. 7 | (beverages count) times: { :i Pen write: '->' + (beverages at: i), brk. }. 8 | Pen write: (beverages join: ','), brk. 9 | Pen write: (numbers join: '||'). 10 | -------------------------------------------------------------------------------- /tests/test0014.ctr: -------------------------------------------------------------------------------- 1 | Greeter is Object new. 2 | Greeter on: 'make' do: { 3 | var gr is Object new. 4 | gr on: 'setName:' do: { :aname 5 | my name is aname. 6 | }. 7 | gr on: 'greet' do: { 8 | Pen write: my name. 9 | }. 10 | ^gr. 11 | }. 12 | a is Greeter make. 13 | b is Greeter make. 14 | a setName: 'ONE'. 15 | b setName: 'TWO'. 16 | a greet. 17 | b greet. 18 | c is a new. 19 | c setName: 'THREE'. 20 | c greet. 21 | d is a new. 22 | d setName: 'FOUR'. 23 | d greet. 24 | c greet. 25 | -------------------------------------------------------------------------------- /tests/test0282.ctr: -------------------------------------------------------------------------------- 1 | var tbs is Object cnew: { 2 | my test is '5'. 3 | my trash is 123. 4 | my complex is Object cnew: {my imaginary is 1. my real is 2.}. 5 | my array is [1,2,3,4,'test', (Object cnew: {my inner is [1].})]. 6 | }. 7 | var handle is Curl new. 8 | handle url: 'https://requestb.in/1a5a2s31', 9 | post: True, 10 | httpheader: ['content-type: application/json'], 11 | copypostfields: (JSON serialize: tbs). 12 | 13 | Pen write: (handle perform), brk. 14 | -------------------------------------------------------------------------------- /integration/gml/integ.ctr: -------------------------------------------------------------------------------- 1 | File new: (File extensionsPath) + '/extensions/fileutils.ctr', include. 2 | 3 | ImportLib Queue. 4 | 5 | {^True.} whileTrue: { 6 | (File new: 'o.txt', exists) ifTrue: { 7 | var s is File new: 'o.txt', read trim. 8 | (s !=: '') ifTrue: { 9 | File new: 'o.txt', delete. 10 | var x is s eval. 11 | File new: 'i.txt', write: ('"' + (x serialize) + '"'), end. 12 | }. 13 | }. 14 | Broom sweep. 15 | }. 16 | -------------------------------------------------------------------------------- /tests/test0080.ctr: -------------------------------------------------------------------------------- 1 | { 2 | var a is Array new. 3 | a push: 1. 4 | a push: 2. 5 | Pen write: (a join: ','), brk. 6 | a put: 3 at: 2. 7 | Pen write: (a join: ','), brk. 8 | a put: 4 at: 10. 9 | Pen write: (a join: ','), brk. 10 | a shift. 11 | a shift. 12 | a shift. 13 | Pen write: (a join: ','), brk. 14 | a put: 9 at: 0. 15 | Pen write: (a join: ','), brk. 16 | a put: 6 at: -1. 17 | } catch: { :e 18 | Pen write: 'Uncatched error has occurred.\n' + e, brk. 19 | }, run. 20 | 21 | 22 | -------------------------------------------------------------------------------- /integration/gml/game_errors.log: -------------------------------------------------------------------------------- 1 | ERROR in 2 | action number 1 3 | of Key Release Event for A-key Key 4 | for object main: 5 | 6 | File is not opened for reading. 7 | 8 | 9 | ERROR in 10 | action number 1 11 | of Key Release Event for A-key Key 12 | for object main: 13 | 14 | Trying to close unexisting text file. 15 | 16 | 17 | ERROR in 18 | action number 1 19 | of Key Release Event for A-key Key 20 | for object main: 21 | 22 | File is not opened for reading. 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/test0043.ctr: -------------------------------------------------------------------------------- 1 | #Developers can implement magic methods by adding respondTo-methods. 2 | repeater is Object new. 3 | repeater on: 'respondTo:' do: { :what 4 | Pen write: what + ' '. 5 | }. 6 | repeater on: 'respondTo:and:' do: { :what :say 7 | Pen write: what, write: say + ' '. 8 | }. 9 | repeater on: 'respondTo:and:and:' do: { :what :say :more 10 | Pen write: what, write: say, write: more. 11 | }. 12 | repeater repeat. 13 | repeater everything: 'I say.'. 14 | repeater and: 'I ' everything: 'do.'. 15 | -------------------------------------------------------------------------------- /tests/test0104.exp: -------------------------------------------------------------------------------- 1 | This is step #1 2 | This is step #2 3 | This is step #3 4 | This is step #4 5 | This is step #5 6 | This is step #6 7 | This is step #3 8 | This is step #2 9 | This is step #1 10 | This is step #0 11 | This is step #-1 12 | This is step #-2 13 | This is step #-3 14 | This is step #-2.5 15 | This is step #-2 16 | This is step #-1.5 17 | This is step #-1 18 | This is step #-0.5 19 | This is step #0 20 | This is step #0.5 21 | This is step #1 22 | This is step #1.5 23 | This is step #2 24 | -------------------------------------------------------------------------------- /tests/test0173.exp: -------------------------------------------------------------------------------- 1 | sum: helloworldTrueNil6661 2 | Uncaught error has occurred. 3 | toNumber must return a number. 4 | #3 min (tests/test0173.ctr: 13) 5 | #2 + (tests/test0173.ctr: 13) 6 | #1 write: (tests/test0173.ctr: 13) 7 | ------------------------------------ 8 | The probable cause of the exception: 9 | 11 | 10 | 12 | Pen write: ( 'sum: ' + ( a sum ) ), brk. 11 | 13 | Pen write: ( 'min: ' + ( a min ) ), brk. 12 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 13 | 14 | Pen write: ( 'max: ' + ( a max ) ), brk. 14 | -------------------------------------------------------------------------------- /tests/test0189.exp: -------------------------------------------------------------------------------- 1 | I am a human being, not a robot, so I have desires but no money, so I amdepressive because I cannot do what I want to do to make this world a better place. 2 | I am a human being, not a robot, so I have desires but no money, so I amdepressive because I cannot do what I want to do to make this world a better place. 3 | I am a human being, not a robot, so I have desires but no money, so I amdepressive because I cannot do what I want to do to make this world a better place. 4 | Leaking memory... 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "plugins/termbox/termbox"] 2 | path = plugins/termbox/termbox 3 | url = https://github.com/nsf/termbox/ 4 | [submodule "plugins/json/jansson"] 5 | path = plugins/json/jansson 6 | url = https://github.com/akheron/jansson 7 | [submodule "integration/atom/language-citron"] 8 | path = integration/atom/language-citron 9 | url = https://github.com/alimpfard/atom-language-citron 10 | [submodule "libbsd"] 11 | path = libbsd 12 | url = https://github.com/LuaDist/libbsd.git 13 | -------------------------------------------------------------------------------- /tests/test0199.ctr: -------------------------------------------------------------------------------- 1 | #Like test 10 but with continous GC (mode 4) to test for GC regressions. 2 | Broom mode: 4. 3 | 4 | Animal is Object new. 5 | Animal on: 'make' do: { 6 | var animal is Object new. 7 | animal on: 'makeSound' do: { 8 | Pen write: my sound. 9 | }. 10 | ^animal. 11 | }. 12 | Cat is Object new. 13 | Cat on: 'make' do: { 14 | var cat is Animal make. 15 | cat on: 'init' do: { 16 | my sound is 'meow!'. 17 | }. 18 | cat init. 19 | ^cat. 20 | }. 21 | tom is Cat make. 22 | tom makeSound. 23 | -------------------------------------------------------------------------------- /plugins/json/Makefile: -------------------------------------------------------------------------------- 1 | default_target: all 2 | 3 | all: libjansson ctrjson 4 | 5 | libjansson: 6 | cd jansson && cmake -DJANSSON_BUILD_SHARED_LIBS=1 . && make && make install 7 | ctrjson: 8 | cc ${EXTRAS} -c json.c -fPIC -g3 -Ijansson/include -o json.o 9 | cp jansson/lib/libjansson.so . 10 | cc -shared -o libctrjson.so json.o libjansson.so 11 | mkdir -p ../../mods/json 12 | cp -f libctrjson.so ../../mods/json 13 | 14 | clearctr: 15 | rm -f *.o *.so *.a 16 | clearlibjansson: 17 | cd jansson && make clear 18 | --------------------------------------------------------------------------------