├── .devcontainer ├── Dockerfile.euphoria └── devcontainer.json ├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ └── euphoria.yml ├── .gitignore ├── .hgeol ├── .hgignore ├── .vscode ├── settings.json └── tasks.json ├── LICENSE ├── README.md ├── bin ├── bench.ex ├── bugreport.ex ├── buildcpdb.ex ├── ecp.dat ├── edx.bat ├── edx.ex ├── eucoverage.ex ├── euloc.ex └── make31.exw ├── demo ├── allsorts.ex ├── animal.ex ├── ascii.ex ├── bench │ ├── sieve8k.ex │ ├── sieve8k.pro │ └── sieve8k.pro2 ├── buzz.ex ├── callmach.ex ├── color.ex ├── csort.ex ├── dep.exw ├── dsearch.ex ├── eprint.ex ├── errmsg_en.txt ├── eused.ex ├── guru.ex ├── hash.ex ├── key.ex ├── keycode_4_0.cfg ├── langwar │ ├── commands.e │ ├── damage.e │ ├── display.e │ ├── emove.e │ ├── enemy.e │ ├── lw.doc │ ├── lw.ex │ ├── lw.sum │ ├── sched.e │ ├── screen.e │ ├── sound.e │ ├── soundeff.e │ ├── vars.e │ └── weapons.e ├── loaddb.ex ├── mydata.ex ├── net │ ├── chat_client.ex │ ├── chat_server.ex │ ├── google_tts.ex │ ├── httpd.ex │ ├── pastey.ex │ ├── sock_client.ex │ ├── sock_server.ex │ ├── udp_client.ex │ ├── udp_server.ex │ └── wget.ex ├── news.ex ├── pipe_sub.ex ├── pipes.ex ├── preproc │ ├── .hgeol │ ├── README │ ├── datesub.ex │ ├── etml.ex │ ├── etmltest.ex │ ├── eu.cfg │ ├── hello.etml │ ├── hello.lex │ ├── iif.ex │ ├── literate.ex │ ├── make40.ex │ └── thedate.dex ├── queens.ex ├── regexps.ex ├── sanity.ex ├── search.ex ├── simple_debug.e ├── tree.ex ├── unix │ ├── Mylib.c │ ├── callc.ex │ ├── mylib.ex │ └── qsort.ex ├── where.ex └── win32 │ ├── taskwire.exw │ ├── window.exw │ ├── winstruct.ew │ └── winwire.exw ├── docs ├── bind.txt ├── build_builtins.ex ├── build_keywords.ex ├── builtins.txt ├── credits.txt ├── creole.opts ├── database.txt ├── debug.txt ├── dis.txt ├── dynamic.txt ├── e2c.txt ├── edx.txt ├── eu.cfg ├── eudist.txt ├── eudoc.txt ├── eutest.txt ├── ewords.txt ├── html │ └── images │ │ ├── next.png │ │ └── prev.png ├── images │ ├── 300px-logo-logotype-orange-v2-r0.png │ └── 300px-mongoose-head-colour-v2-r0.png ├── installing.txt ├── internals.txt ├── keywords.txt ├── licensing.txt ├── man │ ├── eub.1 │ ├── eubind.1 │ ├── euc.1 │ ├── eudis.1 │ ├── eudist.1 │ ├── eui.1 │ └── eushroud.1 ├── manual.af ├── mongoose.txt ├── offline-template.html ├── pdf-template.html ├── pdf.css ├── perform.txt ├── platform.txt ├── preproc.txt ├── prototype.js ├── refman_2.txt ├── release │ ├── 1.0.0.txt │ ├── 1.1.0.txt │ ├── 1.2.0.txt │ ├── 1.3.0.txt │ ├── 1.4.0.txt │ ├── 1.4.1.txt │ ├── 1.4.2.txt │ ├── 1.5.0.txt │ ├── 1.5.1.txt │ ├── 2.0.0.txt │ ├── 2.0.0a.txt │ ├── 2.0.0b.txt │ ├── 2.1.0.txt │ ├── 2.1.0a.txt │ ├── 2.1.0b.txt │ ├── 2.2.0-linux.txt │ ├── 2.2.0.txt │ ├── 2.2.0a-linux.txt │ ├── 2.2.0b-linux.txt │ ├── 2.2.0b.txt │ ├── 2.2.0pa1.txt │ ├── 2.2.0pa2.txt │ ├── 2.2.0pa3.txt │ ├── 2.2.0pa4.txt │ ├── 2.3.0.txt │ ├── 2.3.0a.txt │ ├── 2.3.0b.txt │ ├── 2.4.0.txt │ ├── 2.4.0a.txt │ ├── 2.4.0b.txt │ ├── 2.5.0.txt │ ├── 2.5.0a.txt │ ├── 2.5.0b.txt │ ├── 3.0.0.txt │ ├── 3.0.1.txt │ ├── 3.0.2.txt │ ├── 3.1.0.txt │ ├── 3.1.1.txt │ ├── 4.0.0.rc1.txt │ ├── 4.0.0.rc2.txt │ ├── 4.0.0.txt │ ├── 4.0.1.txt │ ├── 4.0.2.txt │ ├── 4.0.3.txt │ ├── 4.0.4.txt │ ├── 4.0.5.txt │ ├── 4.0.6.txt │ ├── 4.1.0.txt │ ├── 4.2.0.txt │ ├── euc-a1.txt │ ├── euc-a2.txt │ ├── euc-a3.txt │ ├── euc-a4.txt │ ├── euc-b1.txt │ ├── euc-b2.txt │ └── euc.txt ├── scriptaculous.js ├── sortcheck.ex ├── spell.ex ├── spellchk.ex ├── style.css ├── syntax.txt ├── tasking.txt ├── template.html ├── template.tex ├── trouble.txt ├── unsupported.txt ├── using_euphoria.txt ├── welcome.txt └── whatsnew4_0.txt ├── file_id.diz ├── include ├── database.e ├── dll.e ├── euphoria.h ├── euphoria │ ├── debug │ │ └── debug.e │ ├── info.e │ ├── keywords.e │ ├── stddebug.e │ ├── symstruct.e │ ├── syncolor.e │ └── tokenize.e ├── file.e ├── get.e ├── graphics.e ├── image.e ├── machine.e ├── misc.e ├── mouse.e ├── msgbox.e ├── safe.e ├── sort.e ├── std │ ├── base64.e │ ├── cmdline.e │ ├── console.e │ ├── convert.e │ ├── datetime.e │ ├── dll.e │ ├── eds.e │ ├── error.e │ ├── eumem.e │ ├── fenv.e │ ├── filesys.e │ ├── flags.e │ ├── get.e │ ├── graphcst.e │ ├── graphics.e │ ├── hash.e │ ├── image.e │ ├── io.e │ ├── lcid.e │ ├── locale.e │ ├── localeconv.e │ ├── machine.e │ ├── map.e │ ├── math.e │ ├── mathcons.e │ ├── memconst.e │ ├── memory.e │ ├── net │ │ ├── common.e │ │ ├── dns.e │ │ ├── http.e │ │ └── url.e │ ├── os.e │ ├── pipeio.e │ ├── pretty.e │ ├── primes.e │ ├── rand.e │ ├── regex.e │ ├── safe.e │ ├── scinot.e │ ├── search.e │ ├── sequence.e │ ├── serialize.e │ ├── socket.e │ ├── sort.e │ ├── stack.e │ ├── stats.e │ ├── task.e │ ├── text.e │ ├── types.e │ ├── unittest.e │ ├── utils.e │ ├── wildcard.e │ └── win32 │ │ ├── msgbox.e │ │ ├── sounds.e │ │ └── w32dllconst.ew └── wildcard.e ├── makecfg.bat ├── makecfg.sh ├── packaging ├── archlinux │ ├── PKGBUILD.fmt │ └── mkPKGBUILD.ex ├── debian │ ├── Makefile │ ├── Makefile.fake │ ├── README │ ├── changelog │ ├── configure │ ├── control │ ├── copyright │ ├── euphoria-manual │ ├── postinst │ ├── prerm │ └── rules ├── osx │ └── build.sh ├── slackware │ ├── create_package.sh │ ├── slack-desc │ └── slackware-eu.cfg ├── source │ ├── Makefile │ └── configure ├── unix │ ├── Makefile │ └── build.sh └── win32 │ ├── after.txt │ ├── before.txt │ ├── build.bat │ ├── euphoria-ow.iss │ ├── euphoria.iss │ ├── setenv-ow.bat │ └── setenv.bat ├── source ├── .hgeol ├── Makefile.gnu ├── Makefile.wat ├── alldefs.h ├── autoexec_update.exw ├── backend.e ├── backend.ex ├── backobj.dst ├── be_alloc.c ├── be_alloc.h ├── be_callc.c ├── be_callc.h ├── be_coverage.c ├── be_coverage.h ├── be_debug.c ├── be_debug.h ├── be_decompress.c ├── be_decompress.h ├── be_execute.c ├── be_execute.h ├── be_inline.c ├── be_inline.h ├── be_machine.c ├── be_machine.h ├── be_main.c ├── be_main.h ├── be_pcre.c ├── be_pcre.h ├── be_rterror.c ├── be_rterror.h ├── be_runtime.c ├── be_runtime.h ├── be_socket.c ├── be_socket.h ├── be_symtab.c ├── be_symtab.h ├── be_syncolor.c ├── be_syncolor.h ├── be_task.c ├── be_task.h ├── be_w.c ├── be_w.h ├── block.e ├── build.mak ├── buildsys.e ├── c_decl.e ├── c_out.e ├── codepage │ ├── 0437.ecp │ ├── 0720.ecp │ ├── 0737.ecp │ ├── 0775.ecp │ ├── 0850.ecp │ ├── 0852.ecp │ ├── 0855.ecp │ ├── 0857.ecp │ ├── 0858.ecp │ ├── 0862.ecp │ ├── 0866.ecp │ ├── 0874.ecp │ ├── 1250.ecp │ ├── 1251.ecp │ ├── 1252.ecp │ ├── 1253.ecp │ ├── 1254.ecp │ ├── 1255.ecp │ ├── 1256.ecp │ ├── 1257.ecp │ ├── 1258.ecp │ ├── 8591.ecp │ ├── 8592.ecp │ ├── 8593.ecp │ ├── 8594.ecp │ ├── 8595.ecp │ ├── 8596.ecp │ ├── 8597.ecp │ ├── 8598.ecp │ ├── 8599.ecp │ └── 8605.ecp ├── cominit.e ├── common.e ├── compile.e ├── compress.e ├── configure ├── configure.bat ├── coverage.e ├── crc.ex ├── depend.sh ├── dis.e ├── dis.ex ├── docs.ex ├── dot.e ├── dox.e ├── echoversion.c ├── emit.e ├── error.e ├── eu.ex ├── eu.manifest ├── eub.rc ├── eubind.ex ├── eubw.rc ├── euc.ex ├── euc.rc ├── eudist.ex ├── eufile.ico ├── eui.ex ├── eui.rc ├── euiw.rc ├── euphoria.ico ├── eushroud.ex ├── eutest.ex ├── execute.e ├── execute.h ├── findjmp.ex ├── fixline.ex ├── fwdref.e ├── gcov.ex ├── global.e ├── global.h ├── il.e ├── inline.e ├── intinit.e ├── intobj.dst ├── keylist.e ├── lcssp.e ├── main.e ├── make_message_enum.ex ├── mkver.c ├── mode.e ├── msgtext.e ├── object.h ├── opnames.e ├── opnames.h ├── overview.doc ├── parser.e ├── pathopen.e ├── pcre │ ├── Makefile │ ├── Makefile.wat │ ├── config.h │ ├── config.h.unix │ ├── config.h.windows │ ├── objects.mak │ ├── objects.wat │ ├── pcre.h │ ├── pcre.h.unix │ ├── pcre.h.windows │ ├── pcre_chartables.c │ ├── pcre_compile.c │ ├── pcre_config.c │ ├── pcre_dfa_exec.c │ ├── pcre_exec.c │ ├── pcre_fullinfo.c │ ├── pcre_get.c │ ├── pcre_globals.c │ ├── pcre_internal.h │ ├── pcre_maketables.c │ ├── pcre_newline.c │ ├── pcre_ord2utf8.c │ ├── pcre_refcount.c │ ├── pcre_study.c │ ├── pcre_tables.c │ ├── pcre_ucd.c │ ├── pcre_valid_utf8.c │ ├── pcre_version.c │ ├── pcre_xclass.c │ ├── pcreposix.c │ ├── pcreposix.h │ └── ucp.h ├── platform.e ├── preproc.e ├── rbt.c ├── rbt.h ├── redef.h ├── repl.ex ├── reswords.e ├── reswords.h ├── return15.c ├── scanner.e ├── shift.e ├── showil.ex ├── source.doc ├── std.ex ├── symtab.e ├── symtab.h ├── syncolor.e ├── test818.c ├── traninit.e ├── translator.doc ├── transobj.dst ├── version.h └── version_info.rc ├── tests ├── 311 │ ├── t_311_database.e │ ├── t_311_dll.e │ ├── t_311_get.e │ ├── t_311_graphics.e │ ├── t_311_image.e │ ├── t_311_machine.e │ ├── t_311_misc.e │ ├── t_311_safe.e │ ├── t_311_sort.e │ ├── t_311_wildcard.e │ ├── t_c_311_safe_badpoke.d │ │ └── control.err │ ├── t_c_311_safe_badpoke.e │ ├── t_c_311_safe_leading_border.d │ │ └── control.err │ └── t_c_311_safe_leading_border.e ├── .gitignore ├── .hgeol ├── 1832f4e71028 ├── 893.map ├── bar_default.e ├── bar_export.e ├── baz_export.e ├── bindtest ├── bindtest.bat ├── branches ├── c_fwd_init.e ├── c_fwd_typecheck.e ├── case_file.e ├── check_diffs.sh ├── def_ns.e ├── definenum.cfg ├── defparam1.e ├── defparam2.e ├── dep3.e ├── euphoria-721157c2f5ef.tar ├── eutest │ ├── t_c_bad_err_file.d │ │ └── control.err │ ├── t_c_bad_err_file.e │ ├── t_c_bad_err_file.e.fail │ ├── t_c_good_err_file.d │ │ └── control.err │ ├── t_c_good_err_file.e │ ├── t_c_no_err_file.e │ ├── t_c_no_err_file.e.fail │ ├── t_got_different_string.e │ ├── t_got_different_string.e.fail │ ├── t_test_false.e │ ├── t_test_false.e.fail │ └── t_test_true.e ├── foo_default.e ├── foo_export.e ├── fwd.e ├── fwd2.e ├── fwd_constasgn.e ├── fwd_mutual1.e ├── fwd_mutual2.e ├── fwdglobal.e ├── fwdnoinc.e ├── gimlet.map ├── include_subdir │ ├── foo.e │ └── foo │ │ ├── bar.e │ │ └── foo.ex ├── indirect.e ├── indirect2.e ├── manual │ ├── makefile.wat │ └── print_platform.ex ├── obj_fwd.e ├── override.e ├── print_command_line.ex ├── public_ns.e ├── revisions.e ├── routine_id.e ├── runnum.ex ├── scope_1.e ├── scope_2.e ├── scope_3.e ├── scope_4.e ├── scope_local_include.e ├── switch_constants.e ├── t_881-1.e ├── t_881-2.e ├── t_893.e ├── t_937.e ├── t_963.e ├── t_autoclose.e ├── t_base64.e ├── t_bitwise.e ├── t_block.e ├── t_bugmagnet_15.e ├── t_bundled.e ├── t_c_749.d │ └── control.err ├── t_c_749.e ├── t_c_749_goto.d │ └── control.err ├── t_c_749_goto.e ├── t_c_890-1.d │ └── control.err ├── t_c_890-1.e ├── t_c_890-2.d │ └── control.err ├── t_c_890-2.e ├── t_c_890-3.d │ └── control.err ├── t_c_890-3.e ├── t_c_948.d │ └── control.err ├── t_c_948.e ├── t_c_atom_type.d │ └── control.err ├── t_c_atom_type.e ├── t_c_badmachine.d │ └── control.err ├── t_c_badmachine.e ├── t_c_badpoke8.d │ └── control.err ├── t_c_badpoke8.e ├── t_c_constant_type.d │ └── control.err ├── t_c_constant_type.e ├── t_c_crash.d │ └── control.err ├── t_c_crash.e ├── t_c_decl_redundant.d │ └── control.err ├── t_c_decl_redundant.e ├── t_c_decl_redundant2.d │ └── control.err ├── t_c_decl_redundant2.e ├── t_c_deseq_func.d │ └── control.err ├── t_c_deseq_seq.d │ └── control.err ├── t_c_deseq_seq.e ├── t_c_enum_strings.d │ └── control.err ├── t_c_enum_strings.e ├── t_c_enum_strings_sneaky.d │ └── control.err ├── t_c_enum_strings_sneaky.e ├── t_c_eu_nonbuiltin.d │ └── control.err ├── t_c_eu_nonbuiltin.e ├── t_c_fwd_constasgn.d │ └── control.err ├── t_c_fwd_constasgn.e ├── t_c_fwd_dollar_length.d │ └── control.err ├── t_c_fwd_enum_type.d │ └── control.err ├── t_c_fwd_enum_type.e ├── t_c_fwd_init.d │ └── control.err ├── t_c_fwd_init.e ├── t_c_fwd_samefile.d │ └── control.err ├── t_c_fwd_samefile.e ├── t_c_fwd_typecheck.d │ └── control.err ├── t_c_fwd_typecheck.e ├── t_c_ifdef_bad.d │ └── control.err ├── t_c_ifdef_bad.e ├── t_c_ifdef_bad2.d │ └── control.err ├── t_c_ifdef_bad2.e ├── t_c_ifdef_else_bad.d │ └── control.err ├── t_c_ifdef_else_bad.e ├── t_c_ifdef_no_then.d │ └── control.err ├── t_c_ifdef_no_then.e ├── t_c_ifdef_scope.d │ └── control.err ├── t_c_ifdef_scope.e ├── t_c_inline_literal.d │ └── control.err ├── t_c_inline_literal.e ├── t_c_integer_destroys.d │ └── control.err ├── t_c_integer_destroys.e ├── t_c_integer_type.d │ └── control.err ├── t_c_integer_type.e ├── t_c_map_large_bad_init.d │ └── control.err ├── t_c_map_large_bad_init.e ├── t_c_map_large_bad_next.d │ └── control.err ├── t_c_map_large_bad_next.e ├── t_c_map_small_bad_init.d │ └── control.err ├── t_c_map_small_bad_init.e ├── t_c_map_small_bad_next.d │ └── control.err ├── t_c_map_small_bad_next.e ├── t_c_ns_builtin.d │ └── control.err ├── t_c_ns_builtin.e ├── t_c_overflow_sbni.d │ └── control.err ├── t_c_overflow_sbni.e ├── t_c_overflow_sci1.d │ └── control.err ├── t_c_overflow_sci1.e ├── t_c_overflow_sci2.d │ └── control.err ├── t_c_overflow_sci2.e ├── t_c_overflow_sci3.d │ └── control.err ├── t_c_overflow_sci3.e ├── t_c_overflow_sci4.d │ └── control.err ├── t_c_overflow_sci4.e ├── t_c_overflow_sdnf.d │ └── control.err ├── t_c_overflow_sdnf.e ├── t_c_overflow_sdni.d │ └── control.err ├── t_c_overflow_sdni.e ├── t_c_overflow_shni.d │ └── control.err ├── t_c_overflow_shni.e ├── t_c_overflow_soni.d │ └── control.err ├── t_c_overflow_soni.e ├── t_c_qualpredef.d │ └── control.err ├── t_c_qualpredef.e ├── t_c_safe_badpoke.d │ └── control.err ├── t_c_safe_badpoke.e ├── t_c_safe_c_func_nodep.d │ └── control.err ├── t_c_safe_c_func_nodep.e ├── t_c_safe_free_allocate_protect.d │ └── control.err ├── t_c_safe_free_allocate_protect.e ├── t_c_safe_leading_border.d │ └── control.err ├── t_c_safe_leading_border.e ├── t_c_safe_non_extblock.d │ └── control.err ├── t_c_safe_non_extblock.e ├── t_c_safe_trailing_border.d │ └── control.err ├── t_c_safe_trailing_border.e ├── t_c_safe_unregister_free.d │ └── control.err ├── t_c_safe_unregister_free.e ├── t_c_scope_local_include.d │ └── control.err ├── t_c_scope_local_include.e ├── t_c_sequence_type.d │ └── control.err ├── t_c_sequence_type.e ├── t_c_singularity.d │ └── control.err ├── t_c_singularity.e ├── t_c_slice_past_end_double.d │ └── control.err ├── t_c_slice_past_end_double.e ├── t_c_switch_dup.d │ └── control.err ├── t_c_switch_dup.e ├── t_c_switch_rt_dup.d │ └── control.err ├── t_c_switch_rt_dup.e ├── t_c_type_check_atom.d │ └── control.err ├── t_c_type_check_atom.e ├── t_c_type_check_atom_compile.d │ └── control.err ├── t_c_type_check_atom_compile.e ├── t_c_type_check_integer.d │ └── control.err ├── t_c_type_check_integer.e ├── t_c_type_check_integer2.d │ └── control.err ├── t_c_type_check_integer2.e ├── t_c_type_check_sequence.d │ └── control.err ├── t_c_type_check_sequence.e ├── t_c_udt_type.d │ └── control.err ├── t_c_udt_type.e ├── t_c_underflow_sci.d │ └── control.err ├── t_c_underflow_sci.e ├── t_c_underflow_sdn.d │ └── control.err ├── t_c_underflow_sdn.e ├── t_call.e ├── t_callc.e ├── t_cmdline.e ├── t_command_line_quote.e ├── t_complex_assignment.e ├── t_condcmp.e ├── t_convert.e ├── t_database.e ├── t_datetime.e ├── t_de_dep.e ├── t_de_math.e ├── t_de_memory.e ├── t_de_safe.e ├── t_de_unsafe.e ├── t_declanywhere.e ├── t_declasgn.e ├── t_declasgn_wrning.e ├── t_defparms.e ├── t_delete.e ├── t_dep.d │ └── DOS32 │ │ └── control.err ├── t_dep.e ├── t_deprecate.e ├── t_disret.e ├── t_dll.d │ └── DOS32 │ │ └── control.err ├── t_dll.e ├── t_dup_case.e ├── t_elsifdef_bad.e ├── t_enum.e ├── t_enum_expressions.e ├── t_enum_type.e ├── t_eucfg.e ├── t_eumem.e ├── t_euns.e ├── t_euphoria_info.e ├── t_eutest.e ├── t_export_ns_type.e ├── t_filesys.e ├── t_flags.e ├── t_flow.e ├── t_fwd.e ├── t_fwd_enum_type.d │ └── control.err ├── t_fwd_mutual1.e ├── t_fwd_mutual2.e ├── t_get.e ├── t_goto_.e ├── t_goto_warning.e ├── t_graphics.e ├── t_hash.e ├── t_if.e ├── t_ifdef.e ├── t_ifdef_const.e ├── t_ifdef_proc.e ├── t_ifdef_switch.e ├── t_image.e ├── t_include.e ├── t_include_subdir.e ├── t_incpath.e ├── t_inline.e ├── t_io.e ├── t_legacy_callback.e ├── t_literals.e ├── t_locale.e ├── t_lockfile.e ├── t_loop.e ├── t_machine.e ├── t_machine_info.e ├── t_map.e ├── t_math.e ├── t_memory.e ├── t_msgbox.e ├── t_multiassign.e ├── t_net_common.e ├── t_net_dns.d │ └── DOS32 │ │ └── control.err ├── t_net_dns.e ├── t_net_http.d │ └── DOS32 │ │ └── control.err ├── t_net_http.e ├── t_net_url.e ├── t_ns_routine_id.e ├── t_object.e ├── t_os.e ├── t_override.e ├── t_pipeio.e ├── t_platform.e ├── t_primes.e ├── t_rand.e ├── t_recursion.e ├── t_regex.e ├── t_regex_alternation.e ├── t_regex_asterisk.e ├── t_retval.e ├── t_routine_id.e ├── t_safe.e ├── t_scanner.e ├── t_scientific.e ├── t_scope.e ├── t_search.e ├── t_sequence.e ├── t_serialize.e ├── t_socket.d │ └── DOS32 │ │ └── control.err ├── t_socket.e ├── t_sort.e ├── t_stack.e ├── t_stats.e ├── t_switch.e ├── t_system_exec.e ├── t_tasks.e ├── t_text.e ├── t_tokenize.e ├── t_trace.e ├── t_types.e ├── t_unsafe.e ├── t_utils.e ├── t_walkdir.e ├── t_warning.e ├── t_warning_options.d │ ├── dependency.e │ └── make_warnings.ex ├── t_warning_options.e ├── t_wildcard.e ├── test.lng ├── test2.lng ├── test_bad_map.dat ├── test_map.txt ├── test_map_small.txt ├── testlocale.edb ├── testlocale_two.edb ├── tip.tar.bz2 ├── unknown_defparm.e ├── unknown_defparm2.e ├── use_default.e ├── warning_code.ex ├── warning_code1.e ├── x1.e └── x2.e └── tutorial ├── append.ex ├── calc.ex ├── celsius.ex ├── example.ex ├── filesort.ex ├── getc.ex ├── gets.ex ├── hello.ex ├── learn.ex ├── seqcalc.ex ├── simple.ex └── tutorial.txt /.devcontainer/Dockerfile.euphoria: -------------------------------------------------------------------------------- 1 | FROM openeuphoria/euphoria:latest 2 | RUN export DEBIAN_FRONTEND=noninteractive \ 3 | && apt-get update \ 4 | && apt-get install -y build-essential git 5 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Euphoria", 3 | "build": { 4 | "dockerfile": "Dockerfile.euphoria" 5 | }, 6 | "extensions": [ 7 | "ms-vscode.cpptools", 8 | "openeuphoria.vscode-euphoria" 9 | ] 10 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.e linguist-language=Euphoria 2 | *.ex linguist-language=Euphoria 3 | *.gnu linguist-language=Makefile 4 | *.mak linguist-language=Makefile 5 | *.wat linguist-language=Makefile 6 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: openeuphoria 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build-* 2 | ecp.dat 3 | ex.err 4 | config.gnu 5 | config-*.gnu 6 | Makefile 7 | version.txt 8 | *.bak* 9 | *.swp 10 | *.tar.gz 11 | *.zip 12 | build 13 | *~ 14 | **/#*# 15 | .*.marks 16 | source/build 17 | source/build-* 18 | source/creole 19 | source/eudoc 20 | tests/return15 21 | tests/warnings_issued*.txt 22 | builds 23 | -------------------------------------------------------------------------------- /.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | **.e = native 3 | **.ex = native 4 | **.exw = native 5 | file_id.diz = native 6 | **.txt = native 7 | **.h = native 8 | **.c = native 9 | **.doc = native 10 | **eu.cfg = native 11 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | ~ 2 | config.jam 3 | ver.dat 4 | ex.err 5 | bin/bench 6 | bin/bench.exe 7 | bin/creole 8 | bin/creole.exe 9 | bin/eu.a 10 | bin/eu.cfg 11 | bin/eu.lib 12 | bin/eub 13 | bin/eub.exe 14 | bin/eubind 15 | bin/eubind.exe 16 | bin/euc 17 | bin/euc.exe 18 | bin/eucoverage 19 | bin/eucoverage.exe 20 | bin/eudbg.a 21 | bin/eudbg.lib 22 | bin/eudis 23 | bin/eudis.exe 24 | bin/eudist 25 | bin/eudist.exe 26 | bin/eudoc 27 | bin/eudoc.exe 28 | bin/eui 29 | bin/eui.exe 30 | bin/euloc 31 | bin/euloc.exe 32 | bin/eushroud 33 | bin/eushroud.exe 34 | bin/euso.a 35 | bin/eusodbg.a 36 | bin/euso.lib 37 | bin/eusodbg.lib 38 | bin/eutest 39 | bin/eutest.exe 40 | bin/mkver 41 | bin/mkver.exe 42 | docs/manual.txt 43 | packaging/win32/euphoria-.*exe 44 | source/config.gnu 45 | source/config.wat 46 | source/eu.cfg 47 | source/Makefile 48 | tests/dump.edb 49 | tests/ecp.dat 50 | tests/eds-dump.txt 51 | tests/save_map.raw3 52 | tests/include_subdir/foo/test.err 53 | 54 | regex: 55 | \.DS_Store 56 | ^build/.* 57 | ^build40/.* 58 | ^build_mingw/.* 59 | ^docs/out/.* 60 | ^source/.*res$ 61 | ^source/mkver.o$ 62 | ^source/build/.* 63 | ^source/build_mingw/.* 64 | ^source/build_gcc/.* 65 | .*/cleanbranch/.* 66 | ^.*~ 67 | ^.*\.dis$ 68 | .*/build-.* 69 | .*\.hash 70 | .*\.sym 71 | ^packaging/debian/euphoria/.* 72 | ^packaging/debian/.*deb 73 | ^packaging/debian/.*dsc 74 | ^packaging/debian/.*changes 75 | ^packaging/debian/.*gz 76 | ^packaging/osx/euphoria-.* 77 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "*.gnu": "makefile", 4 | "*.mak": "makefile", 5 | "*.wat": "makefile" 6 | }, 7 | "files.exclude": { 8 | "**/.git": true, 9 | "**/.hgeol": true, 10 | "**/.hgignore": true, 11 | "**/build": true, 12 | "**/config.gnu": true, 13 | "**/ecp.dat": true, 14 | "**/ex.err": true, 15 | "**/Makefile": true, 16 | "**/version.txt": true 17 | } 18 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007-2024 by OpenEuphoria Group 2 | Copyright (c) 1993-2006 Rapid Deployment Software (RDS) 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, 8 | sublicense, and/or sell copies of the Software, and to permit persons 9 | to whom the Software is furnished to do so. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 12 | KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO 13 | THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 14 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 15 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 16 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 18 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | The copyright holders request, but do not require, that you: 21 | 22 | 1. Acknowledge OpenEuphoria and others who contributed to this software. 23 | 2. Provide a link to openeuphoria.org, if possible, from your Web site. 24 | -------------------------------------------------------------------------------- /bin/bugreport.ex: -------------------------------------------------------------------------------- 1 | -- 2 | -- Display common information that should be included with a bug report 3 | -- 4 | 5 | include std/os.e 6 | include euphoria/info.e 7 | 8 | procedure pi(sequence title, object value) 9 | if sequence(value) and length(value) > 0 then 10 | printf(1, "%s\n----------------------------\n", { title }) 11 | if sequence(value[1]) then 12 | for i = 1 to length(value) do 13 | printf(1, "%d: %s\n", { i, value[i] }) 14 | end for 15 | else 16 | printf(1, "%s\n", { value }) 17 | end if 18 | printf(1, "\n", {}) 19 | end if 20 | end procedure 21 | 22 | pi("Version", version_string()) 23 | pi("Operating System", sprintf("Platform: %s, Build: %s, %s:%d", uname())) 24 | pi("Include Directories", include_paths(0)) 25 | pi("EUDIR", getenv("EUDIR")) 26 | pi("PATH", getenv("PATH")) 27 | -------------------------------------------------------------------------------- /bin/ecp.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/bin/ecp.dat -------------------------------------------------------------------------------- /bin/edx.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | eui edx.ex %1 %2 %3 %4 %5 %6 %7 %8 %9 3 | -------------------------------------------------------------------------------- /bin/make31.exw: -------------------------------------------------------------------------------- 1 | -- Produce exw31.exe, a version of eui.exe that uses 2 | -- Windows GUI version 3.1 instead of 4.0 3 | 4 | include file.e 5 | include get.e 6 | 7 | constant new_version = {3,0,10} -- {4, 0, 0} for 4.0 8 | 9 | integer fn 10 | 11 | procedure quit() 12 | if getc(0) then 13 | end if 14 | abort(0) 15 | end procedure 16 | 17 | system("del exw31.exe > nul", 2) 18 | system("copy eui.exe exw31.exe > nul", 2) 19 | 20 | fn = open("exw31.exe", "ub") 21 | if fn = -1 then 22 | puts(1, "You need to run this from euphoria\\bin\n") 23 | quit() 24 | end if 25 | 26 | if seek(fn, #C8) != 0 then 27 | puts(2, "1st seek failed\n") 28 | quit() 29 | end if 30 | 31 | puts(2, "Patching:\n") 32 | ? get_bytes(fn, 3) 33 | 34 | if seek(fn, #C8) != 0 then 35 | puts(2, "2nd seek failed\n") 36 | quit() 37 | end if 38 | 39 | puts(fn, new_version) 40 | 41 | puts(1, "To:\n") 42 | ? new_version 43 | close(fn) 44 | 45 | puts(1, "exw31.exe uses Windows GUI version 3.1\n") 46 | puts(1, "Press Enter...\n") 47 | quit() 48 | 49 | -------------------------------------------------------------------------------- /demo/ascii.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === ascii.ex 3 | -- 4 | -- Display ASCII / code page chart in 50 lines-per-screen mode 5 | 6 | include std/graphics.e 7 | include std/graphcst.e 8 | include std/console.e 9 | 10 | constant SCREEN = 1 11 | 12 | text_rows(50) 13 | 14 | for i = 0 to 255 do 15 | if remainder(i, 8) = 0 then 16 | puts(SCREEN, '\n') 17 | end if 18 | ifdef LINUX then 19 | if i = 128 then 20 | if getc(0) then 21 | end if 22 | end if 23 | end ifdef 24 | 25 | if remainder(i, 32) = 0 then 26 | puts(SCREEN, '\n') 27 | end if 28 | printf(SCREEN, "%3d: ", i) 29 | switch i do 30 | case 0 then 31 | puts(SCREEN, "NUL ") 32 | break 33 | 34 | case 9 then 35 | puts(SCREEN, "TAB ") 36 | break 37 | 38 | case 10 then 39 | puts(SCREEN, "LF ") 40 | break 41 | 42 | case 13 then 43 | puts(SCREEN, "CR ") 44 | break 45 | 46 | case else 47 | puts(SCREEN, i) 48 | puts(SCREEN, " ") 49 | end switch 50 | end for 51 | 52 | puts(SCREEN, "\n\nPress Enter...") 53 | gets(0) 54 | -------------------------------------------------------------------------------- /demo/key.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === key.ex 3 | -- 4 | -- Find out what numeric key code is generated by any key on the keyboard 5 | -- 6 | -- ==== Usage 7 | -- {{{ 8 | -- eui key [keybindfile] 9 | -- }}} 10 | -- If you supply a valid file containing key bindings, they will be set prior to 11 | -- testing the keycodes returned. 12 | 13 | include std/os.e 14 | include std/console.e 15 | include std/io.e 16 | 17 | sequence cmd 18 | cmd = command_line() 19 | 20 | if length(cmd) >= 3 then 21 | set_keycodes(cmd[3]) 22 | writefln("Testing keyboard codes on [1] using bindings from [2]", {uname(), cmd[3]}) 23 | else 24 | writefln("Testing keyboard codes on [1]", {uname()}) 25 | end if 26 | 27 | 28 | puts(1, "Press any key. I'll show you the key code. Press q to quit\n") 29 | while 1 do 30 | integer code = get_key() 31 | if code != -1 then 32 | printf(1, "The key code is: %d\n", code) 33 | if code = 'q' then 34 | exit 35 | end if 36 | end if 37 | end while 38 | -------------------------------------------------------------------------------- /demo/langwar/lw.sum: -------------------------------------------------------------------------------- 1 | Language War Command Summary 2 | ============================ 3 | COMMANDS 4 | -------- 5 | d1 move in direction d1 (d1 = 1 to 8) 6 | w s set warp speed (s = 0 to 5) 7 | p e d1 d2 shoot e-hundred unit phasor in direction d1.d2 (e = 0 to 9) 8 | t d1 d2 shoot torpedo in direction d1.d2 9 | a d1 d2 shoot antimatter pod in direction d1.d2 10 | Press Enter to detonate. 11 | g display / cancel galaxy scan 12 | $ abandon the Euphoria for the Assembler shuttlecraft 13 | x cancel a partially entered command 14 | ! pause the game - hit 'x' to resume 15 | Esc abort the game 16 | 17 | directions 18 | 3 19 | 4 | 2 20 | | 21 | 5------+------1 22 | | 23 | 6 | 8 24 | 7 25 | -------------------------------------------------------------------------------- /demo/langwar/sound.e: -------------------------------------------------------------------------------- 1 | ifdef WINDOWS then 2 | public include std/win32/sounds.e 3 | elsedef 4 | public procedure sound( atom sound_type = 0 ) 5 | -- do nothing... someday implement sound here 6 | end procedure 7 | end ifdef 8 | -------------------------------------------------------------------------------- /demo/net/google_tts.ex: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env eui 2 | --**** 3 | -- === net/google_tts.ex 4 | -- 5 | -- Use the Google TTS service to create an MP3 file 6 | -- of the text given on the command line 7 | -- 8 | -- ==== Usage 9 | -- {{{ 10 | -- eui google_tts.ex Hello World 11 | -- }}} 12 | -- 13 | -- Then open in your MP3 player the resulting ##google_tts.mp3## file. 14 | -- 15 | 16 | include std/net/http.e 17 | include std/net/url.e 18 | include std/sequence.e 19 | include std/io.e 20 | 21 | sequence cmds = command_line() 22 | if length(cmds) < 3 then 23 | puts(1, "usage: google_tts.ex what to convert to mp3\n") 24 | abort(1) 25 | end if 26 | 27 | sequence u = sprintf("http://translate.google.com/translate_tts?tl=en&q=%s", { 28 | encode(join(cmds[3..$])) }) 29 | 30 | object r = http_get(u) 31 | if atom(r) then 32 | printf(1, "Web error: %d\n", { r }) 33 | elsif length(r[2]) = 0 then 34 | puts(1, "Google did not translate for us.\n") 35 | puts(1, "They do have an unpublished 'max' character count, maybe\n") 36 | puts(1, "you exceeded this?\n") 37 | else 38 | write_file("google_tts.mp3", r[2]) 39 | puts(1, "MP3 stored as google_tts.mp3\n") 40 | end if 41 | 42 | -------------------------------------------------------------------------------- /demo/net/sock_client.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === net/sock_client.ex 3 | -- 4 | -- Simple example of how to connect to a socket. Be sure to launch ##sock_server.ex## 5 | -- first. 6 | -- 7 | 8 | object _ = 0 9 | without warning 10 | 11 | include std/console.e 12 | include std/socket.e as sock 13 | 14 | --** 15 | --@nodoc@ 16 | override procedure abort(integer x) 17 | maybe_any_key() 18 | eu:abort(x) 19 | end procedure 20 | sock:socket sock = sock:create(sock:AF_INET, sock:SOCK_STREAM, 0) 21 | 22 | if sock:connect(sock, "127.0.0.1:5000") != sock:OK then 23 | printf(1, "Could not connect to server, is it running?\nError = %d\n", 24 | { sock:error_code() }) 25 | abort(1) 26 | end if 27 | 28 | while 1 do 29 | sequence data = prompt_string("What do you want to say to the server or quit? ") 30 | 31 | sock:send(sock, data & "\n", 0) 32 | 33 | if equal(data, "quit") then 34 | exit 35 | else 36 | printf(1, "The server says: %s", { sock:receive(sock, 0) }) 37 | end if 38 | 39 | end while 40 | 41 | sock:close(sock) 42 | 43 | -------------------------------------------------------------------------------- /demo/net/udp_client.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === net/udp_client.ex 3 | -- 4 | -- Simple UDP client. Be sure to launch ##udp_server.ex## first! 5 | -- 6 | 7 | include std/socket.e as sock 8 | include std/console.e as con 9 | 10 | sock:socket client = sock:create(sock:AF_INET, sock:SOCK_DGRAM, 0) 11 | sock:set_option(client, sock:SOL_SOCKET, SO_BROADCAST, 1) 12 | 13 | integer result = sock:send_to(client, "Hello World!", "127.0.0.1:27015") 14 | if result > 0 then 15 | printf(1, "Sent %d bytes\n", { result }) 16 | else 17 | printf(1, "Error code: %d\n", { result }) 18 | end if 19 | 20 | sock:close(client) 21 | con:maybe_any_key() 22 | -------------------------------------------------------------------------------- /demo/net/udp_server.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === net/udp_server.ex 3 | -- 4 | -- simple UDP server. Use ##udp_client.ex## to see it work. 5 | -- 6 | 7 | include std/socket.e as sock 8 | include std/console.e as con 9 | 10 | sock:socket server = sock:create(sock:AF_INET, sock:SOCK_DGRAM, 0) 11 | if sock:bind(server, "0.0.0.0:27015") != sock:OK then 12 | printf(1, "Binding to 0.0.0.0:27015 has failed, errno: %s\n", { 13 | sock:error_code() }) 14 | abort(1) 15 | end if 16 | 17 | puts(1, "Waiting for a client connection on port 27015\n") 18 | object o = sock:receive_from(server) 19 | if sequence(o) then 20 | printf(1, "From: %s:%d, '%s'\n", o) 21 | else 22 | printf(1, "Error code: %d\n", { o }) 23 | end if 24 | 25 | sock:close(server) 26 | con:maybe_any_key() 27 | -------------------------------------------------------------------------------- /demo/net/wget.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === net/wget.ex 3 | -- 4 | -- WGet clone, a URL downloaded. 5 | -- 6 | -- ==== Usage 7 | -- 8 | -- {{{ 9 | -- eui wget http://openeuphoria.org 10 | -- }}} 11 | -- 12 | 13 | include std/console.e 14 | include std/net/http.e 15 | without warning 16 | 17 | --** 18 | --@nodoc@ 19 | override procedure abort(integer x) 20 | maybe_any_key() 21 | eu:abort(x) 22 | end procedure 23 | 24 | procedure main(sequence args = command_line()) 25 | if length(args) = 2 then 26 | ifdef WINDOWS and GUI then 27 | puts(1, "This program must be run from the command-line:\n\n") 28 | end ifdef 29 | puts(1, "Usage: eui wget.ex URL\n") 30 | abort(1) 31 | end if 32 | 33 | sequence url = args[3] 34 | object data = http_get(url) 35 | 36 | if atom(data) or length(data) = 0 then 37 | printf(1, "Could not download %s\n", { url }) 38 | abort(2) 39 | end if 40 | 41 | printf(1, "%s\n", { data[2] }) 42 | end procedure 43 | 44 | main() 45 | -------------------------------------------------------------------------------- /demo/pipe_sub.ex: -------------------------------------------------------------------------------- 1 | include std/text.e as text 2 | 3 | puts(1,"pipe_sub.ex: read from STDIN: '" & text:trim(gets(0)) & "'") 4 | -------------------------------------------------------------------------------- /demo/pipes.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === pipes.ex 3 | -- 4 | -- Starts a sub-process and communicates to it via piped io. 5 | -- The sub process is ##pipe_sub.ex## 6 | -- 7 | 8 | include std/pipeio.e as pipe 9 | include std/console.e 10 | without warning 11 | --@nodoc@ 12 | override procedure abort(integer x) 13 | maybe_any_key() 14 | eu:abort(x) 15 | end procedure 16 | 17 | object z = pipe:create() 18 | object p = pipe:exec("eui pipe_sub.ex", z) 19 | if atom(p) then 20 | printf(1, "Failed to exec() with error %x\n", pipe:error_no()) 21 | abort(1) 22 | end if 23 | 24 | integer bytes = pipe:write(p[STDIN],"This data was written to pipe STDIN!\n") 25 | printf(1,"number bytes written to child: %d\n", { bytes }) 26 | 27 | object c = pipe:read(p[STDOUT], 256) 28 | if atom(c) then 29 | printf(1, "Failed on read with error %x\n", pipe:error_no()) 30 | abort(1) 31 | end if 32 | 33 | puts(1,"read from child pipe: \""&c&"\"") 34 | 35 | --Close pipes and make sure process is terminated 36 | pipe:kill(p) 37 | 38 | puts(1,"\n\n") 39 | maybe_any_key() 40 | 41 | -------------------------------------------------------------------------------- /demo/preproc/.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | etml = native 3 | lex = native 4 | dex = native 5 | -------------------------------------------------------------------------------- /demo/preproc/etmltest.ex: -------------------------------------------------------------------------------- 1 | include std/map.e as m 2 | include hello.etml as hello 3 | include std/console.e as con 4 | 5 | sequence cmds = command_line() 6 | if length(cmds) != 3 then 7 | ifdef WINDOWS and GUI then 8 | puts(1, "This program must be run from the command-line:\n\n") 9 | end ifdef 10 | 11 | puts(1, "usage: eui etmltest.ex \n") 12 | con:maybe_any_key() 13 | abort(0) 14 | end if 15 | 16 | m:map d = m:new() 17 | m:put(d, "name", cmds[3]) 18 | 19 | puts(1, hello:template(d) & "\n") 20 | con:maybe_any_key() 21 | -------------------------------------------------------------------------------- /demo/preproc/eu.cfg: -------------------------------------------------------------------------------- 1 | -p etml:etml.ex 2 | -p le,lex:literate.ex 3 | -p dex:datesub.ex:-f %m/%d/%Y 4 | -------------------------------------------------------------------------------- /demo/preproc/hello.etml: -------------------------------------------------------------------------------- 1 | <%@ include std/text.e %> 2 | 3 | 4 | Hello, <%= name %> 5 | 6 |

Say Hello

7 | <% for i = 1 to 10 do %> 8 |

Hello, <%= name %>!

9 | <% end for %> 10 | 11 | 12 | -------------------------------------------------------------------------------- /demo/preproc/hello.lex: -------------------------------------------------------------------------------- 1 | This here is a document in literal form 2 | written with the literate pre-processor demo for Euphoria 3 | 4 | The idea of this program is a simple Hello, World program written in the 5 | literate form of Euphoria. 6 | 7 | 8 | puts(1, "Hello, World!\n") 9 | 10 | 11 | The idea is that code is secondary to the documentation and the thought 12 | process that goes into creating the code. More can be read about literate 13 | programming on the website: http://www.literateprogramming.com/ 14 | 15 | Now, to show off really how this works, I'll add some more euphoria code 16 | below. This will be my final example. 17 | 18 | 19 | for i = 1 to 5 do 20 | puts(1, "Goodbye, World!\n") 21 | end for 22 | 23 | -------------------------------------------------------------------------------- /demo/preproc/literate.ex: -------------------------------------------------------------------------------- 1 | --** 2 | -- Literate Programming for Euphoria 3 | -- 4 | -- http://www.literateprogramming.com/ 5 | -- 6 | 7 | include std/cmdline.e 8 | include std/io.e 9 | include std/map.e 10 | include std/console.e 11 | 12 | constant 13 | BEGIN_TAG = "", 14 | END_TAG = "" 15 | 16 | constant cmd_params = { 17 | { "i", 0, "Input filename", { NO_CASE, HAS_PARAMETER } }, 18 | { "o", 0, "Output filename", { NO_CASE, HAS_PARAMETER } } 19 | } 20 | 21 | map:map params = cmd_parse(cmd_params) 22 | 23 | object input_filename=map:get(params, "i"), 24 | output_filename=map:get(params, "o") 25 | 26 | if atom(input_filename) or atom(output_filename) then 27 | ifdef WINDOWS and GUI then 28 | puts(1, "This program must be run from the command-line:\n\n") 29 | end ifdef 30 | puts(1, "Usage: eui literate.ex -i input_file -o output_file\n") 31 | maybe_any_key() 32 | abort(1) 33 | end if 34 | 35 | sequence in = read_file(input_filename) 36 | integer next_tag, pos = 1 37 | sequence out = "" 38 | 39 | while next_tag > 0 with entry do 40 | if next_tag > pos then 41 | out &= "/*\n" & in[pos..next_tag-1] & "*/\n" 42 | end if 43 | 44 | pos = match(END_TAG, in, next_tag) + length(END_TAG) 45 | 46 | out &= in[next_tag + length(BEGIN_TAG)..pos - length(END_TAG) - 1] & "\n" 47 | entry 48 | next_tag = match(BEGIN_TAG, in, pos) 49 | end while 50 | 51 | out &= "/*\n" & in[pos..$] & "\n*/\n" 52 | 53 | write_file(output_filename, out) 54 | -------------------------------------------------------------------------------- /demo/preproc/thedate.dex: -------------------------------------------------------------------------------- 1 | puts(1, "@DATE@\n") 2 | -------------------------------------------------------------------------------- /demo/regexps.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === regexps.ex 3 | -- 4 | -- Shows off some simple regular expression operations 5 | -- 6 | 7 | include std/regex.e as re 8 | include std/console.e 9 | 10 | procedure show_matches(sequence matches, sequence str) 11 | for i = 1 to length(matches) do 12 | printf(1, "%d: %d-%d = '%s'\n", {i, matches[i][1][1], matches[i][1][2], 13 | str[matches[i][1][1]..matches[i][1][2]]}) 14 | end for 15 | end procedure 16 | 17 | sequence str 18 | re:regex r 19 | 20 | str = "Fido, the dog, ran to Jimmy." 21 | printf(1, "Getting the first names from '%s'\n", { str }) 22 | r = re:new("[A-Z][a-z]+") 23 | show_matches(re:find_all(r, str), str) 24 | 25 | str = "The two love birds, John Doe and Sally Smith, are to be married by Rev. Matt Parker." 26 | printf(1, "\nGetting the first and last names from '%s'\n", { str }) 27 | r = re:new("([A-Z][a-z]+) ([A-Z][a-z]+)") 28 | show_matches(re:find_all(r, str), str) 29 | printf(1, "\nConverting First Name Last Name to Last, First in:\n%s\n", { str }) 30 | 31 | puts(1, re:find_replace(r, str, `\2, \1`) & "\n") 32 | maybe_any_key() 33 | -------------------------------------------------------------------------------- /demo/unix/Mylib.c: -------------------------------------------------------------------------------- 1 | // Don't delete! 2 | // You can compile this file into a shared library with: 3 | // 4 | // gcc -shared Mylib.c -o mylib.so 5 | // 6 | // Feel free to add other C routines below. 7 | 8 | int extra = 99; 9 | 10 | int sum(int x) 11 | // compute the sum of the integers from 1 to x 12 | // (x+1)*x/2 would be faster! 13 | // then add the global var "extra" 14 | { 15 | int i, sum; 16 | 17 | sum = 0; 18 | for (i = 1; i <= x; i++) 19 | sum += i; 20 | return sum + extra; 21 | } 22 | -------------------------------------------------------------------------------- /demo/unix/callc.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === unix/callc.ex 3 | -- 4 | -- Calls to C routines in standard shared libraries 5 | -- 6 | 7 | include std/dll.e 8 | include std/machine.e 9 | 10 | atom libc, libm, p, q, format 11 | sequence text 12 | integer s 13 | 14 | -- Standard C Library: 15 | libc = open_dll("/lib/libc.so.6") 16 | if libc = 0 then 17 | puts(2, "couldn't find /lib/libc.so.6 - try just \"libc.so\"\n") 18 | end if 19 | 20 | -- Standard Math Library: 21 | libm = open_dll("/usr/lib/libm.so") 22 | if libm = 0 then 23 | puts(2, "libm not found\n") 24 | end if 25 | 26 | puts(1, "> string copy test:\n") 27 | s = define_c_proc(libc, "strcpy", {C_POINTER, C_POINTER}) 28 | p = allocate(100) 29 | poke(p, repeat(0, 100)) 30 | q = allocate_string("Hello Euphoria\n") 31 | c_proc(s, {p, q}) 32 | text = peek({p, 15}) 33 | puts(1, text) 34 | 35 | puts(1, "\n> malloc test:\n") 36 | s = define_c_func(libc, "malloc", {C_INT}, C_POINTER) 37 | p = c_func(s, {160}) 38 | ? peek4u(p-4) -- should be a somewhat larger size than what you allocated 39 | -- (except on FreeBSD) 40 | 41 | puts(1, "\n> sin test:\n") 42 | s = define_c_func(libm, "sin", {C_DOUBLE}, C_DOUBLE) 43 | ? c_func(s, {1.0}) 44 | ? sin(1.0) -- same? 45 | 46 | puts(1, "\n> printf test:\n") 47 | s = define_c_proc(libc, "printf", {C_POINTER, C_INT, C_DOUBLE, C_INT, C_DOUBLE}) 48 | format = allocate_string("Here are 4 numbers: %d, %.3f, %d, %e\n") 49 | c_proc(s, {format, 111, 222.222, 333, 444.4444}) 50 | 51 | 52 | -------------------------------------------------------------------------------- /demo/unix/mylib.ex: -------------------------------------------------------------------------------- 1 | --**** 2 | -- === unix/mylib.ex 3 | -- 4 | -- Call a C routine in a shared library that you created. 5 | -- Also read and write the value of a C variable. 6 | -- 7 | 8 | include dll.e 9 | 10 | atom mylib, extra_addr 11 | integer sum 12 | 13 | mylib = open_dll("./mylib.so") 14 | 15 | if mylib = NULL then 16 | puts(2, "Couldn't open mylib.so - rebuild for FreeBSD?\n") 17 | abort(1) 18 | end if 19 | 20 | sum = define_c_func(mylib, "sum", {C_INT}, C_INT) 21 | if sum = -1 then 22 | puts(1, "Couldn't find \"sum\" function\n") 23 | abort(1) 24 | end if 25 | 26 | extra_addr = define_c_var(mylib, "extra") 27 | if extra_addr = -1 then 28 | puts(1, "Couldn't find \"extra\" variable\n") 29 | abort(1) 30 | end if 31 | 32 | integer a, b, c 33 | a = peek4u(extra_addr) -- should be 99 34 | ? a 35 | 36 | poke4(extra_addr, 0) 37 | b = c_func(sum, {10}) -- should be 55 38 | ? b 39 | 40 | poke4(extra_addr, 1000) 41 | c = c_func(sum, {10}) -- should be 1055 42 | ? c 43 | 44 | if a = 99 and b = 55 and c = 1055 then 45 | puts(1, "\nCorrect\n") 46 | else 47 | puts(1, "\nWrong\n") 48 | end if 49 | -------------------------------------------------------------------------------- /docs/build_builtins.ex: -------------------------------------------------------------------------------- 1 | include std/math.e 2 | include euphoria/keywords.e 3 | 4 | integer fh = open("builtins.txt", "w") 5 | 6 | puts(fh, ` 7 | == Built-in Routines 8 | 9 | These **built-in** routines do not require an include file~: 10 | 11 | `) 12 | 13 | puts(fh, "\n" ) 14 | 15 | integer x = 1 16 | for i = 1 to length(builtins) do 17 | if equal(builtins[i], "?") then 18 | printf(fh, "| ##[[%s -> :q_print]]## ", { builtins[i] }) 19 | else 20 | printf(fh, "| ##[[:%s]]## ", { builtins[i] }) 21 | end if 22 | 23 | if x = 4 then 24 | printf(fh, "|\n") 25 | x = 1 26 | else 27 | x += 1 28 | end if 29 | end for 30 | 31 | if x > 1 then 32 | for i = x - 1 to 4 do 33 | printf(fh, " | ") 34 | end for 35 | end if 36 | 37 | printf(fh, "\n") 38 | 39 | 40 | puts(fh, ` 41 | A built-in routine has global scope and belongs to the ##eu## namespace. 42 | 43 | An identifier for a built-in is not reserved; it is possible to override a built-in 44 | identifier with a new declaration. 45 | ` ) 46 | 47 | 48 | 49 | close(fh) 50 | -------------------------------------------------------------------------------- /docs/build_keywords.ex: -------------------------------------------------------------------------------- 1 | include std/math.e 2 | include euphoria/keywords.e 3 | 4 | integer fh = open("keywords.txt", "w") 5 | 6 | puts(fh, ` 7 | == Euphoria Keywords 8 | 9 | The **keywords** are part of the Euphoria language and are //reserved// for the exclusive use of the interpreter. 10 | You can not used them as identifiers for your own variables or routines. 11 | 12 | 13 | `) 14 | 15 | integer x = 1 16 | for i = 1 to length( keywords) do 17 | if equal(keywords[i], "?") then 18 | printf(fh, "| ##[[%s -> :q_print]]## ", { keywords[i] }) 19 | else 20 | printf(fh, "| ##[[:%s]]## ", { keywords[i] }) 21 | end if 22 | 23 | if x = 4 then 24 | printf(fh, "|\n") 25 | x = 1 26 | else 27 | x += 1 28 | end if 29 | end for 30 | 31 | if x > 1 then 32 | for i = x - 1 to 4 do 33 | printf(fh, " | ") 34 | end for 35 | end if 36 | 37 | printf(fh, "\n") 38 | 39 | close(fh) 40 | -------------------------------------------------------------------------------- /docs/credits.txt: -------------------------------------------------------------------------------- 1 | == Euphoria Credits 2 | :<> 3 | 4 | Euphoria has been continuously developed since it was started in 1993 5 | by Robert Craig. In 2006, version 3.0 was released as open source. Various 6 | releases were made to the 3.x series and then in the 4th quarter of 7 | 2010, the largest update ever was made to Euphoria, starting the 8 | Euphoria 4.x series. 9 | 10 | It has taken quite a few people to get this far and we would like to 11 | recognize them here. Contributors are listed in alphabetical 12 | order by their last name. 13 | 14 | For an up-to-date listing, see the [[https://openeuphoria.org/wiki/view/EuphoriaContributors.wc|Euphoria Contributors]] 15 | page at the [[http://openeuphoria.org/wiki/view/home.wc|Euphoria Wiki]]. 16 | 17 | === Current Developers 18 | 19 | * Greg Haberek 20 | * Tom Ciplijauskas 21 | * Shawn Pringle 22 | * C. K. Lester 23 | 24 | === Past Developers 25 | 26 | * Jim Brown 27 | * Matthew Lewis 28 | * Derek Parnell 29 | * Jeremy Cowgar 30 | * Robert Craig 31 | * Chris Cuvier 32 | * Junko Miura 33 | 34 | === Contributors 35 | 36 | * Jiri Babor 37 | * Chris Bensler 38 | * CoJaBo 39 | * Jason Gade 40 | * Ryan Johnson 41 | * Lonny Nettnay 42 | * Marco Antonio Achury Palma 43 | * Michael Sabal 44 | * Dave Smith - Graphics 45 | * Kathy Smith 46 | * Randy Sugianto 47 | -------------------------------------------------------------------------------- /docs/creole.opts: -------------------------------------------------------------------------------- 1 | wikis = { 2 | {"WIKIPEDIA","http://wikipedia.org/wiki/"}, 3 | {"TICKET","/ticket/view.wc?id="}, 4 | {"MESSAGE","/forum/view.wc?id="}, 5 | {"NEWS","/news/view.wc?id="}, 6 | {"WIKI","/wiki/view.wc?page="}, 7 | {"CATEGORY","/category/members.wc?category="}, 8 | {"SVN","http://rapideuphoria.svn.sourceforge.net/viewvc/rapideuphoria?view=rev&revision="}, 9 | {"HG","http://scm.openeuphoria.org/hg/"}, 10 | {"MAN","/docs/"}, 11 | $ 12 | } 13 | -------------------------------------------------------------------------------- /docs/eu.cfg: -------------------------------------------------------------------------------- 1 | -i ../include 2 | -i ../bin 3 | -------------------------------------------------------------------------------- /docs/eudist.txt: -------------------------------------------------------------------------------- 1 | == EuDist, Distributing Programs 2 | 3 | <> 4 | 5 | === Introduction 6 | 7 | EuDist is a tool that makes distributing your program easier. 8 | It is designed to gather all of the Euphoria files that your program 9 | uses and put them into a directory. This can also be useful for 10 | sending example code for bug reports. 11 | 12 | === Command Line Switches 13 | 14 | You can use the standard ##-i## and ##-c## switches with ##eudist##. There are 15 | additional options: 16 | 17 | * ##~--clear## Clear the output directory before copying files 18 | * ##-d ## Specify the output directory for the files 19 | * ##-e ## ##~--exclude-file ## Exclude a file from being copied 20 | * ##-ed ## ##~--exclude-directory ## Exclude a directory from being copied 21 | * ##-edr ## ##~--exclude-directory-recursively ## Exclude a directory 22 | and all subdirectories from being copied 23 | -------------------------------------------------------------------------------- /docs/html/images/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/docs/html/images/next.png -------------------------------------------------------------------------------- /docs/html/images/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/docs/html/images/prev.png -------------------------------------------------------------------------------- /docs/images/300px-logo-logotype-orange-v2-r0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/docs/images/300px-logo-logotype-orange-v2-r0.png -------------------------------------------------------------------------------- /docs/images/300px-mongoose-head-colour-v2-r0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/docs/images/300px-mongoose-head-colour-v2-r0.png -------------------------------------------------------------------------------- /docs/keywords.txt: -------------------------------------------------------------------------------- 1 | == Euphoria Keywords 2 | 3 | The **keywords** are part of the Euphoria language and are //reserved// for the exclusive use of the interpreter. 4 | You can not used them as identifiers for your own variables or routines. 5 | 6 | | ##[[:and]]## | ##[[:as]]## | ##[[:break]]## | ##[[:by]]## | 7 | | ##[[:case]]## | ##[[:constant]]## | ##[[:continue]]## | ##[[:deprecate]]## | 8 | | ##[[:do]]## | ##[[:else]]## | ##[[:elsedef]]## | ##[[:elsif]]## | 9 | | ##[[:elsifdef]]## | ##[[:end]]## | ##[[:entry]]## | ##[[:enum]]## | 10 | | ##[[:exit]]## | ##[[:export]]## | ##[[:fallthru]]## | ##[[:for]]## | 11 | | ##[[:function]]## | ##[[:global]]## | ##[[:goto]]## | ##[[:if]]## | 12 | | ##[[:ifdef]]## | ##[[:include]]## | ##[[:label]]## | ##[[:loop]]## | 13 | | ##[[:namespace]]## | ##[[:not]]## | ##[[:or]]## | ##[[:override]]## | 14 | | ##[[:procedure]]## | ##[[:public]]## | ##[[:retry]]## | ##[[:return]]## | 15 | | ##[[:routine]]## | ##[[:switch]]## | ##[[:then]]## | ##[[:to]]## | 16 | | ##[[:type]]## | ##[[:until]]## | ##[[:while]]## | ##[[:with]]## | 17 | | ##[[:without]]## | ##[[:xor]]## | | | 18 | -------------------------------------------------------------------------------- /docs/pdf-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OpenEuphoria: { title } 6 | 7 | 8 | 9 | 16 | 17 |
18 |
19 |
20 |
21 | {body} 22 |
23 |
24 |
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/pdf.css: -------------------------------------------------------------------------------- 1 | /* p { font-face : "Palatino Linotype" ; font-size : 18px ; } */ 2 | 3 | pre { 4 | padding-left: 1ex; 5 | width: 100%; 6 | background-color: rgb(234, 242, 234); 7 | } 8 | 9 | h1 { 10 | color: rgb(000, 000, 255); 11 | font-size: 42px; 12 | } 13 | 14 | h2 { 15 | color: rgb(255, 255, 255); 16 | background-color: rgb(0, 0, 255); 17 | } 18 | 19 | h3 { 20 | color : rgb(0.0,0); 21 | background-color: rgb(200,200,255); 22 | margin-left: 50px; 23 | font-size: 20px; 24 | } 25 | 26 | h4 { 27 | color: #fff; 28 | background-color: #aaa; 29 | font-size: 20px; 30 | } 31 | 32 | div { 33 | margin-left: 20px; 34 | } 35 | 36 | div.toc_2 { 37 | margin-left: 60px; 38 | color: #00F; 39 | } 40 | 41 | div.toc_3 { 42 | margin-left: 100px; 43 | } 44 | 45 | div.toc_4 { 46 | color: rgb(200, 000, 000 ); 47 | margin-left: 140px; 48 | } 49 | 50 | div.floatleft { 51 | color: rgb(200, 000, 200 ); 52 | float: left; 53 | } 54 | 55 | div.floatright { 56 | color: rgb(200, 000, 000); 57 | float: right; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /docs/release/1.0.0.txt: -------------------------------------------------------------------------------- 1 | == Version 1.0 July 1993 2 | 3 | Euphoria was first released after 3 years of research and development 4 | and 6 months of Beta testing. Many of the ideas behind Euphoria came 5 | from Robert Craig's Master's Thesis in Computer Science at the University 6 | of Toronto. That thesis was strongly influenced by the work of John Backus 7 | on functional programming (FP) languages. 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/release/1.1.0.txt: -------------------------------------------------------------------------------- 1 | == Version 1.1 January 1994 2 | 3 | * Several language features and demo programs were added. 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/release/1.2.0.txt: -------------------------------------------------------------------------------- 1 | == Version 1.2 March 1994 2 | 3 | * A problem that prevented Euphoria from running in a DOS prompt under Windows was eliminated. 4 | 5 | -------------------------------------------------------------------------------- /docs/release/1.3.0.txt: -------------------------------------------------------------------------------- 1 | == Version 1.3 June 1995 2 | 3 | * You can now edit multiple files using multiple edit windows. 4 | * 20 new library routines were added. 5 | * Graphics performance was greatly improved. 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/release/1.4.0.txt: -------------------------------------------------------------------------------- 1 | == Version 1.4 May 1996 2 | 3 | * You can now convert any Euphoria program into a **stand-alone .exe** file. 4 | * The separate DOS4GW.EXE DOS extender file has been eliminated. 5 | * Windows 95 long filename support. 6 | * Support for DOS software interrupts. 7 | * New utility programs: **key.ex**, **where.ex**, **ascii.ex**, **guru.ex**. 8 | * New demo program: **dosint.ex**. 9 | * New library routines: **set_rand()**, **use_vesa()**. 10 | * You can peek or poke an entire sequence of bytes. 11 | * Editor enhancements. 12 | * Reduction in space overhead for sequences. 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/release/1.4.1.txt: -------------------------------------------------------------------------------- 1 | == Version 1.4.1 (release a) July 1996 2 | 3 | * **crash_message()** library routine was added. 4 | * Programs **bound** by registered users will now produce run-time error 5 | diagnostics regardless of the size of the program. 6 | * **shroud.bat** has a new option ##-full_keywords##. 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/release/1.4.2.txt: -------------------------------------------------------------------------------- 1 | == Version 1.4.2 (release b) October 1996 2 | 3 | * **mset.ex** has a more visible selector box on it's grid. It has also been sped up. 4 | * **ed.ex** now allows special characters greater than ASCII 127 to be entered by 5 | pressing the **Alt** key and typing digits on the numeric keypad. 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/release/1.5.0.txt: -------------------------------------------------------------------------------- 1 | == Version 1.5 March 21, 1997 2 | 3 | * The following library routines were added. They are described fully 4 | in **library.doc**. 5 | ** **allow_break()** 6 | ** **check_break()** 7 | ** **mem_copy()** 8 | ** **mem_set()** 9 | ** **atom_to_float32()** 10 | ** **atom_to_float64()** 11 | ** **float32_to_atom()** 12 | ** **float64_to_atom()** 13 | ** **get_all_palette()** 14 | ** **save_bitmap()** 15 | ** **save_screen()** 16 | ** **arctan()** 17 | ** **and_bits()** 18 | ** **or_bits()** 19 | ** **xor_bits()** 20 | ** **not_bits()** 21 | ** **get_vector()** 22 | ** **set_vector()** 23 | ** **lock_memory()** 24 | ** **tick_rate()** 25 | * **with profile_time** (time profiling for DOS32) was added. 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/release/1.5.1.txt: -------------------------------------------------------------------------------- 1 | == Version 1.5.1 (release a) June 13, 1997 2 | 3 | * Many operations and library routines were optimized. 4 | * **get_key()** is 100x faster when there is no key in the buffer. 5 | * **get_all_palette()** is over 100x faster and this makes **save_screen()** much 6 | faster. 7 | * The following routines have now been built directly into **ex.exe**, to avoid 8 | the overhead of calling machine_proc() or machine_func(): **pixel()**, 9 | **get_pixel()**, **mem_set()**, **mem_copy()**. 10 | * **poke()** of a long sequence into memory, other than video memory, is 50% faster. 11 | * **pixel()** is 4x faster in mode 19. 12 | * **get_pixel()** is faster in all modes. 13 | * **display_image()** is about 30% faster in most modes and up to 4x faster in 14 | mode 19, because
pixel() is faster. 15 | * All arithmetic and bitwise operations applied to sequences of integers are now 29% faster. 16 | * a **&** b (concatenation) is 15% faster in most cases, and is dramatically faster in the case 17 | where you grow a very long sequence by concatenating many small sequences onto it. 18 | * **getc()** is 12% faster. 19 | * **match()** is 8% faster in typical cases. 20 | * **append()/prepend()** are 15% faster in many cases. 21 | * **find()** of an integer within a sequence of integers is 64% faster. 22 | * Formation of a 2-element sequence **{a,b}** is 11% faster. 23 | * Internal copying of a shared sequence when it can no longer be shared is 15% 24 | faster. 25 | 26 | -------------------------------------------------------------------------------- /docs/release/2.0.0.txt: -------------------------------------------------------------------------------- 1 | == Version 2.0 March 25, 1998 2 | 3 | * The install procedure has changed. The Euphoria .zip file now contains a large 4 | ##bundle.dat## file that contains over 100 files. This makes it easier for 5 | people to locate the important files: **readme.doc**, **install.bat**, etc. 6 | that they should look at before installing. The .zip file is also 35K smaller 7 | as a result. 8 | * **shroud** will warn you to use **bind/bindw** if you try to create a shrouded 9 | source file with a name ending in "*.exe". 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/release/2.1.0.txt: -------------------------------------------------------------------------------- 1 | == Version 2.1 WIN32 + DOS32 March 29, 1999 2 | 3 | * Updates to the **trace** screen have been optimized. Unnecessary refreshes of 4 | the source code, and the variables on the trace screen, have been eliminated. 5 | When a refresh is necessary, it is now slightly faster. This makes a noticeable 6 | difference in **exw.exe**, and also in **ex.exe** in pixel-graphics modes. For 7 | **ex.exe** in text modes, it reduces screen flicker slightly. 8 | * The **install** program no longer requires that your PATH be less than 128 9 | characters. It will simply warn you if it isn't. Newer versions of DOS allow 10 | for a longer PATH. Thanks to Steve Adams. 11 | * An extra error check was added to **unregister_block()** in **safe.e**. Thanks 12 | to David Guy. 13 | 14 | -------------------------------------------------------------------------------- /docs/release/2.2.0-linux.txt: -------------------------------------------------------------------------------- 1 | == Version 2.2 Linux November 22, 1999 2 | 3 | * **All platforms: bug fixed:** 4 | If a Euphoria routine called itself recursively from inside a 5 | for-loop, and at one level of recursion the for-loop counted //up// 6 | to an upper limit, and at another level of recursion the for-loop 7 | counted //down// to a 8 | lower limit, the for-loop would probably malfunction at one of the levels. 9 | Thanks to Delroy Gayle. 10 | * The documentation was improved in many places, especially with respect 11 | to the Linux platform. 12 | -------------------------------------------------------------------------------- /docs/release/2.2.0.txt: -------------------------------------------------------------------------------- 1 | == Version 2.2 WIN32+DOS32 January 14, 2000 2 | 3 | * Better error messages are now issued from the interpreter, and from 4 | the bind program, for some typical errors that users can make when 5 | binding a program. 6 | * The documentation has been improved in a few places. 7 | * The **window.exw** demo program shows how to load the 8 | Euphoria icon contained in exw.exe. 9 | * Language War uses Jiri Babor's improved version of **putsxy.e**. 10 | -------------------------------------------------------------------------------- /docs/release/2.2.0pa1.txt: -------------------------------------------------------------------------------- 1 | == Version 2.2 Pre Alpha #1 Linux July 1, 1999 2 | 3 | * The first version of Euphoria for **Linux** was released. 4 | 5 | -------------------------------------------------------------------------------- /docs/release/2.2.0pa2.txt: -------------------------------------------------------------------------------- 1 | == Version 2.2 Pre Alpha #2 Linux July 6, 1999 2 | 3 | * The **ncurses** library has been statically linked into 4 | **exu**. 5 | * **exu** is now a compressed executable (97K). 6 | * **bug fixed: ed** 7 | can now edit files with upper case letters in the name. 8 | * The fraction of a second delay when you press the **Esc** key in 9 | **ed** has been removed. 10 | -------------------------------------------------------------------------------- /docs/release/2.2.0pa3.txt: -------------------------------------------------------------------------------- 1 | == Version 2.2 Pre Alpha #3 Linux July 8, 1999 2 | 3 | * In an **xterm** window, **exu** will 4 | prompt you to hit **Enter** before it exits. Without this, **xterm** 5 | restores the screen so fast that you don't see any output or error messages. 6 | * An internal coding change was made to Euphoria's 7 | **rand()** function. 8 | (The algorithm has not changed.) 9 | Hopefully this will 10 | allow rand() to work on all distributions of 11 | **Linux**. Please let us know if 12 | rand() still fails. 13 | * **ed:** The **Esc h** command will 14 | display the Euphoria help files. This was broken in pre-alpha#2. 15 | * In an **xterm** window, Euphoria's 16 | **video_config()** now reports the correct 17 | number of lines and columns - this helps 18 | **ed** to work much better. 19 | **ed** will work with the initial size of 20 | window in effect when **ed** starts up. 21 | * **ed:** **F1**, **F2**, **F3**, 22 | **F4**, **Home**, **End**, and the **Delete** key work now in 23 | **xterm** (under Red Hat 5.2 at least). The other F-keys were already 24 | working. **PageUp/PageDown** and some other keys still don't work - feel 25 | free to add your own alternate keys. 26 | * **exu** is now even smaller - just 82K. 27 | -------------------------------------------------------------------------------- /docs/release/2.2.0pa4.txt: -------------------------------------------------------------------------------- 1 | == Version 2.2 Pre Alpha #4 Linux July 15, 1999 2 | 3 | * You can call C routines in **Linux** 4 | shared libraries (**.so** files). See 5 | **euphoria/demo/linux/callc.exu** for 6 | some examples. 7 | * If your program does not output anything to the **xterm** window, 8 | **exu** will not issue the "Press Enter" 9 | prompt. 10 | * **All platforms: ed** now lets you recall 11 | previous top-line command text using **up-arrow** and **down-arrow**, 12 | similar to doskey in DOS and the shell history in Linux. This works with 13 | any strings that you type for **Esc n** (new file), 14 | **Esc d** (Linux command), **Esc f** (find string) or 15 | **Esc r** (replace string). In addition, you can now use 16 | **arrow keys**, **Home**, **End**, **Delete** etc. to edit 17 | strings before you press **Enter**. 18 | -------------------------------------------------------------------------------- /docs/release/3.1.1.txt: -------------------------------------------------------------------------------- 1 | == Version 3.1.1 August 2007 2 | 3 | This release is a minor update to fix some bugs. 4 | 5 | === Bug Fixes 6 | 7 | * **bug fixed: ** A storage leak (memory allocated 8 | but never freed) was introduced in version 3.1, on the Linux and FreeBSD 9 | platforms. Fixed by Matthew Lewis. 10 | * **bug fixed: ** When Euphoria failed to open the 11 | main program file, the error message would sometimes show the wrong file type. 12 | Fixed by Matthew Lewis. 13 | * **bug fixed: ** 14 | Bugs in the new library routines, find_from() and match_from() were corrected. 15 | The third argument (the starting index) is now tightly-checked. Fixed by 16 | Matthew Lewis and Rob Craig. 17 | * **bug fixed: ** The ed script on Linux was changed 18 | to allow blanks in the path of the file to be edited. Fixed by Rob Craig. 19 | * **bug fixed: ** Double-quotes were added to ed.ex 20 | so Esc e will work with paths containing blanks. Reported by Alex 21 | Caracatsanis. Fixed by Rob Craig. 22 | * **bug fixed: ** database.e was fixed so forward 23 | slashes are allowed in the db_compress() file name. Reported by Frank Dowling. 24 | Fixed by Rob Craig. 25 | -------------------------------------------------------------------------------- /docs/release/4.0.2.txt: -------------------------------------------------------------------------------- 1 | == Version 4.0.2 April 5, 2011 2 | 3 | === Bug Fixes 4 | 5 | * Fixed ##[[:canonical_path]]## performance issues introduced in 4.0.1. 6 | * [[ticket:646]] ##[[:dir]]## can now handle multiple wildcards on non-Windows platforms 7 | * [[ticket:647]] The version detection system has been improved so that all binaries use 8 | the same C header file, which should prevent the potential of mismatched versions. 9 | * [[ticket:644]] ##[[:canonical_path]]## leaves alone path components (and anything after them) 10 | with wildcards. 11 | * Fixed compiler directives about functions that don't return. Removed some that were obsolete, 12 | and corrected for MinGW to use the GCC directives. 13 | * [[ticket:648]] Fix small memory leak from while loops 14 | 15 | === New Functionality 16 | 17 | * The ##std\rand.e function##, **##sample()##**, now implements both //with replacement// 18 | and //without replacement// sampling methods. 19 | -------------------------------------------------------------------------------- /docs/release/4.2.0.txt: -------------------------------------------------------------------------------- 1 | == Version 4.2 Date TBD 2 | 3 | === Bug Fixes 4 | * correctly identify which arch defines to define even after cross translating from one to another or translating from 4.0... ticket 1017. 5 | -------------------------------------------------------------------------------- /docs/release/euc-a1.txt: -------------------------------------------------------------------------------- 1 | == Euphoria to C Translator Alpha September 6, 2000 2 | 3 | * The first release of the translator. It supports Euphoria version 2.2. 4 | It relies on WATCOM C for DOS and Windows, and GNU C for Linux. Prime sieve 5 | runs 3.2x faster than with the interpreter. Shell sort runs 4.5 times faster. 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/release/euc-a2.txt: -------------------------------------------------------------------------------- 1 | == Euphoria to C Translator Alpha-2 October 26, 2000 2 | 3 | * Support for the Lcc C compiler for Windows was added. DJGPP C (DOS) is partially 4 | supported (no pixel graphics). 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/release/euc-a3.txt: -------------------------------------------------------------------------------- 1 | == Euphoria to C Translator Alpha-3 November 27, 2000 2 | 3 | * Some bugs were fixed. Some new features were added. Borland C++ is now supported. 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/release/euc-a4.txt: -------------------------------------------------------------------------------- 1 | == Euphoria to C Translator Alpha-4 December 14, 2000 2 | 3 | * Pixel-graphics and mouse support was added for DJGPP C. 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/release/euc-b1.txt: -------------------------------------------------------------------------------- 1 | == Euphoria to C Translator Beta-1 February 15, 2001 2 | 3 | * Some bugs were fixed. Smaller, faster C code is produced. 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/release/euc-b2.txt: -------------------------------------------------------------------------------- 1 | == Euphoria to C Translator Beta-2 May 8, 2001 2 | 3 | * You can now use the translator to make a .dll file. 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/release/euc.txt: -------------------------------------------------------------------------------- 1 | == Euphoria to C Translator Official June 5, 2001 2 | 3 | * A couple of minor enhancements and bug fixes. 4 | 5 | -------------------------------------------------------------------------------- /docs/sortcheck.ex: -------------------------------------------------------------------------------- 1 | include wildcard.e 2 | 3 | object line 4 | sequence words, prev_line 5 | 6 | words = {} 7 | prev_line = "" 8 | while 1 do 9 | line = gets(0) 10 | if atom(line) then 11 | exit 12 | end if 13 | if equal(line, prev_line) then 14 | puts(1, "duplicate: " & line & '\n') 15 | end if 16 | if compare(line, prev_line) < 0 then 17 | puts(1, "bad sort: " & line & '\n') 18 | end if 19 | if not equal(line, upper(line)) then 20 | puts(1, "not upper case: " & line & '\n') 21 | end if 22 | words = append(words, line) 23 | prev_line = line 24 | end while 25 | 26 | ? length(words) 27 | -------------------------------------------------------------------------------- /docs/spell.ex: -------------------------------------------------------------------------------- 1 | include file.e 2 | include wildcard.e 3 | 4 | integer status, file_check_id 5 | 6 | function file_check(sequence path, sequence dir_entry) 7 | -- spell check one file 8 | if match(".txt", lower(dir_entry[D_NAME])) then 9 | system("eui spellchk " & dir_entry[D_NAME], 2) 10 | end if 11 | return 0 12 | end function 13 | 14 | system("del badwords.txt", 2) 15 | 16 | file_check_id = routine_id("file_check") 17 | 18 | status = walk_dir(".", file_check_id, 0) 19 | 20 | puts(1, "\nSee badwords.txt\n") 21 | -------------------------------------------------------------------------------- /file_id.diz: -------------------------------------------------------------------------------- 1 | Euphoria Programming Language v4.0 2 | for Windows, Linux, FreeBSD 3 | and other unix versions available. 4 | Simple, flexible, and easy to learn. 5 | Outperforms all popular interpreted 6 | languages. Complete Reference Manual 7 | included. Lots of free example programs 8 | with full source. Makes .EXE files. Great 9 | for games, utilities, CGI, and GUI programs. 10 | See docs/ and/or http://openeuphoria.org 11 | -------------------------------------------------------------------------------- /include/euphoria/stddebug.e: -------------------------------------------------------------------------------- 1 | -- 2 | -- TODO: document this file, i.e. what is it for, how is it used, do we have tests 3 | -- using it, is it up to date, etc... 4 | -- 5 | 6 | namespace stddebug 7 | 8 | include std/cmdline.e 9 | include std/console.e 10 | include std/convert.e 11 | include std/datetime.e 12 | include std/dll.e 13 | include std/eds.e 14 | include std/error.e 15 | include std/eumem.e 16 | include std/filesys.e 17 | include std/flags.e 18 | include std/get.e 19 | include std/graphcst.e 20 | include std/graphics.e 21 | include std/image.e 22 | include std/io.e 23 | include std/lcid.e 24 | include std/locale.e 25 | include std/localeconv.e 26 | include std/machine.e 27 | include std/map.e 28 | include std/math.e 29 | include std/memory.e 30 | include std/net/common.e 31 | include std/net/dns.e 32 | include std/net/http.e 33 | include std/os.e 34 | include std/pipeio.e 35 | include std/pretty.e 36 | include std/primes.e 37 | include std/regex.e 38 | include std/safe.e 39 | include std/search.e 40 | include std/sequence.e 41 | include std/serialize.e 42 | --include std/sets.e 43 | include std/socket.e 44 | include std/sort.e 45 | include std/stack.e 46 | include std/stats.e 47 | include std/task.e 48 | include std/text.e 49 | include std/types.e 50 | --include std/unicode.e 51 | include std/unittest.e 52 | include std/wildcard.e 53 | include std/win32/msgbox.e 54 | -------------------------------------------------------------------------------- /include/std/win32/sounds.e: -------------------------------------------------------------------------------- 1 | --**** 2 | -- == Windows Sound 3 | -- 4 | -- <> 5 | -- 6 | 7 | namespace sound 8 | 9 | include std/dll.e 10 | 11 | public constant 12 | SND_DEFAULT = 0x00, 13 | SND_STOP = 0x10, 14 | SND_QUESTION = 0x20, 15 | SND_EXCLAMATION = 0x30, 16 | SND_ASTERISK = 0x40, 17 | $ 18 | 19 | 20 | integer xMessageBeep 21 | atom xUser32 22 | --** 23 | -- Makes a sound. 24 | -- 25 | -- Parameters: 26 | -- # sound_type: An atom. The type of sound to make. The default is SND_DEFAULT. 27 | -- 28 | -- Comments: 29 | -- The ##sound_type## value can be one of ... 30 | -- * ##SND_ASTERISK## 31 | -- * ##SND_EXCLAMATION## 32 | -- * ##SND_STOP## 33 | -- * ##SND_QUESTION## 34 | -- * ##SND_DEFAULT## 35 | -- 36 | -- These are sounds associated with the same Windows events 37 | -- via the Control Panel. 38 | -- 39 | --Example: 40 | -- 41 | -- sound( SND_EXCLAMATION ) 42 | -- 43 | 44 | public procedure sound( atom sound_type = SND_DEFAULT ) 45 | if not object(xMessageBeep) then 46 | xUser32 = dll:open_dll("user32.dll") 47 | xMessageBeep = dll:define_c_proc(xUser32, "MessageBeep", {C_UINT}) 48 | end if 49 | c_proc( xMessageBeep, { sound_type } ) 50 | end procedure 51 | -------------------------------------------------------------------------------- /include/std/win32/w32dllconst.ew: -------------------------------------------------------------------------------- 1 | --**** 2 | -- == Dynamic Linking to External Code - Windows specific definitions 3 | -- 4 | -- <> 5 | -- 6 | 7 | namespace w32dll 8 | 9 | include std/dll.e 10 | 11 | --**** 12 | -- === C Type Constants 13 | -- These C type constants are used when defining external C functions in a shared 14 | -- library file. 15 | -- 16 | -- Example 1: 17 | -- See [[:define_c_proc]] 18 | -- 19 | -- See Also: 20 | -- [[:define_c_proc]], [[:define_c_func]], [[:define_c_var]] 21 | 22 | public constant 23 | --** handle sizeof pointer 24 | C_HANDLE = C_POINTER, 25 | --** hwnd sizeof pointer 26 | C_HWND = C_POINTER, 27 | --** wparam sizeof pointer 28 | C_WPARAM = C_POINTER, 29 | --** lparam sizeof pointer 30 | C_LPARAM = C_POINTER, 31 | --** hresult 32-bits 32 | C_HRESULT = C_LONG, 33 | $ 34 | 35 | -------------------------------------------------------------------------------- /makecfg.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | SET BASEDIR=%~dp0 3 | SET EUDIR=%BASEDIR:~0,-1% 4 | SET CONFIG=%EUDIR%\bin\eu.cfg 5 | 6 | :defarch 7 | IF "%PROCESSOR_ARCHITECTURE%" == "x86" SET DEFARCH=X86 8 | IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" SET DEFARCH=X86_64 9 | 10 | :setarch32 11 | IF "%1" == "X86" ( 12 | SET ARCH=%1 13 | GOTO makecfg 14 | ) 15 | 16 | :setarch64 17 | IF "%1" == "X86_64" ( 18 | SET ARCH=%1 19 | GOTO makecfg 20 | ) 21 | 22 | :default 23 | IF "%1" == "" ( 24 | SET ARCH=%DEFARCH% 25 | GOTO makecfg 26 | ) 27 | 28 | :badarch 29 | ECHO Invalid arch "%1" 30 | EXIT /B 1 31 | 32 | :makedir 33 | IF NOT EXIST %EUDIR%\bin ( 34 | MKDIR %EUDIR%\bin 35 | ) 36 | 37 | :makecfg 38 | ECHO Writing contents to: %CONFIG% 39 | ECHO [all] > %CONFIG% 40 | ECHO -eudir %EUDIR% >> %CONFIG% 41 | ECHO -i %EUDIR%\include >> %CONFIG% 42 | ECHO [translate] >> %CONFIG% 43 | ECHO -arch %ARCH% >> %CONFIG% 44 | ECHO -gcc >> %CONFIG% 45 | ECHO -com %EUDIR% >> %CONFIG% 46 | ECHO -con >> %CONFIG% 47 | ECHO -lib-pic %EUDIR%\bin\euso.a >> %CONFIG% 48 | ECHO -lib %EUDIR%\bin\eu.a >> %CONFIG% 49 | ECHO [bind] >> %CONFIG% 50 | ECHO -eub %EUDIR%\bin\eub.exe >> %CONFIG% 51 | TYPE %CONFIG% 52 | :done 53 | PAUSE 54 | -------------------------------------------------------------------------------- /makecfg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EUDIR=$(realpath $(dirname $0)) 3 | CONFIG=$EUDIR/bin/eu.cfg 4 | 5 | #defarch 6 | if [ "$(uname -m)" == "i686" ]; then DEFARCH="X86"; fi 7 | if [ "$(uname -m)" == "x86_64" ]; then DEFARCH="X86_64"; fi 8 | 9 | #setarch32 10 | if [ "$1" == "X86" ]; then 11 | ARCH=$1 12 | #setarch64 13 | elif [ "$1" == "X86_64" ]; then 14 | ARCH=$1 15 | #default 16 | elif [ "$1" == "" ]; then 17 | ARCH=$DEFARCH 18 | #badarch 19 | else 20 | echo Invalid arch "$1" 21 | exit 1 22 | fi 23 | 24 | #makecfg 25 | mkdir -p $EUDIR/bin 26 | echo Writing contents to: $CONFIG 27 | echo [all] > $CONFIG 28 | echo -eudir $EUDIR >> $CONFIG 29 | echo -i $EUDIR/include >> $CONFIG 30 | echo [translate] >> $CONFIG 31 | echo -arch $ARCH >> $CONFIG 32 | echo -gcc >> $CONFIG 33 | echo -com $EUDIR >> $CONFIG 34 | echo -con >> $CONFIG 35 | echo -lib-pic $EUDIR/bin/euso.a >> $CONFIG 36 | echo -lib $EUDIR/bin/eu.a >> $CONFIG 37 | echo [bind] >> $CONFIG 38 | echo -eub $EUDIR/bin/eub >> $CONFIG 39 | cat $CONFIG 40 | read -p "Press any key to continue . . ." 41 | -------------------------------------------------------------------------------- /packaging/archlinux/PKGBUILD.fmt: -------------------------------------------------------------------------------- 1 | # Contributor: Jeremy Cowgar 2 | pkgname=euphoria 3 | pkgver=VERSION 4 | pkgrel=1 5 | pkgdesc="Fast interpreted or compiled general purpose programming language" 6 | url="http://openeuphoria.org" 7 | license=('custom:"OpenEuphoria License"') 8 | source=(http://openeuphoria.org/dist/Linux/$pkgname-$pkgver.tar.gz) 9 | md5sums=('SUM') 10 | arch=('i686' 'x86_64') 11 | 12 | if [ "$CARCH" = "x86_64" ]; then 13 | depends=('lib32-glibc') 14 | fi 15 | 16 | build() { 17 | cd "$srcdir/$pkgname-$pkgver-src/source" 18 | 19 | ./configure --prefix=/usr 20 | touch pcre/* 21 | make 22 | make tools 23 | } 24 | 25 | package() { 26 | cd "$srcdir/$pkgname-$pkgver-src/source" 27 | 28 | # Base and Tool install 29 | make DESTDIR="$pkgdir" install install-tools install-docs 30 | 31 | # Install our license file per ArchLinux spec 32 | mkdir -p "$pkgdir/usr/share/licenses/$pkgname" 33 | install -m 644 "$srcdir/$pkgname-$pkgver/License.txt" "$pkgdir/usr/share/licenses/$pkgname" 34 | install -m 644 "$srcdir/$pkgname-$pkgver/source/build/euphoria.pdf /usr/ 35 | 36 | # Create a default eu.cfg file 37 | mkdir -p "$pkgdir/etc/euphoria" 38 | echo [all] > "$pkgdir/etc/euphoria/eu.cfg" 39 | echo -i /usr/share/euphoria/include >> "$pkgdir/etc/euphoria/eu.cfg" 40 | } 41 | 42 | -------------------------------------------------------------------------------- /packaging/debian/Makefile.fake: -------------------------------------------------------------------------------- 1 | # Indirect GNU Makefile for Euphoria (Linux) 2 | # This makefile calls the real makefile located in ./source 3 | # Syntax: 4 | # Clean up : make clean 5 | # Clean up binary and : make distclean 6 | # translated files 7 | # Everything : make 8 | # Interpreter (eui): make interpreter 9 | # Translator (euc): make translator 10 | # Translator Library (eu.a): make library 11 | # Backend (eub): make backend 12 | # 13 | # FreeBSD (6.2) 14 | # NOTE: Versions before 6.2 may not need EBSD=1 15 | # Clean up : gmake clean 16 | # Everything : gmake 17 | # Interpreter (eui): gmake interpreter EBSD=1 18 | # Translator (euc): gmake translator EBSD=1 19 | # Translator Library (eu.a): gmake library 20 | # Backend (eub): gmake backend EBSD=1 21 | # 22 | # The make process will adjust common.e to set EBSD to the 23 | # correct value. To reset this value, run gmake clean. 24 | export 25 | all clean library interpreter translator backend source install install-docs uninstall distclean tools install-tools : 26 | cd source && $(MAKE) $@ 27 | 28 | 29 | .PHONY : all clean library interpreter translator backend source install install-docs uninstall distclean tools install-tools 30 | -------------------------------------------------------------------------------- /packaging/debian/README: -------------------------------------------------------------------------------- 1 | Making a Debian package 2 | 3 | Required: 4 | 5 | euphoria: Working euphoria installation. 6 | debhelper: This package is used to help build the package. 7 | eudoc: Generates the euphoria documentation 8 | creolehtml: Converts the eudoc output to html 9 | 10 | Both eudoc and creolehtml are in the tools section of the euphoria 11 | source code repository. 12 | 13 | From the packaging/debian directory, simply type: 14 | 15 | $ ./configure && make 16 | 17 | The process should be automated. It will build a source and a binary package. 18 | It will build a package with either i386 or amd64, depending upon the 19 | host machine. 20 | 21 | TODO: 22 | Bind, shroud, man pages 23 | -------------------------------------------------------------------------------- /packaging/debian/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "# Configuration for building debian packages" > Makefile.eu 4 | 5 | ROOTDIR=`cd ../..; pwd` >> Makefile.eu 6 | 7 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 8 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 9 | 10 | if echo "$UNAME_MACHINE" | grep "i[1-7]86" > /dev/null; then 11 | echo ARCH=i386 >> "$PREFIX"Makefile.eu 12 | elif echo "$UNAME_MACHINE" | grep "x86_64" > /dev/null; then 13 | echo ARCH=amd64 >> "$PREFIX"Makefile.eu 14 | fi 15 | 16 | HAS_CONFIG="" 17 | 18 | while [ "$1" != "" ]; do 19 | case $1 in 20 | --config ) 21 | echo "CONFIG=$2 --rootdir \"$ROOTDIR\"" >> "$PREFIX"Makefile.eu 22 | HAS_CONFIG="YES" 23 | shift 24 | ;; 25 | * ) 26 | echo "Unknown option '$1'" 27 | echo "Configures and prepares the euphoria source for building a Debian package" 28 | echo 29 | echo "configure [options]" 30 | echo 31 | echo "Options:" 32 | echo " --config options supply options that will be passed to the" 33 | echo " normal configure script when building euphoria" 34 | esac 35 | shift 36 | done 37 | 38 | if [ "x$HAS_CONFIG" = "x" ]; then 39 | echo "CONFIG=--rootdir \"$ROOTDIR\"" >> "$PREFIX"Makefile.eu 40 | fi 41 | -------------------------------------------------------------------------------- /packaging/debian/control: -------------------------------------------------------------------------------- 1 | Source: euphoria 2 | Section: interpreters 3 | Priority: extra 4 | Maintainer: Matt Lewis 5 | Build-Depends: libc6-dev (>= 2.6.1 ), linux-libc-dev (>= 2.6.22-14.47 ) 6 | Standards-Version: 3.8.4 7 | 8 | Package: euphoria 9 | Architecture: %arch% 10 | Depends: libc6 (>= 2.3.6-6~) 11 | Description: Intrepreted and compiled programming language 12 | Euphoria is a simple, flexible, and easy-to-learn programming 13 | language. It lets you quickly and easily develop programs for 14 | Windows, Linux, OSX and FreeBSD. Euphoria was first released 15 | in 1993. Since then Rapid Deployment Software has been steadily 16 | improving it with the help of a growing number of enthusiastic users. 17 | Although Euphoria provides subscript checking, uninitialized variable 18 | checking and numerous other run-time checks, it is extremely fast. 19 | People use it to develop Windows GUI programs and Linux/FreeBSD 20 | X Windows programs. It is also very useful for CGI 21 | (Web-based) programming. -------------------------------------------------------------------------------- /packaging/debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Matt Lewis on 2 | Sat, 29 Dec 2007 21:28:05 -0500. 3 | 4 | It was downloaded from 5 | 6 | Author(s): 7 | 8 | Matt Lewis 9 | 10 | Copyright: 11 | Copyright (c) 2007-2011 by OpenEuphoria Group. 12 | Copyright (c) 1993-2006 by Rapid Deployment Software. 13 | All Rights Reserved. 14 | 15 | PCRE v8.10 16 | Copyright (c) 1997-2010 University of Cambridge 17 | All Rights Reserved 18 | 19 | License: 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), 23 | to deal in the Software without restriction, including without limitation 24 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 25 | and/or sell copies of the Software, and to permit persons to whom the 26 | Software is furnished to do so. 27 | 28 | The Debian packaging is (C) 2007, Matt Lewis and 29 | is licensed under the GPL, see `/usr/share/common-licenses/GPL'. 30 | 31 | -------------------------------------------------------------------------------- /packaging/debian/euphoria-manual: -------------------------------------------------------------------------------- 1 | Document : euphoria-manual 2 | Title : Euphoria Programming Language Manual 3 | Author : Euphoria Programming Team 4 | Abstract : This manual provides information about building 5 | programs with the Euphoria Programming Language. 6 | Section : Programming 7 | 8 | Format : HTML 9 | Index : /usr/share/doc/euphoria/eu400_0001.html 10 | Files : /usr/share/doc/euphoria/html/*.html 11 | 12 | Format : PDF 13 | Files : /usr/share/doc/euphoria/euphoria-4.0.pdf.gz 14 | -------------------------------------------------------------------------------- /packaging/debian/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # prerm script for euphoria 3 | 4 | if [ "$1" = remove ] || [ "$1" = upgrade ]; then 5 | if which install-docs >/dev/null 2>&1; then 6 | install-docs -r /usr/share/doc-base/euphoria-manual 7 | fi 8 | fi 9 | -------------------------------------------------------------------------------- /packaging/osx/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Ensure a directory name was given as a command line option 5 | # 6 | 7 | if [ "$1" = "" ]; then 8 | echo Usage: build.sh VERSION 9 | exit 10 | fi 11 | 12 | VERSION=$1 13 | OPT=$2 14 | REL_NAME=euphoria-OSX-${VERSION}${OPT} 15 | ROOTDIR=../../.. 16 | 17 | echo Cleaning previous working directory 18 | rm -rf ${REL_NAME} 19 | 20 | echo Getting a clean Mercurial archive 21 | hg archive $REL_NAME 22 | 23 | echo Removing unnecessary file for *nix installs 24 | cd ${REL_NAME}/bin 25 | rm -f *.bat *.ico make31.exw *.exe 26 | cd .. 27 | 28 | rm -rf docs 29 | rm -rf packaging 30 | 31 | echo Copying other misc files to bin/ 32 | cp ${ROOTDIR}/bin/ecp.dat ${ROOTDIR}/bin/eu{.a,dbg.a} bin 33 | 34 | echo Copying docs to our distribution directory 35 | mkdir docs 36 | cp ${ROOTDIR}/source/build/*.pdf docs 37 | 38 | BINS=`ls ${ROOTDIR}/bin/eu{b,bind,c,i,shroud} ${ROOTDIR}/bin/eu{coverage,dis,dist,doc,loc,test} ${ROOTDIR}/bin/creole` 39 | for f in ${BINS}; do 40 | echo Stripping/copying ${f} 41 | strip ${f} 42 | cp ${f} bin 43 | done 44 | 45 | cd .. 46 | 47 | echo Setting ownership 48 | sudo chown -R root:wheel ${REL_NAME} 49 | 50 | echo Creating distribution tar.gz 51 | tar czf ${REL_NAME}.tar.gz ${REL_NAME} 52 | 53 | echo Creating distribution tar.bz2 54 | tar cjf ${REL_NAME}.tar.bz2 ${REL_NAME} 55 | 56 | echo Done! 57 | -------------------------------------------------------------------------------- /packaging/slackware/slack-desc: -------------------------------------------------------------------------------- 1 | # HOW TO EDIT THIS FILE: 2 | # The "handy ruler" below makes it easier to edit a package description. Line 3 | # up the first '|' above the ':' following the base package name, and the '|' on 4 | # the right side marks the last column you can put a character in. You must make 5 | # exactly 11 lines for the formatting to be correct. It's also customary to 6 | # leave one space after the ':'. 7 | 8 | |-----handy-ruler------------------------------------------------------| 9 | euphoria: euphoria (interpreted language) 10 | euphoria: 11 | euphoria: euphoria is a general purpose procedural programming language made 12 | euphoria: to be simple by the use of only one recursive data structure. 13 | euphoria: 14 | euphoria: You can find out more about euphoria at http://www.openeuphoria.org 15 | euphoria: 16 | euphoria: 17 | euphoria: 18 | euphoria: 19 | euphoria: 20 | -------------------------------------------------------------------------------- /packaging/slackware/slackware-eu.cfg: -------------------------------------------------------------------------------- 1 | [all] 2 | -i /usr/share/euphoria/include 3 | -------------------------------------------------------------------------------- /packaging/source/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "# Configuration for building pretranslated source packages" > Makefile.eu 4 | 5 | ROOTDIR=`cd ../..; pwd` >> Makefile.eu 6 | 7 | HAS_CONFIG="" 8 | 9 | echo "CONFIG=$*" >> "$PREFIX"Makefile.eu 10 | 11 | # while [ "$1" != "" ]; do 12 | # case $1 in 13 | # --config ) 14 | # echo "CONFIG=$2 --rootdir \"$ROOTDIR\"" >> "$PREFIX"Makefile.eu 15 | # HAS_CONFIG="YES" 16 | # shift 17 | # ;; 18 | # * ) 19 | # echo "Unknown option '$1'" 20 | # echo "Configures and prepares the euphoria source for building a Debian package" 21 | # echo 22 | # echo "configure [options]" 23 | # echo 24 | # echo "Options:" 25 | # echo " --config options supply options that will be passed to the" 26 | # echo " normal configure script when building euphoria" 27 | # esac 28 | # shift 29 | # done 30 | 31 | -------------------------------------------------------------------------------- /packaging/unix/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Ensure a directory name was given as a command line option 5 | # 6 | 7 | if [ "$1" = "" ]; then 8 | echo Usage: build.sh VERSION 9 | exit 10 | fi 11 | 12 | VERSION=$1 13 | OPT=$2 14 | REL_NAME=euphoria-${VERSION}${OPT} 15 | ROOTDIR=../../.. 16 | 17 | echo Cleaning previous working directory 18 | rm -rf ${REL_NAME} 19 | 20 | echo Getting a clean SVN export 21 | hg archive $REL_NAME 22 | 23 | echo Removing unnecessary file for *nix installs 24 | cd ${REL_NAME}/bin 25 | rm -f *.bat *.ico make31.exw *.exe 26 | cd .. 27 | 28 | rm -rf docs 29 | rm -rf packaging 30 | 31 | BINS=`ls ${ROOTDIR}/bin/eu{b,bind,c,i,shroud} ${ROOTDIR}/bin/eu{coverage,dis,dist,doc,loc,test} ${ROOTDIR}/bin/creole` 32 | for f in ${BINS}; do 33 | echo Stripping/copying ${f} 34 | strip ${f} 35 | cp ${f} bin 36 | done 37 | 38 | echo Copying other misc files to bin/ 39 | cp ${ROOTDIR}/bin/ecp.dat ${ROOTDIR}/bin/eu{.a,dbg.a} bin 40 | 41 | echo Copying docs to our distribution directory 42 | 43 | mkdir docs 44 | cp ${ROOTDIR}/build/*.pdf docs 45 | 46 | cd .. 47 | 48 | echo Creating distribution tar.gz 49 | tar czf ${REL_NAME}.tar.gz ${REL_NAME} 50 | 51 | echo Creating distribution tar.bz2 52 | tar cjf ${REL_NAME}.tar.bz2 ${REL_NAME} 53 | 54 | echo Done! 55 | -------------------------------------------------------------------------------- /packaging/win32/after.txt: -------------------------------------------------------------------------------- 1 | After completing the installation: 2 | 3 | 1. Reboot your system (if you changed your environment). 4 | 5 | 2. View docs\euphoria.pdf or docs\html\index.html 6 | (if you chose to install the documentation). 7 | 8 | 3. Experiment with simple command-line programs first. 9 | See the tutorial directory 10 | 11 | 4. Join other Euphoria programmers on the OpenEuphoria 12 | community website, http://openeuphoria.org. 13 | -------------------------------------------------------------------------------- /packaging/win32/before.txt: -------------------------------------------------------------------------------- 1 | If you have previously installed Euphoria on your system, you may choose to install 2 | to the same directory. Your current Euphoria files will be saved in the 3 | "euphoria\backup" subdirectory. 4 | 5 | Alternatively, you could Cancel, rename your current Euphoria directory, and start 6 | this install again. 7 | -------------------------------------------------------------------------------- /packaging/win32/setenv-ow.bat: -------------------------------------------------------------------------------- 1 | @ echo off 2 | 3 | REM 4 | REM Set the environment for this installation of Euphoria 5 | REM 6 | -------------------------------------------------------------------------------- /packaging/win32/setenv.bat: -------------------------------------------------------------------------------- 1 | @ echo off 2 | 3 | REM 4 | REM Set the environment for this installation of Euphoria 5 | REM 6 | -------------------------------------------------------------------------------- /source/.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | Makefile.wat = native 3 | Makefile.gnu = native 4 | *.dst = native 5 | Jamfile = native 6 | -------------------------------------------------------------------------------- /source/alldefs.h: -------------------------------------------------------------------------------- 1 | #include "global.h" 2 | #include "execute.h" 3 | #include "symtab.h" 4 | #include "reswords.h" 5 | 6 | -------------------------------------------------------------------------------- /source/backobj.dst: -------------------------------------------------------------------------------- 1 | EU_BACKEND_RUNNER_OBJECTS = & 2 | .\$(OBJDIR)\main-.obj & 3 | .\$(OBJDIR)\init-.obj & 4 | .\$(OBJDIR)\cominit.obj & 5 | .\$(OBJDIR)\error.obj & 6 | .\$(OBJDIR)\intinit.obj & 7 | .\$(OBJDIR)\mode.obj & 8 | .\$(OBJDIR)\0ackend.obj & 9 | .\$(OBJDIR)\pathopen.obj & 10 | .\$(OBJDIR)\backend.obj & 11 | .\$(OBJDIR)\text.obj & 12 | .\$(OBJDIR)\sort.obj & 13 | .\$(OBJDIR)\types.obj & 14 | .\$(OBJDIR)\convert.obj & 15 | .\$(OBJDIR)\compress.obj & 16 | .\$(OBJDIR)\dll.obj & 17 | .\$(OBJDIR)\io.obj & 18 | .\$(OBJDIR)\filesys.obj & 19 | .\$(OBJDIR)\wildcard.obj & 20 | .\$(OBJDIR)\search.obj 21 | -------------------------------------------------------------------------------- /source/be_callc.h: -------------------------------------------------------------------------------- 1 | #ifndef BE_CALLC_H_ 2 | #define BE_CALLC_H_ 3 | 4 | #include "execute.h" 5 | 6 | object call_c(int func, object proc_ad, object arg_list); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /source/be_coverage.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "be_coverage.h" 4 | #include "be_machine.h" 5 | 6 | int cover_line = -1, cover_routine = -1, write_coverage_db = -1; 7 | 8 | void COVER_LINE(int line) 9 | { 10 | if (cover_line != -1) 11 | { 12 | internal_general_call_back(cover_line, 13 | line,0,0, 0,0,0, 0,0,0); 14 | } 15 | } 16 | 17 | void COVER_ROUTINE(int routine) 18 | { 19 | if (cover_routine != -1) 20 | { 21 | internal_general_call_back(cover_routine, 22 | routine,0,0, 0,0,0, 0,0,0); 23 | } 24 | } 25 | 26 | long WRITE_COVERAGE_DB() 27 | { 28 | if (write_coverage_db != -1) 29 | { 30 | return (long)internal_general_call_back(write_coverage_db, 31 | 0,0,0, 0,0,0, 0,0,0); 32 | } 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /source/be_coverage.h: -------------------------------------------------------------------------------- 1 | #ifndef COVERAGE_H_ 2 | #define COVERAGE_H_ 3 | 4 | extern int cover_line; 5 | extern int cover_routine; 6 | extern int write_coverage_db; 7 | 8 | void COVER_LINE( int ); 9 | void COVER_ROUTINE( int ); 10 | long WRITE_COVERAGE_DB(); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /source/be_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef BE_DEBUG_H_ 2 | #define BE_DEBUG_H_ 3 | 4 | #include "object.h" 5 | 6 | extern int external_debugger; 7 | extern int in_external_debugger; 8 | 9 | void ExternalShowDebug(); 10 | void ExternalDisplayVar( symtab_ptr s_ptr, int user_requested ); 11 | void ExternalUpdateGlobals(); 12 | void ExternalDebugScreen(); 13 | void ExternalEraseSymbol( symtab_ptr sym ); 14 | void ExternalErasePrivates( symtab_ptr proc_sym ); 15 | 16 | object init_debug_addr(); 17 | void set_debugger( char *name ); 18 | int load_debugger(); 19 | object eu_call_stack(); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /source/be_decompress.h: -------------------------------------------------------------------------------- 1 | #ifndef BE_DECOMPRESS_H_ 2 | #define BE_DECOMPRESS_H_ 3 | #include 4 | object decompress(uintptr_t c); 5 | #endif 6 | -------------------------------------------------------------------------------- /source/be_inline.h: -------------------------------------------------------------------------------- 1 | #ifndef BE_INLINE_H_ 2 | #define BE_INLINE_H_ 3 | object Dadd(d_ptr a, d_ptr b); 4 | object Dminus(d_ptr a, d_ptr b); 5 | object Dmultiply(d_ptr a, d_ptr b); 6 | #endif 7 | -------------------------------------------------------------------------------- /source/be_main.h: -------------------------------------------------------------------------------- 1 | #ifndef BE_MAIN_H_ 2 | #define BE_MAIN_H_ 3 | 4 | void be_init(); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /source/be_pcre.h: -------------------------------------------------------------------------------- 1 | #ifndef BE_PCRE_H_ 2 | #define BE_PCRE_H_ 3 | 4 | #include "object.h" 5 | #include "pcre/pcre.h" 6 | 7 | struct pcre_cleanup { 8 | struct cleanup cleanup; 9 | pcre *re; 10 | object errmsg; 11 | }; 12 | typedef struct pcre_cleanup *pcre_cleanup_ptr; 13 | 14 | object compile(object pattern, object eflags); 15 | object compile_pcre(object x, object flags); 16 | object pcre_error_message(object x); 17 | object get_ovector_size(object x ); 18 | object exec_pcre(object x ); 19 | int replace_pcre(const char *rep, const char *Src, int len, int *ovector, int cnt, 20 | char **Dest, int *Dlen); 21 | object find_replace_pcre(object x ); 22 | object pcre_error_message(object x); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /source/be_symtab.h: -------------------------------------------------------------------------------- 1 | #ifndef BE_SYMTAB_H 2 | #define BE_SYMTAB_H 3 | 4 | #include "symtab.h" 5 | #include 6 | 7 | extern symtab_ptr TopLevelSub; /* symbol table pointer of top level procedure. */ 8 | /* All user-defined symbols come after this */ 9 | 10 | extern symtab_ptr *e_routine; /* array of symbol table pointers */ 11 | extern cleanup_ptr *e_cleanup; /* array of cleanup_ptr pointers */ 12 | extern intptr_t e_routine_next; /* index of next available element */ 13 | symtab_ptr Locate(intptr_t *pc); 14 | symtab_ptr RTLookup(char *name, int file, intptr_t *pc, symtab_ptr routine, int stlen, unsigned long current_line); 15 | int FindLine(intptr_t *pc, symtab_ptr proc); 16 | int RoutineId(symtab_ptr current_sub, object name, int file_no); 17 | int PrivateName(char *name, symtab_ptr proc); 18 | int ValidPrivate(symtab_ptr sym, symtab_ptr proc); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /source/be_syncolor.h: -------------------------------------------------------------------------------- 1 | #ifndef BE_SYNCOLOR_H_ 2 | #define BE_SYNCOLOR_H_ 3 | 4 | extern int syncolor; 5 | 6 | void init_class(); 7 | int DisplayColorLine(char *pline, int string_color, int last_multi); 8 | void set_syncolor(object); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /source/depend.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # update dependencies 4 | makedepend -fMakefile.gnu -Y. -I. *.c -p'$(BUILDDIR)/intobj/back/' -a 5 | makedepend -fMakefile.gnu -Y. -I. *.c -p'$(BUILDDIR)/transobj/back/' -a 6 | makedepend -fMakefile.gnu -Y. -I. *.c -p'$(BUILDDIR)/backobj/back/' -a 7 | makedepend -fMakefile.gnu -Y. -I. *.c -p'$(BUILDDIR)/libobj/back/' -a 8 | 9 | # the sed call fails when invoked from within a Makefile 10 | # we want to replace the actual directory with $(TRUNKDIR) so that everything will 11 | # work as expected 12 | sed -iold -re 's| ([^\.\$ ]\S+\.h\b)| $(TRUNKDIR)/source/\1|g' Makefile.gnu 13 | -------------------------------------------------------------------------------- /source/echoversion.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | int main(){ 5 | printf("%d.%d.%d", MAJ_VER, MIN_VER, PAT_VER ); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /source/eu.ex: -------------------------------------------------------------------------------- 1 | -- (c) Copyright - See License.txt 2 | -- 3 | -- A Euphoria Interpreter written 100% in Euphoria 4 | -- 5 | -- usage: 6 | -- eui eu.ex prog.ex -- run a Euphoria program 7 | 8 | -- You can make this into a stand-alone .exe using the binder or the 9 | -- Euphoria To C Translator. When translated/compiled it will run 10 | -- much faster, but not as fast as the official RDS interpreter 11 | -- which uses the same Euphoria-coded front-end, combined 12 | -- with a high-performance back-end carefully hand-coded in C. 13 | 14 | with define EU_EX 15 | 16 | ifdef ETYPE_CHECK then 17 | with type_check 18 | elsedef 19 | without type_check 20 | end ifdef 21 | 22 | include mode.e 23 | set_mode( "interpret", 1 ) 24 | 25 | -- standard Euphoria includes 26 | include std/os.e 27 | include std/pretty.e 28 | include std/wildcard.e 29 | 30 | -- INTERPRETER front-end 31 | include global.e 32 | include reswords.e 33 | include std/error.e 34 | include keylist.e 35 | 36 | include c_out.e -- Translator output (leave in for now) 37 | 38 | include symtab.e 39 | include scanner.e 40 | include emit.e 41 | include parser.e 42 | 43 | -- INTERPRETER back-end, written in Euphoria 44 | include execute.e 45 | 46 | -- main program: 47 | include main.e 48 | -------------------------------------------------------------------------------- /source/eu.manifest: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | 13 | 14 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /source/eub.rc: -------------------------------------------------------------------------------- 1 | #define VER_PRODUCT_NAME "eub console\0" 2 | #define VER_FILE_DESCRIPTION "Euphoria Backend (Console)\0" 3 | #define VER_ORIGINAL_FILENAME "eub.exe\0" 4 | 5 | #include "version_info.rc" 6 | 7 | eui ICON euphoria.ico 8 | 1 24 "eu.manifest" 9 | -------------------------------------------------------------------------------- /source/eubind.ex: -------------------------------------------------------------------------------- 1 | #!/usr/bin/eui -i /usr/share/euphoria/source/ 2 | -- (c) Copyright - See License.txt 3 | -- 4 | -- The Binder 5 | -- uses the Euphoria front-end, plus a special Euphoria-coded back-end 6 | 7 | ifdef ETYPE_CHECK then 8 | with type_check 9 | elsedef 10 | without type_check 11 | end ifdef 12 | 13 | include mode.e 14 | set_mode( "bind", 0 ) 15 | 16 | -- BINDER backend: 17 | include il.e 18 | 19 | -- main program: 20 | include main.e 21 | -------------------------------------------------------------------------------- /source/eubw.rc: -------------------------------------------------------------------------------- 1 | #define VER_PRODUCT_NAME "eub windowed\0" 2 | #define VER_FILE_DESCRIPTION "Euphoria Backend (Windowed)\0" 3 | #define VER_ORIGINAL_FILENAME "eubw.exe\0" 4 | 5 | #include "version_info.rc" 6 | 7 | eui ICON euphoria.ico 8 | 1 24 "eu.manifest" 9 | -------------------------------------------------------------------------------- /source/euc.ex: -------------------------------------------------------------------------------- 1 | -- (c) Copyright - See License.txt 2 | -- Translator main file 3 | 4 | with define TRANSLATOR 5 | 6 | ifdef ETYPE_CHECK then 7 | with type_check 8 | elsedef 9 | without type_check 10 | end ifdef 11 | 12 | ifdef EPROFILE then 13 | with profile 14 | end ifdef 15 | 16 | include mode.e 17 | set_mode("translate", 0 ) 18 | 19 | include traninit.e 20 | include main.e 21 | 22 | -------------------------------------------------------------------------------- /source/euc.rc: -------------------------------------------------------------------------------- 1 | #define VER_PRODUCT_NAME "eui translator\0" 2 | #define VER_FILE_DESCRIPTION "Euphoria Translator\0" 3 | #define VER_ORIGINAL_FILENAME "euc.exe\0" 4 | 5 | #include "version_info.rc" 6 | 7 | eui ICON euphoria.ico 8 | 1 24 "eu.manifest" 9 | -------------------------------------------------------------------------------- /source/eufile.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/source/eufile.ico -------------------------------------------------------------------------------- /source/eui.ex: -------------------------------------------------------------------------------- 1 | -- (c) Copyright - See License.txt 2 | -- 3 | -- the official C back-end interpreter 4 | 5 | with define INTERPRETER 6 | 7 | ifdef ETYPE_CHECK then 8 | with type_check 9 | elsedef 10 | without type_check 11 | end ifdef 12 | 13 | include mode.e 14 | set_mode( "interpret", 0 ) 15 | 16 | -- standard Euphoria includes 17 | include std/error.e 18 | include std/wildcard.e 19 | 20 | include global.e 21 | include reswords.e 22 | include keylist.e 23 | include c_out.e -- Translator output (leave in for now) 24 | include symtab.e 25 | include scanner.e 26 | include emit.e 27 | include parser.e 28 | include intinit.e 29 | 30 | -- INTERPRETER C-backend interface: 31 | include compress.e 32 | include backend.e 33 | 34 | global procedure OutputIL() 35 | -- dummy routine 36 | end procedure 37 | 38 | -- main program: 39 | include main.e 40 | -------------------------------------------------------------------------------- /source/eui.rc: -------------------------------------------------------------------------------- 1 | #define VER_PRODUCT_NAME "eui console\0" 2 | #define VER_FILE_DESCRIPTION "Euphoria Interpreter (Console)\0" 3 | #define VER_ORIGINAL_FILENAME "eui.exe\0" 4 | 5 | #include "version_info.rc" 6 | 7 | eui ICON euphoria.ico 8 | 1 24 "eu.manifest" 9 | -------------------------------------------------------------------------------- /source/euiw.rc: -------------------------------------------------------------------------------- 1 | #define VER_PRODUCT_NAME "euiw windowed\0" 2 | #define VER_FILE_DESCRIPTION "Euphoria Interpreter (Windowed)\0" 3 | #define VER_ORIGINAL_FILENAME "euiw.exe\0" 4 | 5 | #include "version_info.rc" 6 | 7 | euiw ICON euphoria.ico 8 | 1 24 "eu.manifest" 9 | -------------------------------------------------------------------------------- /source/euphoria.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/source/euphoria.ico -------------------------------------------------------------------------------- /source/eushroud.ex: -------------------------------------------------------------------------------- 1 | #!/usr/bin/eui -i /usr/share/euphoria/source/ 2 | -- (c) Copyright - See License.txt 3 | -- 4 | -- The Shrouder 5 | -- uses the Euphoria front-end, plus a special Euphoria-coded back-end 6 | 7 | with define SHROUDER 8 | 9 | ifdef ETYPE_CHECK then 10 | with type_check 11 | elsedef 12 | without type_check 13 | end ifdef 14 | 15 | include mode.e 16 | set_mode( "bind", 0 ) 17 | 18 | -- BINDER backend: 19 | include il.e 20 | 21 | -- main program: 22 | include main.e 23 | 24 | -------------------------------------------------------------------------------- /source/intobj.dst: -------------------------------------------------------------------------------- 1 | EU_INTERPRETER_OBJECTS = & 2 | .\$(OBJDIR)\backend.obj & 3 | .\$(OBJDIR)\c_out.obj & 4 | .\$(OBJDIR)\compress.obj & 5 | .\$(OBJDIR)\cominit.obj & 6 | .\$(OBJDIR)\intinit.obj & 7 | .\$(OBJDIR)\sort.obj & 8 | .\$(OBJDIR)\wildcard.obj & 9 | .\$(OBJDIR)\sequence.obj & 10 | .\$(OBJDIR)\text.obj & 11 | .\$(OBJDIR)\tranplat.obj & 12 | .\$(OBJDIR)\types.obj & 13 | .\$(OBJDIR)\dll.obj & 14 | .\$(OBJDIR)\filesys.obj & 15 | .\$(OBJDIR)\get.obj & 16 | .\$(OBJDIR)\search.obj & 17 | .\$(OBJDIR)\main-.obj & 18 | .\$(OBJDIR)\main-0.obj & 19 | .\$(OBJDIR)\convert.obj & 20 | .\$(OBJDIR)\pathopen.obj & 21 | .\$(OBJDIR)\init-.obj & 22 | .\$(OBJDIR)\error.obj & 23 | .\$(OBJDIR)\mode.obj & 24 | .\$(OBJDIR)\symtab.obj & 25 | .\$(OBJDIR)\symtab_0.obj & 26 | .\$(OBJDIR)\symtab_1.obj & 27 | .\$(OBJDIR)\scanner.obj & 28 | .\$(OBJDIR)\scinot.obj & 29 | .\$(OBJDIR)\scanne_0.obj & 30 | .\$(OBJDIR)\scanne_1.obj & 31 | .\$(OBJDIR)\main.obj & 32 | .\$(OBJDIR)\emit.obj & 33 | .\$(OBJDIR)\emit_0.obj & 34 | .\$(OBJDIR)\emit_1.obj & 35 | .\$(OBJDIR)\parser.obj & 36 | .\$(OBJDIR)\parser_0.obj & 37 | .\$(OBJDIR)\parser_1.obj & 38 | .\$(OBJDIR)\parser_2.obj & 39 | .\$(OBJDIR)\parser_3.obj & 40 | .\$(OBJDIR)\parser_4.obj & 41 | .\$(OBJDIR)\fwdref.obj 42 | 43 | -------------------------------------------------------------------------------- /source/pcre/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for PCRE to be included into Euphoria 3 | # 4 | 5 | CFLAGS=-O3 $(EOSTYPE) -D HAVE_CONFIG_H -D NO_RECURSE $(MSIZE) $(EOSFLAGS) $(FPIC) 6 | 7 | include objects.mak 8 | include $(CONFIG) 9 | 10 | PREFIXED_PCRE_OBJECTS = $(addprefix $(BUILDDIR)/pcre$(FPIC)/,$(PCRE_OBJECTS)) 11 | 12 | all: $(BUILDDIR)/pcre$(FPIC) config.h pcre.h $(PREFIXED_PCRE_OBJECTS) 13 | 14 | $(BUILDDIR)/pcre$(FPIC) : 15 | -mkdir $(BUILDDIR)/pcre$(FPIC) 16 | 17 | $(PREFIXED_PCRE_OBJECTS) : $(patsubst %.o,%.c,$(PCRE_OBJECTS)) 18 | $(PCRE_CC) $(CFLAGS) -c $(patsubst $(BUILDDIR)/pcre$(FPIC)/%,%,$*).c -o $*.o 19 | 20 | .PHONY: clean distclean 21 | 22 | distclean : clean 23 | 24 | 25 | clean: 26 | rm -f $(PREFIXED_PCRE_OBJECTS) 27 | -------------------------------------------------------------------------------- /source/pcre/Makefile.wat: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for PCRE to be included into Euphoria 3 | # 4 | 5 | CC = wcc386 6 | 7 | BASEPATH=$(BUILDDIR)\pcre 8 | 9 | !include $(CONFIG) 10 | !include objects.wat 11 | !ifeq DEBUG 1 12 | PCREDEBUG=/d2 13 | !endif 14 | 15 | all: $(BASEPATH) $(PCRE_OBJECTS) 16 | 17 | # I wanted to put $(BASEPATH) here as a dependency for .c files but 18 | # watcom doesn't provide that functionality in inplicit rules... (sigh) 19 | .c.obj : .AUTODEPEND 20 | wcc386 $(EOSTYPE) /zp4 /w0 /5r /ol $(PCREDEBUG) -zq -oaxt -DHAVE_CONFIG_H -DNO_RECURSE $< -fo=$@ 21 | 22 | $(BASEPATH) : .EXISTSONLY $(BUILDDIR) 23 | mkdir $(BASEPATH) 24 | -------------------------------------------------------------------------------- /source/pcre/config.h: -------------------------------------------------------------------------------- 1 | #if defined(_WIN32) || defined(EDOS) 2 | # include "config.h.windows" 3 | #else 4 | # if defined(__unix) 5 | # include "config.h.unix" 6 | # else 7 | # error ** 8 | # error ** No OS set! 9 | # error ** Please run configure and make utilities 10 | # error ** from this directory s parent 11 | # error ** 12 | # endif 13 | #endif 14 | 15 | #undef DEBUG 16 | -------------------------------------------------------------------------------- /source/pcre/objects.mak: -------------------------------------------------------------------------------- 1 | PCRE_OBJECTS=pcre_chartables.o pcre_compile.o pcre_config.o pcre_dfa_exec.o pcre_exec.o \ 2 | pcre_fullinfo.o pcre_get.o pcre_globals.o pcre_maketables.o pcre_newline.o \ 3 | pcre_ord2utf8.o pcreposix.o pcre_refcount.o pcre_study.o pcre_tables.o \ 4 | pcre_ucd.o pcre_valid_utf8.o pcre_version.o pcre_xclass.o 5 | -------------------------------------------------------------------------------- /source/pcre/objects.wat: -------------------------------------------------------------------------------- 1 | 2 | PCRE_OBJECTS=$(BASEPATH)\pcre_chartables.obj $(BASEPATH)\pcre_compile.obj $(BASEPATH)\pcre_config.obj $(BASEPATH)\pcre_dfa_exec.obj $(BASEPATH)\pcre_exec.obj & 3 | $(BASEPATH)\pcre_fullinfo.obj $(BASEPATH)\pcre_get.obj $(BASEPATH)\pcre_globals.obj $(BASEPATH)\pcre_info.obj $(BASEPATH)\pcre_maketables.obj $(BASEPATH)\pcre_newline.obj & 4 | $(BASEPATH)\pcre_ord2utf8.obj $(BASEPATH)\pcreposix.obj $(BASEPATH)\pcre_refcount.obj $(BASEPATH)\pcre_study.obj $(BASEPATH)\pcre_tables.obj & 5 | $(BASEPATH)\pcre_try_flipped.obj $(BASEPATH)\pcre_ucd.obj $(BASEPATH)\pcre_valid_utf8.obj $(BASEPATH)\pcre_version.obj $(BASEPATH)\pcre_xclass.obj 6 | -------------------------------------------------------------------------------- /source/pcre/pcre.h: -------------------------------------------------------------------------------- 1 | #if defined(_WIN32) || defined(EDOS) 2 | # include "pcre.h.windows" 3 | #else 4 | # if defined(__unix) 5 | # include "pcre.h.unix" 6 | # else 7 | # error ** 8 | # error ** No OS set! 9 | # error ** Please run configure and make utilities 10 | # error ** from this directory s parent 11 | # error ** 12 | # endif 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /source/repl.ex: -------------------------------------------------------------------------------- 1 | with trace 2 | -- (c) Copyright - See License.txt 3 | -- 4 | -- A Read-Eval-Print-Loop Euphoria Interpreter written 100% in Euphoria 5 | -- 6 | -- usage: 7 | -- eui repl.ex 8 | 9 | with define EU_EX 10 | 11 | ifdef ETYPE_CHECK then 12 | with type_check 13 | elsedef 14 | without type_check 15 | end ifdef 16 | 17 | include mode.e 18 | set_mode( "interpret", 1 ) 19 | 20 | -- standard Euphoria includes 21 | include std/os.e 22 | include std/pretty.e 23 | include std/wildcard.e 24 | 25 | -- INTERPRETER front-end 26 | include global.e 27 | repl = 1 -- activate REPL mode 28 | include reswords.e 29 | include std/error.e 30 | include keylist.e 31 | 32 | include c_out.e -- Translator output (leave in for now) 33 | 34 | include symtab.e 35 | include scanner.e 36 | include emit.e 37 | include parser.e 38 | 39 | -- INTERPRETER back-end, written in Euphoria 40 | include execute.e 41 | 42 | -- main program: 43 | include main.e 44 | -------------------------------------------------------------------------------- /source/return15.c: -------------------------------------------------------------------------------- 1 | int main() { 2 | return 15; 3 | } 4 | -------------------------------------------------------------------------------- /source/std.ex: -------------------------------------------------------------------------------- 1 | -- (c) Copyright - See License.txt 2 | -- std.ex: Tool for helping with standard library migration. 3 | -- 4 | -- Useful for finding where symbols may have changed from 5 | -- global to export. This tool can help with other libraries, 6 | -- too. In each file, a special include file "euphoria/stddebug.e" 7 | -- is added. This includes all of the standard library functionality, 8 | -- but none of the symbols are exported. The parser looks 9 | -- for matching export symbols that wouldn't normally be 10 | -- visible to the code, and if that's the only option, 11 | -- it will issue a warning indicating which file needs 12 | -- to be included. 13 | -- 14 | -- No code is executed. This tool exists simply to parse and 15 | -- identify missing include statements. 16 | 17 | with define STDDEBUG 18 | include eui.ex 19 | 20 | -------------------------------------------------------------------------------- /source/version.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H_ 2 | 3 | /* The following files all must be 4 | * changed when changing the patch version, 5 | * minor version or major version: 6 | * 1. /source/version_info.rc 7 | * 2. /packaging/win32/euphoria.iss 8 | * 3. /packaging/win32/euphoria-ow.iss 9 | * 4. /tests/t_condcmp.e 10 | * 5. /source/version.h 11 | * 6. /docs/refman_2.txt (Euphoria Version Definitions) 12 | * 7. /docs/release/ (Release notes) 13 | * 8. /docs/manual.af (add release notes) 14 | */ 15 | 16 | #define MAJ_VER 4 17 | #define MIN_VER 2 18 | #define PAT_VER 0 19 | 20 | #ifndef EREL_TYPE 21 | # define REL_TYPE "development" 22 | #else 23 | # if EREL_TYPE == 1 24 | # define REL_TYPE "" 25 | # else 26 | # define XSTR( S ) STR( S ) 27 | # define STR( S ) #S 28 | # define REL_TYPE XSTR( EREL_TYPE ) 29 | # endif 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /source/version_info.rc: -------------------------------------------------------------------------------- 1 | 1 VERSIONINFO 2 | FILEVERSION 4,2,0,10 3 | PRODUCTVERSION 4,2,0,10 4 | FILEFLAGSMASK 0x3fL 5 | FILEFLAGS 0x0L 6 | FILEOS 0x4L 7 | FILETYPE 0x1L 8 | FILESUBTYPE 0x0L 9 | BEGIN 10 | BLOCK "StringFileInfo" 11 | BEGIN 12 | BLOCK "040904B0" 13 | BEGIN 14 | VALUE "Comments", "http://openeuphoria.org\0" 15 | VALUE "CompanyName", "OpenEuphoria Group\0" 16 | VALUE "FileDescription", VER_FILE_DESCRIPTION 17 | VALUE "FileVersion", "4.2.0\0" 18 | VALUE "InternalName", VER_ORIGINAL_FILENAME 19 | VALUE "LegalCopyright", "Copyright (c) 2022 by OpenEuphoria Group\0" 20 | VALUE "LegalTrademarks1", "\0" 21 | VALUE "LegalTrademarks2", "\0" 22 | VALUE "OriginalFilename", VER_ORIGINAL_FILENAME 23 | VALUE "ProductName", VER_PRODUCT_NAME 24 | VALUE "ProductVersion", "4.2.0\0" 25 | END 26 | END 27 | BLOCK "VarFileInfo" 28 | BEGIN 29 | VALUE "Translation", 0x409, 1200 30 | END 31 | END 32 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | t_got_different_string.html 2 | ctc.log 3 | lib818.dll 4 | unittest.log 5 | warnings_issued.txt 6 | ecp.dat 7 | foo.map 8 | test.err 9 | publicized_from_memory.txt 10 | publicized_from_safe.txt 11 | t_abadcase.log 12 | serialize.dat 13 | exported_from_memory.txt 14 | exported_from_safe.txt 15 | eds-dump.txt 16 | version.txt 17 | -------------------------------------------------------------------------------- /tests/.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | **control.err = native 3 | -------------------------------------------------------------------------------- /tests/1832f4e71028: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/1832f4e71028 -------------------------------------------------------------------------------- /tests/311/t_311_dll.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | include dll.e 4 | 5 | test_pass("std/dll.e parses correctly") 6 | constant files = { "nonamedll.dll", "user32.dll", "libc.so", "libc.so.1", "libc.so.2", 7 | "libc.so.3", "libc.so.4", "libc.so.5", "libc.so.6", "libc.so.7", "libc.so.8", "libc.dylib" } 8 | atom fh = 0 9 | for i = 1 to length( files ) do 10 | fh = open_dll( files[i] ) 11 | if fh then 12 | exit 13 | end if 14 | end for 15 | test_true("open_dll", not fh = 0) 16 | 17 | test_report() 18 | -------------------------------------------------------------------------------- /tests/311/t_311_graphics.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | include graphics.e 4 | 5 | text_color( 15 ) 6 | bk_color( 0 ) 7 | text_color( 7 ) 8 | 9 | cursor( NO_CURSOR ) 10 | cursor( UNDERLINE_CURSOR ) 11 | 12 | graphics_mode( 0 ) 13 | wrap( 1 ) 14 | wrap( 0 ) 15 | 16 | sequence pos = get_position() 17 | test_equal( "get_position", 2, length( pos ) ) 18 | 19 | integer rows = text_rows( 25 ) 20 | text_rows( rows ) 21 | 22 | scroll( 1, 3, 6 ) 23 | 24 | test_report() 25 | -------------------------------------------------------------------------------- /tests/311/t_311_image.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/filesys.e 3 | 4 | include image.e 5 | 6 | sequence palette = { {1,1,1} } 7 | sequence image = { 8 | { 1, 0, 1, 0 }, 9 | { 0, 1, 0, 1 } 10 | } 11 | 12 | procedure test_bmp( integer i, sequence p, sequence img ) 13 | test_equal( sprintf("save bitmap %d", i), BMP_SUCCESS, save_bitmap( { p, img }, "test.bmp" ) ) 14 | test_true( sprintf( "read bitmap sequence %d", i ), sequence( read_bitmap("test.bmp") ) ) 15 | delete_file( "test.bmp" ) 16 | end procedure 17 | 18 | delete_file( "test.bmp" ) 19 | -- test the various palette sizes... 20 | for i = 1 to 7 do 21 | palette &= palette + 1 22 | if find( length(palette), { 2, 4, 16, 256} ) then 23 | test_bmp( i, palette, image ) 24 | end if 25 | end for 26 | 27 | 28 | test_equal( "no bmp file", BMP_OPEN_FAILED, read_bitmap("not a real file" ) ) 29 | 30 | 31 | -- doesn't truly test, but at least makes sure it's not completely broken: 32 | sequence img = save_text_image( {1,1}, {3, 50}) 33 | display_text_image( {24,2}, img ) 34 | test_pass( "save / display text image" ) 35 | 36 | 37 | test_report() 38 | -------------------------------------------------------------------------------- /tests/311/t_311_misc.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/io.e 3 | include std/filesys.e 4 | 5 | include misc.e 6 | 7 | test_not_equal( "instance != 0", 0, instance() ) 8 | 9 | sleep(0) 10 | test_pass("sleep(0)") 11 | 12 | test_equal( "reverse", {1,2,3}, reverse( {3,2,1} ) ) 13 | 14 | test_equal("sprint() integer", "10", sprint(10) ) 15 | test_equal("sprint() float", "5.5", sprint(5.5)) 16 | test_equal("sprint() sequence #1", "{1,{2},3,{}}", sprint({1,{2},3,{}})) 17 | test_equal("sprint() sequence #2", "{97,98,99}", sprint("abc")) 18 | 19 | test_equal("arccos", 0, arccos(1.0) ) 20 | test_equal("arcsin", repeat(PI / 2.0, 2), arcsin( repeat( 1.0, 2) ) ) 21 | 22 | integer fn = open( "pp.txt", "w" ) 23 | pretty_print( fn, {1, 2.5, "abc"}, {} ) 24 | pretty_print( fn, repeat( 0, 10), {3,0,1,10,"%g","%f",32,127,5} ) 25 | pretty_print( fn, "a\n\t\r\"b" & 5, {3,0,1,10,"%g","%f",32,127,500} ) 26 | close(fn) 27 | 28 | constant PP_VAL = ` 29 | { 30 | 1, 31 | 2.5, 32 | {97'a',98'b',99'c'} 33 | }{0,0, 34 | 0,0,0, 35 | 0,0,0, 36 | 0,0}{'a', 37 | '\n', 38 | '\t', 39 | '\r', 40 | '"','b', 41 | 5} 42 | ` 43 | 44 | test_equal( "pretty print", PP_VAL, read_file( "pp.txt" ) ) 45 | 46 | delete_file("pp.txt") 47 | 48 | test_report() 49 | -------------------------------------------------------------------------------- /tests/311/t_311_wildcard.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | include wildcard.e 4 | 5 | test_equal("lower() zero", 0, lower(0)) 6 | test_equal("lower() atom", 'a', lower('A')) 7 | test_equal("lower() letters only", "john", lower("JoHN")) 8 | test_equal("lower() mixed text", "john 55 &%.", lower("JoHN 55 &%.")) 9 | test_equal("lower() with \\0", "abc\0def", lower("abc" & 0 & "DEF")) 10 | test_equal("lower() nested", {'a', "bcd", 'e', "fg"}, lower({'A', "BcD", 'e', "fG"})) 11 | 12 | test_equal("upper() atom", 'A', upper('a')) 13 | test_equal("upper() letters only", "JOHN", upper("joHn")) 14 | test_equal("upper() mixed text", "JOHN 50 &%.", upper("joHn 50 &%.")) 15 | test_equal("upper() with \\0", "ABC\0DEF", upper("abc" & 0 & "DEF")) 16 | 17 | test_equal("wildcard_file()", 1, wildcard_file("AB*CD.?", "AB123CD.e")) 18 | test_equal("wildcard_file()", 1, wildcard_file("foo", "foo")) 19 | test_equal("wildcard_file()", 0, wildcard_file("AB*CD.?", "abcd.ex")) 20 | 21 | test_true("wildcard match *", wildcard_match( "*", "foo" ) ) 22 | test_true("wildcard match *o*", wildcard_match( "*o*", "foo" ) ) 23 | test_true("wildcard match *o?", wildcard_match( "*o?", "foo" ) ) 24 | test_false("wildcard match *ox", wildcard_match( "*ox", "foo" ) ) 25 | test_false("wildcard match ??", wildcard_match( "??", "f" ) ) 26 | test_false("wildcard match *?z", wildcard_match( "??", "foo" ) ) 27 | 28 | test_report() 29 | -------------------------------------------------------------------------------- /tests/311/t_c_311_safe_badpoke.d/control.err: -------------------------------------------------------------------------------- 1 | safe.e:212 in procedure die() 2 | attempt to divide by 0 3 | -------------------------------------------------------------------------------- /tests/311/t_c_311_safe_badpoke.e: -------------------------------------------------------------------------------- 1 | 2 | include std/unittest.e 3 | include safe.e 4 | 5 | edges_only = 0 6 | 7 | 8 | atom addr 9 | addr = #DEADBEEF 10 | poke(addr,"Hello") 11 | 12 | test_pass("Should not be able to register a non-extrnal block of memory.") 13 | -------------------------------------------------------------------------------- /tests/311/t_c_311_safe_leading_border.d/control.err: -------------------------------------------------------------------------------- 1 | safe.e:212 in procedure die() 2 | attempt to divide by 0 3 | -------------------------------------------------------------------------------- /tests/311/t_c_311_safe_leading_border.e: -------------------------------------------------------------------------------- 1 | 2 | include std/unittest.e 3 | 4 | include safe.e 5 | 6 | atom addr = allocate( 4 ) 7 | eu:poke( addr - 1, 0 ) 8 | free( addr ) 9 | 10 | test_report() 11 | -------------------------------------------------------------------------------- /tests/893.map: -------------------------------------------------------------------------------- 1 | ":=" = "assignment" 2 | "==" = "comparison" 3 | ",$" = "placeholder" 4 | ", $" = "erroneous - no spaces" 5 | "--" = "comment ---- to end of line" 6 | -------------------------------------------------------------------------------- /tests/bar_default.e: -------------------------------------------------------------------------------- 1 | -- bar_default.e 2 | -- For testing default namespaces 3 | 4 | global function test() 5 | return "bar" 6 | end function 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/bar_export.e: -------------------------------------------------------------------------------- 1 | 2 | public function export_test() 3 | return "bar" 4 | end function 5 | -------------------------------------------------------------------------------- /tests/baz_export.e: -------------------------------------------------------------------------------- 1 | 2 | public function baz() 3 | return "baz" 4 | end function 5 | 6 | export function baz_export() 7 | return "bax_export" 8 | end function 9 | -------------------------------------------------------------------------------- /tests/bindtest: -------------------------------------------------------------------------------- 1 | echo Binding... 2 | ../source/exu ../source/eubind.ex bindme.ex 3 | 4 | -------------------------------------------------------------------------------- /tests/bindtest.bat: -------------------------------------------------------------------------------- 1 | echo Binding using Windows... 2 | ..\source\eui.exe ..\source\eubind.ex bindme.ex 3 | echo Binding using DOS... 4 | ..\source\euid.exe ..\source\eubind.ex bindme.ex 5 | -------------------------------------------------------------------------------- /tests/branches: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/branches -------------------------------------------------------------------------------- /tests/c_fwd_init.e: -------------------------------------------------------------------------------- 1 | -- used by t_c_fwd_init.e 2 | include t_c_fwd_init.e 3 | 4 | -- should fail an init check 5 | ? x 6 | -------------------------------------------------------------------------------- /tests/c_fwd_typecheck.e: -------------------------------------------------------------------------------- 1 | -- used by t_c_fwd_typecheck.e 2 | include t_c_fwd_typecheck.e 3 | 4 | s = 1 5 | -------------------------------------------------------------------------------- /tests/case_file.e: -------------------------------------------------------------------------------- 1 | namespace CASE_FILE 2 | 3 | public enum 4 | CASE_1, 5 | CASE_2 6 | -------------------------------------------------------------------------------- /tests/def_ns.e: -------------------------------------------------------------------------------- 1 | namespace def_ns 2 | public include public_ns.e 3 | 4 | public type def_ns( object d ) 5 | return sequence( d ) 6 | end type 7 | 8 | public enum 9 | CASE_1, 10 | CASE_2 11 | -------------------------------------------------------------------------------- /tests/definenum.cfg: -------------------------------------------------------------------------------- 1 | -D TWO 2 | -------------------------------------------------------------------------------- /tests/defparam1.e: -------------------------------------------------------------------------------- 1 | -- used by t_defparms.e 2 | 3 | include defparam2.e 4 | 5 | export function defparams( integer a = DEFPARAM1, integer b = DEFPARAM2 ) 6 | return a + b 7 | end function 8 | 9 | constant DEFPARAM1 = 1 10 | -------------------------------------------------------------------------------- /tests/defparam2.e: -------------------------------------------------------------------------------- 1 | -- used by t_defparms.e 2 | 3 | export constant DEFPARAM2 = 2 4 | -------------------------------------------------------------------------------- /tests/dep3.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | -- Simple regression test for euphoria 3 callbacks and c_funcs 4 | include dll.e as dll3 5 | function eu3_callback( integer a, integer b ) 6 | return a + b 7 | end function 8 | constant 9 | eu3_stdcall_cb = dll3:call_back( routine_id("eu3_callback") ), 10 | eu3_cdecl_cb = dll3:call_back( '+' & routine_id("eu3_callback") ) 11 | constant 12 | c_eu3stdcall = dll3:define_c_func( "", eu3_stdcall_cb, { dll3:E_INTEGER, dll3:E_INTEGER }, dll3:E_INTEGER ), 13 | c_eu3cdecl = dll3:define_c_func( "", '+' & eu3_cdecl_cb, { dll3:E_INTEGER, dll3:E_INTEGER }, dll3:E_INTEGER ) 14 | 15 | test_equal( "Eu3:callback regular callback/define_c_func", 3, c_func( c_eu3stdcall, {1,2} ) ) 16 | test_equal( "Eu3:callback '+' callback/define_c_func", 3, c_func( c_eu3cdecl, {1,2} ) ) 17 | -------------------------------------------------------------------------------- /tests/eutest/t_c_bad_err_file.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | integer i1 4 | i1 = match("", "Hello World") 5 | 6 | test_fail("match with "" should fail the program.") 7 | test_report() 8 | -------------------------------------------------------------------------------- /tests/eutest/t_c_bad_err_file.e.fail: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/eutest/t_c_bad_err_file.e.fail -------------------------------------------------------------------------------- /tests/eutest/t_c_good_err_file.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | ? 1/0 4 | -------------------------------------------------------------------------------- /tests/eutest/t_c_no_err_file.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | parsing dies here 4 | -------------------------------------------------------------------------------- /tests/eutest/t_c_no_err_file.e.fail: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | parsing dies here 4 | -------------------------------------------------------------------------------- /tests/eutest/t_got_different_string.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | test_equal( "Where are men and women from", "Men are from Mars. Women are from Venus.", "Men are from Venus. Women are from Mars.") 4 | 5 | test_report() 6 | -------------------------------------------------------------------------------- /tests/eutest/t_got_different_string.e.fail: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/eutest/t_got_different_string.e.fail -------------------------------------------------------------------------------- /tests/eutest/t_test_false.e: -------------------------------------------------------------------------------- 1 | -- Has a variety of unit tests that are supposed to work and 2 | -- some are supposed to fail. 3 | 4 | include std/unittest.e 5 | 6 | test_true( "test_true that should fail", 0 ) 7 | test_true( "test_true that should suceed", 1 ) 8 | test_false( "test_false that should succeed", 0) 9 | test_false( "test_false that should fail", 1) 10 | test_equal( "test_equal that should succeed", 1, 1 ) 11 | test_equal( "test_equal that should fail", 0, 1 ) 12 | 13 | test_report() 14 | -------------------------------------------------------------------------------- /tests/eutest/t_test_false.e.fail: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/eutest/t_test_false.e.fail -------------------------------------------------------------------------------- /tests/eutest/t_test_true.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | test_true( "trivial eutest test...", 1 ) 4 | 5 | test_report() 6 | -------------------------------------------------------------------------------- /tests/foo_default.e: -------------------------------------------------------------------------------- 1 | -- foo_default.e 2 | -- For testing default namespaces 3 | namespace foo 4 | 5 | include bar_export.e 6 | 7 | global function test() 8 | return "foo" 9 | end function 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/foo_export.e: -------------------------------------------------------------------------------- 1 | include bar_export.e 2 | public include baz_export.e 3 | 4 | export function export_test() 5 | return "foo" 6 | end function 7 | 8 | public constant EXPORT_CONSTANT = "foo" 9 | -------------------------------------------------------------------------------- /tests/fwd.e: -------------------------------------------------------------------------------- 1 | -- fwd.e 2 | namespace fwdref 3 | include std/unittest.e 4 | 5 | include t_fwd.e as t_fwd 6 | include fwd2.e as fwd2 7 | 8 | export constant EXPORT_CONSTANT = 1 9 | export constant FOO = "fwd" 10 | 11 | export procedure foo2(integer a) 12 | result2 = 123 13 | end procedure 14 | 15 | public function foo3(integer a) 16 | for i = 1 to 3 do 17 | result3[i] = i 18 | end for 19 | return a + 3 20 | end function 21 | 22 | global function foo4(integer a) 23 | for i = 1 to 4 do 24 | result4[i] = i 25 | end for 26 | return a + 4 27 | end function 28 | 29 | fwd_var = 1 30 | if fwd_var = 0 then 31 | 32 | end if 33 | test_pass("emit:IsInteger check on forward reference") 34 | 35 | public procedure foo5() 36 | var2 = 3 37 | end procedure 38 | 39 | 40 | -------------------------------------------------------------------------------- /tests/fwd2.e: -------------------------------------------------------------------------------- 1 | namespace fwdref2 2 | 3 | include std/unittest.e 4 | 5 | include t_fwd.e as t_fwd 6 | include fwd.e as fwd 7 | 8 | procedure ticket684() 9 | test_equal( "qualified forward resolution when multiple matching names exist 1", t_fwd:FOO, "t_fwd" ) 10 | test_equal( "qualified forward resolution when multiple matching names exist 2", fwd:FOO, "fwd" ) 11 | end procedure 12 | ticket684() 13 | -------------------------------------------------------------------------------- /tests/fwd_constasgn.e: -------------------------------------------------------------------------------- 1 | include t_c_fwd_constasgn.e 2 | 3 | foo = 2 4 | -------------------------------------------------------------------------------- /tests/fwd_mutual1.e: -------------------------------------------------------------------------------- 1 | include fwd_mutual2.e 2 | 3 | export function foo1() 4 | return 1 5 | end function 6 | 7 | public atom fwd2 = foo2() 8 | 9 | public atom fwd_add 10 | public atom fwd_sub 11 | public atom fwd_mult 12 | public atom fwd_mult2 13 | public atom fwd_div 14 | public atom fwd_div2 15 | public sequence fwd_sub_assign 16 | 17 | public constant 18 | FWD_CASE_1 = 1, 19 | FWD_CASE_2 = {1,"2"} 20 | 21 | test_forward_case() 22 | -------------------------------------------------------------------------------- /tests/fwd_mutual2.e: -------------------------------------------------------------------------------- 1 | public include fwd_mutual1.e 2 | include std/unittest.e 3 | 4 | export function foo2() 5 | return 2 6 | end function 7 | 8 | public atom fwd1 = foo1() 9 | 10 | fwd_add = 1 11 | fwd_add = fwd_add + fwd_add 12 | 13 | fwd_sub = 1 14 | fwd_sub = fwd_sub - fwd_sub 15 | 16 | fwd_mult = 3 17 | fwd_mult = fwd_mult * 4 18 | 19 | fwd_mult2 = 2 20 | fwd_mult2 = fwd_mult2 * 2 21 | 22 | fwd_div = 18 23 | fwd_div = fwd_div / 6 24 | 25 | fwd_div2 = 4 26 | fwd_div2 = fwd_div2 / 2 27 | 28 | fwd_sub_assign = { 0 } 29 | fwd_sub_assign[1] = 1 30 | 31 | function fwd_switch( object x ) 32 | switch x with fallthru do 33 | case FWD_CASE_1 then 34 | return 1 35 | case FWD_CASE_2 then 36 | return 2 37 | case else 38 | return 0 39 | end switch 40 | end function 41 | 42 | export procedure test_forward_case() 43 | test_equal( "fwd_switch #1", 1, fwd_switch( FWD_CASE_1 ) ) 44 | test_equal( "fwd_switch #2", 2, fwd_switch( FWD_CASE_2 ) ) 45 | test_equal( "fwd_switch #3", 0, fwd_switch( 999 ) ) 46 | 47 | test_equal( "forward dollar", "2", FWD_CASE_2[$] ) 48 | end procedure 49 | 50 | -------------------------------------------------------------------------------- /tests/fwdglobal.e: -------------------------------------------------------------------------------- 1 | 2 | global type UDT( object u ) 3 | return 1 4 | end type 5 | global constant FORWARD_GLOBAL = 1, 6 | FORWARD_GLOBAL_SEQUENCE = "abcdefg" 7 | global sequence forward_global_sequence = "abcdef" 8 | 9 | ifdef EC then 10 | global object fwd_object 11 | end ifdef 12 | 13 | global function return_a_sequence() 14 | return "a_sequence" 15 | end function 16 | -------------------------------------------------------------------------------- /tests/fwdnoinc.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | test_equal( "non-include global type resolution", UDT(0), 1 ) 4 | test_equal( "non-include global constant", FORWARD_GLOBAL, 1 ) 5 | test_equal( "dollar sign on non-include global constant", 'g', FORWARD_GLOBAL_SEQUENCE[$] ) 6 | 7 | forward_global_sequence[$] = 'z' 8 | test_equal( "dollar sign assign on non-include global constant", 'z', forward_global_sequence[$] ) 9 | ifdef EC then 10 | fwd_object = 0 11 | test_equal( "non-include global variable survives translation", 0, fwd_object ) 12 | end ifdef 13 | 14 | 15 | 16 | with type_check 17 | UDT u 18 | u = 0 19 | test_pass( "forward UDT type check doesn't hang execution" ) 20 | 21 | export procedure check_unincluded_type( sloppy s ) 22 | if not sloppy(s) then 23 | puts(1,"") 24 | end if 25 | end procedure 26 | with inline 50 27 | procedure no_fwd_param_inlined( sequence o ) 28 | test_true( "no fwd param inlined", sequence(o)) 29 | end procedure 30 | no_fwd_param_inlined( FORWARD_GLOBAL_SEQUENCE ) 31 | -------------------------------------------------------------------------------- /tests/gimlet.map: -------------------------------------------------------------------------------- 1 | ":=" = "assignment" 2 | "==" = "comparison" 3 | ",$" = "placeholder" 4 | ", $" = "erroneous - no spaces" 5 | "--" = "comment" ---- to end of line 6 | -------------------------------------------------------------------------------- /tests/include_subdir/foo.e: -------------------------------------------------------------------------------- 1 | include bar.e 2 | -------------------------------------------------------------------------------- /tests/include_subdir/foo/bar.e: -------------------------------------------------------------------------------- 1 | puts(1, "Success.\n") 2 | -------------------------------------------------------------------------------- /tests/include_subdir/foo/foo.ex: -------------------------------------------------------------------------------- 1 | include ../foo.e 2 | -------------------------------------------------------------------------------- /tests/indirect.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/sort.e 3 | 4 | test_equal( "default namespace include", {1,2,3}, stdsort:sort({3,2,1}, ASCENDING ) ) 5 | test_equal( "without default namespace include", {1,2,3}, sort({3,2,1}, ASCENDING ) ) 6 | -------------------------------------------------------------------------------- /tests/indirect2.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | without indirect_includes 4 | include indirect.e 5 | include std/sort.e as srt 6 | 7 | test_equal( "reincluded global w/out indirect_includes doesn't interfere", {1,2,3}, sort({3,2,1}, ASCENDING ) ) 8 | 9 | integer 10 | qualified_rid = routine_id("srt:sort"), 11 | unqualified_rid = routine_id("sort") 12 | 13 | test_not_equal( "reincluded qualified routine id with namespace", -1, qualified_rid ) 14 | test_not_equal( "reincluded unqualified routine id with namespace", -1, unqualified_rid ) 15 | test_equal( "reincluded qualified rid = unqualified rid", qualified_rid, unqualified_rid ) 16 | 17 | test_equal( "reincluded qualified rid call_func", {3,2,1}, call_func( qualified_rid, { {2,3,1}, DESCENDING} ) ) 18 | test_equal( "reincluded unqualified rid call_func", {3,2,1}, call_func( unqualified_rid, { {2,3,1}, DESCENDING} ) ) 19 | -------------------------------------------------------------------------------- /tests/manual/makefile.wat: -------------------------------------------------------------------------------- 1 | 2 | print_platform.exe: print_platform.ex 3 | eubind -con print_platform.ex 4 | 5 | clean: 6 | del print_platform.exe 7 | 8 | .error: 9 | pause 10 | -------------------------------------------------------------------------------- /tests/manual/print_platform.ex: -------------------------------------------------------------------------------- 1 | -- Run this as with eui, or euiw, or translate with euc and it will inform you what platform 2 | -- you are using (as long as you are on Windows). However, if you bind this program it 3 | -- into an executable the executable it used to report DOS32! Now, this has been fixed 4 | -- but please check from time to time. 5 | 6 | include std/win32/msgbox.e 7 | atom ok 8 | sequence strings = { "DOS32", "WIN32" } 9 | function to_string(integer p) 10 | if p != 1 and p != 2 then 11 | return sprintf("%d", {p}) 12 | end if 13 | return strings[p] 14 | end function 15 | ok = message_box( sprintf( "platform()=%s", {to_string(platform())} ), "Information", MB_OK ) 16 | --printf(1, "platform()=%s\n", { to_string(platform()) } ) 17 | -------------------------------------------------------------------------------- /tests/obj_fwd.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include t_object.e 3 | 4 | export procedure forward_test_uninitialized() 5 | test_equal( "forward detect uninitialized integer", 0, object( integer_sym ) ) 6 | test_equal( "forward detect uninitialized atom", 0, object( atom_sym ) ) 7 | test_equal( "forward detect uninitialized sequence", 0, object( sequence_sym ) ) 8 | test_equal( "forward detect uninitialized object", 0, object( object_sym ) ) 9 | end procedure 10 | 11 | export procedure forward_test_initialized() 12 | test_equal( "forward detect initialized integer", 1, object( integer_sym ) ) 13 | test_equal( "forward detect initialized atom", 2, object( atom_sym ) ) 14 | test_equal( "forward detect initialized sequence", 3, object( sequence_sym ) ) 15 | test_true( "forward detect initialized object", object( object_sym ) ) 16 | end procedure 17 | 18 | export procedure forward_test_subscripts() 19 | test_true( "subscripted object call", object( sequence_sym[1] ) ) 20 | test_true( "subscripted twice object call", object( sequence_sym[4][1] ) ) 21 | test_true( "subscripted dollar object call", object( sequence_sym[$] ) ) 22 | test_true( "subscripted dollar and number object call", object( sequence_sym[$][1] ) ) 23 | test_true( "double subscripted dollar object call", object( sequence_sym[$][$] ) ) 24 | end procedure 25 | -------------------------------------------------------------------------------- /tests/override.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/error.e 3 | 4 | warning_file(-1) 5 | 6 | integer fn 7 | override procedure puts(integer channel,sequence text) 8 | eu:puts(fn,text) 9 | end procedure 10 | 11 | fn = open("override.txt","w") 12 | puts(fn,"This is another test") 13 | close(fn) 14 | -------------------------------------------------------------------------------- /tests/print_command_line.ex: -------------------------------------------------------------------------------- 1 | include std/io.e 2 | 3 | sequence cmds = command_line() 4 | write_lines("command_line.txt", cmds[3..$]) 5 | -------------------------------------------------------------------------------- /tests/public_ns.e: -------------------------------------------------------------------------------- 1 | namespace public_ns 2 | 3 | public function foo() 4 | return "public_ns:foo" 5 | end function 6 | -------------------------------------------------------------------------------- /tests/revisions.e: -------------------------------------------------------------------------------- 1 | public constant eu40revision = "721157c2f5ef", eu41revision = "57179171dbed" 2 | public constant eu40revision_is_tip = 1 3 | -------------------------------------------------------------------------------- /tests/routine_id.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | test_not_equal("ticket:778 translated forward rid in include file", -1, routine_id("fwd_rid_ticket_778") ) 4 | 5 | procedure fwd_rid_ticket_778() 6 | 7 | end procedure 8 | -------------------------------------------------------------------------------- /tests/runnum.ex: -------------------------------------------------------------------------------- 1 | integer val = 1 2 | ifdef TWO then 3 | val *= 2 4 | end ifdef 5 | ? val 6 | -------------------------------------------------------------------------------- /tests/scope_1.e: -------------------------------------------------------------------------------- 1 | public include scope_2.e 2 | 3 | public function public_foo() 4 | return 1 5 | end function 6 | 7 | export function export_foo() 8 | return 1 9 | end function 10 | -------------------------------------------------------------------------------- /tests/scope_2.e: -------------------------------------------------------------------------------- 1 | namespace S2 2 | 3 | public constant 4 | a = 1, 5 | b = 2 6 | 7 | public constant 8 | FOO = 1, 9 | BAR = 2, 10 | PUBLIC_CONSTANT = "public constant" 11 | 12 | public function sprintf() 13 | return 1 14 | end function 15 | -------------------------------------------------------------------------------- /tests/scope_3.e: -------------------------------------------------------------------------------- 1 | include scope_2.e 2 | -------------------------------------------------------------------------------- /tests/scope_4.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include t_scope.e 3 | 4 | test_equal("indirect public include", 1, a ) -------------------------------------------------------------------------------- /tests/scope_local_include.e: -------------------------------------------------------------------------------- 1 | procedure foo() 2 | -- blah blah 3 | end procedure 4 | -------------------------------------------------------------------------------- /tests/switch_constants.e: -------------------------------------------------------------------------------- 1 | 2 | public constant PUBLIC_CASE = 1 3 | export constant EXPORT_CASE = 2 4 | global constant GLOBAL_CASE = 3 5 | -------------------------------------------------------------------------------- /tests/t_881-1.e: -------------------------------------------------------------------------------- 1 | function foo(integer x) 2 | return and_bits(floor(x/{#40,#08,#1}), #7) 3 | end function 4 | 5 | constant b = #AA 6 | 7 | sequence s0 = foo(b) 8 | 9 | include std/unittest.e 10 | 11 | test_report() 12 | -------------------------------------------------------------------------------- /tests/t_881-2.e: -------------------------------------------------------------------------------- 1 | function foo(integer x) 2 | return and_bits(x, {#C0,#38,#7})/{#40,#08,#1} 3 | end function 4 | 5 | constant b = #AA 6 | 7 | sequence s0 = foo(b) 8 | 9 | include std/unittest.e 10 | 11 | test_report() 12 | -------------------------------------------------------------------------------- /tests/t_893.e: -------------------------------------------------------------------------------- 1 | include std/map.e 2 | include std/console.e 3 | include std/unittest.e 4 | 5 | 6 | map gimlet = load_map( "893.map" ) 7 | map foo = map:new() 8 | 9 | map:put( foo, `:=`, `assignment` ) 10 | map:put( foo, `==`, `comparison` ) 11 | map:put( foo, `,$`, `placeholder` ) 12 | map:put( foo, `, $`, `erroneous - no spaces` ) 13 | map:put( foo, `--`, `comment ---- to end of line` ) 14 | 15 | map:save_map( foo, "foo.map" ) 16 | 17 | sequence key_set = map:keys( foo ) 18 | for i = 1 to length(key_set) do 19 | sequence key = key_set[i] 20 | if map:has( gimlet, key) then 21 | test_equal( "ticket 893: " & key, map:get( foo, key ), map:get( gimlet, key ) ) 22 | else 23 | test_fail( "ticket 893: " & key ) 24 | end if 25 | end for 26 | 27 | test_report() 28 | -------------------------------------------------------------------------------- /tests/t_963.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | procedure delete_proc(integer x) 4 | test_pass(sprintf("deleting %d", {x})) 5 | end procedure 6 | 7 | constant op = delete_routine(1, routine_id("delete_proc")) 8 | 9 | switch op do 10 | case 1 then 11 | test_pass("can use delete_routined value as a value for switch") 12 | end switch 13 | 14 | switch 1 do 15 | case op then 16 | test_pass("can use delete_routined value as a case constant for switch") 17 | end switch 18 | 19 | test_report() 20 | -------------------------------------------------------------------------------- /tests/t_autoclose.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | type enum boolean 4 | FALSE=0,TRUE 5 | end type 6 | 7 | boolean cleanedup = FALSE 8 | 9 | procedure cleanup_now(object in_put) 10 | cleanedup = TRUE 11 | end procedure 12 | 13 | integer fd = open("t_autoclose.e", "r", 1) 14 | 15 | test_pass( "able to assign integers to integer with destructors" ) 16 | 17 | function wrapper() 18 | return delete_routine(4, routine_id("cleanup_now")) 19 | end function 20 | 21 | integer other = wrapper() 22 | 23 | other = 3 24 | 25 | test_equal("Cleaned up called", TRUE, cleanedup) 26 | test_report() -------------------------------------------------------------------------------- /tests/t_bitwise.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/dll.e 3 | 4 | test_equal( "and_bits 1", 1, and_bits( 1, 3 ) ) 5 | 6 | atom i1 = 1, i2 = 3 7 | test_equal( "and_bits 1", 1, and_bits( i1, i2 ) ) 8 | 9 | global function make_word( integer lo, integer hi) 10 | lo = and_bits( lo, #FF ) 11 | hi = and_bits( hi, #FF ) 12 | return hi*#100 + lo 13 | end function 14 | 15 | test_equal( "and bits in func 1", 0x101, make_word( 1, 1 ) ) 16 | 17 | i1 = and_bits( i1, 0xff ) 18 | test_equal( "and bits assign operand", 1, i1 ) 19 | 20 | i1 = 1 21 | i1 = or_bits( i1, 0xff ) 22 | test_equal( "or bits assign operand", 0xff, i1 ) 23 | 24 | i1 = 0xff 25 | i1 = xor_bits( i1, 0xff ) 26 | test_equal( "xor bits assign operand", 0, i1 ) 27 | 28 | function inline_binop( atom a, atom b ) 29 | return remainder( a, b ) + 1 30 | end function 31 | test_equal( "inlined return and_bits", 1, inline_binop( i1, i2 ) ) 32 | 33 | atom a1 34 | a1 = 0x00103070 35 | a1 = not_bits( a1 ) 36 | if sizeof( C_POINTER ) = 4 then 37 | test_equal( "not bits assign operand 1", 0xFFEFCF8F, a1 ) 38 | else 39 | test_equal( "not bits assign operand 1", 0xFFFFFFFF_FFEFCF8F, a1 ) 40 | end if 41 | 42 | a1 = not_bits( 0xFFEFCF8F ) 43 | if sizeof( C_POINTER ) = 4 then 44 | test_equal( "not bits assign operand 2", 0x00103070, a1 ) 45 | else 46 | test_equal( "not bits assign operand 2", 0xFFFFFFFF_00103070, a1 ) 47 | end if 48 | 49 | test_report() 50 | -------------------------------------------------------------------------------- /tests/t_block.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | function abc() 4 | switch 1 label "abc" do 5 | case 2 then 6 | break "abc" 7 | case 1 then 8 | break "abc" 9 | end switch 10 | return 1 11 | end function 12 | 13 | test_equal( "convert FUNC block to PROC block", 1, abc() ) 14 | 15 | integer llv = 0 16 | integer lly = 0 17 | loop label "loop label" do 18 | llv += 1 19 | 20 | if llv < 5 then 21 | continue "loop label" 22 | end if 23 | lly += 1 24 | until llv > 10 25 | end loop 26 | 27 | test_pass( "don't crash on label for loop" ) 28 | 29 | test_equal("loop worked", {7, 11}, {lly, llv}) 30 | 31 | test_report() 32 | -------------------------------------------------------------------------------- /tests/t_bugmagnet_15.e: -------------------------------------------------------------------------------- 1 | include std/math.e 2 | include std/convert.e 3 | 4 | function Bin(integer n, sequence s = "") 5 | if n > 0 then 6 | return Bin(floor(n/2),(mod(n,2) + #30) & s) 7 | end if 8 | if length(s) = 0 then 9 | return to_integer("0") 10 | end if 11 | return to_integer(s) 12 | end function 13 | 14 | include std/unittest.e 15 | 16 | test_equal("Bin(0) = '0'", "0", sprintf("%d", Bin(0))) 17 | test_equal("Bin(5) = '5'", "101", sprintf("%d", Bin(5))) 18 | test_equal("Bin(50) = '110010'", "110010", sprintf("%d", Bin(50))) 19 | test_equal("Bin(9000) = '10001100101000'", "10001100101000", sprintf("%d", Bin(9000))) 20 | 21 | test_report() 22 | -------------------------------------------------------------------------------- /tests/t_c_749.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | without inline 3 | function foo( integer baz ) 4 | return baz - 1 5 | end function 6 | 7 | procedure main() 8 | integer t 9 | while 1 with entry do 10 | printf(1, "hello t\n", t ) 11 | exit 12 | entry 13 | t = foo( t ) 14 | end while 15 | end procedure 16 | main() 17 | 18 | test_pass("ticket 749") 19 | test_report() 20 | -------------------------------------------------------------------------------- /tests/t_c_749_goto.d/control.err: -------------------------------------------------------------------------------- 1 | tests/t_c_749_goto.e:14 in procedure goto_init() 2 | variable x has not been assigned a value 3 | y = 8 4 | x = 5 | -------------------------------------------------------------------------------- /tests/t_c_749_goto.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | without inline 3 | function foo( integer baz ) 4 | return baz - 1 5 | end function 6 | 7 | procedure goto_init( integer y ) 8 | integer x 9 | if y then 10 | goto "x not initialized" 11 | end if 12 | x = 5 13 | label "x not initialized" 14 | x = foo( x ) 15 | end procedure 16 | goto_init( 8 ) 17 | 18 | test_pass("ticket 749 goto") 19 | test_report() 20 | -------------------------------------------------------------------------------- /tests/t_c_890-1.d/control.err: -------------------------------------------------------------------------------- 1 | tests/t_c_890-1.e:6 in type boolean() 2 | Expected a routine_id of a procedure. Not that of a function (bad_cleanup_routine). 3 | i1 = 4 | 5 | 6 | Public & Export & Global & Local Variables 7 | -------------------------------------------------------------------------------- /tests/t_c_890-1.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/os.e 3 | 4 | enum KEYBOARD = 0, SCREEN 5 | 6 | type enum boolean FALSE = 0, TRUE 7 | end type 8 | 9 | boolean cleaned = FALSE 10 | 11 | function bad_cleanup_routine(object x) 12 | cleaned = TRUE 13 | return 0 14 | end function 15 | 16 | function new_object_with_cleanup() 17 | return delete_routine(1, routine_id("bad_cleanup_routine")) 18 | end function 19 | 20 | integer x = new_object_with_cleanup() 21 | 22 | -- should clean up x here 23 | x = 4 24 | 25 | while x do 26 | x = x - 1 27 | end while 28 | 29 | test_pass("Able to operate with a destructor assigned to integer\n") 30 | test_true("cleanup_routine_called", cleaned) 31 | 32 | test_report() -------------------------------------------------------------------------------- /tests/t_c_890-2.d/control.err: -------------------------------------------------------------------------------- 1 | /home/leprechaun/Source/euphoria/tests/t_c_890-2.e:6 in type boolean() 2 | Expected a routine_id of a procedure which takes only one argument, not bad_cleanup_routine which takes 0. 3 | i1 = 4 | 5 | 6 | Public & Export & Global & Local Variables 7 | -------------------------------------------------------------------------------- /tests/t_c_890-2.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/os.e 3 | 4 | enum KEYBOARD = 0, SCREEN 5 | 6 | type enum boolean FALSE = 0, TRUE 7 | end type 8 | 9 | boolean cleaned = FALSE 10 | 11 | procedure bad_cleanup_routine() 12 | cleaned = TRUE 13 | end procedure 14 | 15 | function new_object_with_cleanup() 16 | return delete_routine(1, routine_id("bad_cleanup_routine")) 17 | end function 18 | 19 | integer x = new_object_with_cleanup() 20 | 21 | -- should clean up x here 22 | x = 4 23 | 24 | while x do 25 | x = x - 1 26 | end while 27 | 28 | test_pass("Able to operate with a destructor assigned to integer\n") 29 | test_true("cleanup_routine_called", cleaned) 30 | 31 | test_report() -------------------------------------------------------------------------------- /tests/t_c_890-3.d/control.err: -------------------------------------------------------------------------------- 1 | euphoria/tests/t_c_890-3.e:6 in type boolean() 2 | invalid routine id 3 | i1 = 4 | 5 | 6 | Public & Export & Global & Local Variables 7 | 8 | -------------------------------------------------------------------------------- /tests/t_c_890-3.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/os.e 3 | 4 | enum KEYBOARD = 0, SCREEN 5 | 6 | type enum boolean FALSE = 0, TRUE 7 | end type 8 | 9 | boolean cleaned = FALSE 10 | 11 | function bad_cleanup_routine(object x) 12 | cleaned = TRUE 13 | return 0 14 | end function 15 | 16 | function new_object_with_cleanup() 17 | return delete_routine(1, -5) 18 | end function 19 | 20 | integer x = new_object_with_cleanup() 21 | 22 | -- should clean up x here 23 | x = 4 24 | 25 | while x do 26 | x = x - 1 27 | end while 28 | 29 | test_pass("Able to operate with a destructor assigned to integer\n") 30 | test_true("cleanup_routine_called", cleaned) 31 | 32 | test_report() -------------------------------------------------------------------------------- /tests/t_c_948.d/control.err: -------------------------------------------------------------------------------- 1 | /home/alumno/development/modified/euphoria/bugfix/tests/t_c_948.e:2 2 | <0031>:: attempt to redefine foo. 3 | foo 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU4_1 10 | EU4_1_0 11 | CONSOLE 12 | UNIX 13 | LINUX 14 | EUI 15 | ------------------- 16 | -------------------------------------------------------------------------------- /tests/t_c_948.e: -------------------------------------------------------------------------------- 1 | enum type foo 2 | foo 3 | end type 4 | -------------------------------------------------------------------------------- /tests/t_c_atom_type.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_atom_type.e:4 2 | <0025>:: found ... reserved word ... but was expecting an identifier name 3 | atom type foo 4 | ^ 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/t_c_atom_type.e: -------------------------------------------------------------------------------- 1 | 2 | include std/unittest.e 3 | 4 | atom type foo 5 | bar 6 | end type 7 | 8 | test_fail("should not be able to declare atoms as typed enums") 9 | 10 | test_report() 11 | -------------------------------------------------------------------------------- /tests/t_c_badmachine.d/control.err: -------------------------------------------------------------------------------- 1 | std/dll.e:279 in function define_c_proc() 2 | unsupported calling convention - use '+' for CDECL 3 | lib = {} 4 | routine_name = { 5 | {43'+'}, 6 | 144846848 7 | } 8 | arg_types = {} 9 | msg (from inlined routine 'crash' at 36) = 10 | 11 | ... called from tests/t_c_badmachine.e:7 12 | 13 | 14 | Public & Export & Global & Local Variables 15 | 16 | std/memconst.e: 17 | DEP_really_works = 0 18 | use_DEP = 1 19 | FREE_RID = 1 20 | kernel_dll = 21 | -------------------------------------------------------------------------------- /tests/t_c_badmachine.e: -------------------------------------------------------------------------------- 1 | include std/machine.e 2 | include std/dll.e 3 | include std/unittest.e 4 | 5 | constant do_nothing = allocate_code( {#C2} ) -- RET instruction (but it doesn't matter anyway) 6 | 7 | constant r_proc = define_c_proc( "", { "+", do_nothing }, {} ) 8 | 9 | test_report() 10 | -------------------------------------------------------------------------------- /tests/t_c_badpoke8.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_badpoke8.e:5 2 | poke8 is limited to 64-bit numbers 3 | 4 | 5 | Public & Export & Global & Local Variables 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/t_c_badpoke8.e: -------------------------------------------------------------------------------- 1 | include std/machine.e 2 | 3 | atom ptr = allocate(8) 4 | atom value = power(2,64) 5 | poke8(ptr, value) 6 | 7 | include std/unittest.e 8 | 9 | test_fail("Should not be able to poke 2^64 with poke8") 10 | test_report() 11 | -------------------------------------------------------------------------------- /tests/t_c_constant_type.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_constant_type.e:4 2 | <0025>:: found ... reserved word ... but was expecting an identifier name 3 | constant type foo 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU400 10 | EU40000 11 | WINDOWS 12 | WIN32 13 | WIN32_CONSOLE 14 | UNITTEST 15 | CRASH 16 | EUI 17 | ------------------- 18 | -------------------------------------------------------------------------------- /tests/t_c_constant_type.e: -------------------------------------------------------------------------------- 1 | 2 | include std/unittest.e 3 | 4 | constant type foo 5 | bar 6 | end type 7 | 8 | test_fail("should not be able to declare constants as typed enums") 9 | 10 | test_report() 11 | -------------------------------------------------------------------------------- /tests/t_c_crash.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_crash.e:5 2 | This is the crash message: 10 3 | 4 | 5 | Global & Local Variables 6 | -------------------------------------------------------------------------------- /tests/t_c_crash.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | include std/error.e 4 | 5 | error:crash("This is the crash message: %d", { 10 }) 6 | 7 | test_fail("should have died with a crash message") 8 | 9 | test_report() 10 | -------------------------------------------------------------------------------- /tests/t_c_decl_redundant.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_decl_redundant.e:7 2 | <0074>:: Errors resolving the following references: 3 | 'x' (t_c_decl_redundant.e:7) has been declared more than once. 4 | in x1.e 5 | in x2.e 6 | 7 | ? x 8 | ^ 9 | 10 | 11 | --- Defined Words --- 12 | EU4 13 | EU4_0 14 | EU4_0_3 15 | WINDOWS 16 | WIN32 17 | CONSOLE 18 | EUI 19 | ------------------- 20 | -------------------------------------------------------------------------------- /tests/t_c_decl_redundant.e: -------------------------------------------------------------------------------- 1 | -- t_c_fwd_reduandant.e 2 | include std/unittest.e 3 | 4 | include x1.e 5 | include x2.e 6 | 7 | ? x 8 | test_equal( "fail forward redundancy check", 0, 1 ) 9 | test_report() 10 | -------------------------------------------------------------------------------- /tests/t_c_decl_redundant2.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_decl_redundant2.e:2 2 | <0031>:: attempt to redefine foo. 3 | integer foo 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU4_0 10 | EU4_0_3 11 | WINDOWS 12 | WIN32 13 | CONSOLE 14 | EUI 15 | ------------------- 16 | -------------------------------------------------------------------------------- /tests/t_c_decl_redundant2.e: -------------------------------------------------------------------------------- 1 | integer foo 2 | integer foo 3 | 4 | ? foo 5 | -------------------------------------------------------------------------------- /tests/t_c_deseq_func.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_deseq_func.e:10 2 | subscript value 4 is out of bounds, reading from a sequence of length 3 - in assignment to 'd' 3 | 4 | 5 | Public & Export & Global & Local Variables 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_deseq_seq.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_deseq_seq.e:4 2 | subscript value 1 is out of bounds, reading from a sequence of length 0 - in assignment to 'a' 3 | 4 | 5 | Public & Export & Global & Local Variables 6 | -------------------------------------------------------------------------------- /tests/t_c_deseq_seq.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | object a, b, c, d 4 | {a, b, c, d } = {} 5 | 6 | test_fail("shouldn't get here") 7 | test_report() 8 | -------------------------------------------------------------------------------- /tests/t_c_enum_strings.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_enum_strings.e:4 2 | type_check failure, MONDAY is {77'M',111'o',110'n',100'd',97'a',121'y'} 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/t_c_enum_strings.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | type enum weekday_names 4 | MONDAY = "Monday", 5 | TUESDAY = "Tuesday", 6 | WEDNESDAY = "Wednesday" 7 | end type 8 | 9 | test_pass("type enum strings") 10 | 11 | test_report() 12 | -------------------------------------------------------------------------------- /tests/t_c_enum_strings_sneaky.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_enum_strings_sneaky.e:4 2 | type_check failure, FLAG1 is {0,1} 3 | 4 | 5 | Public & Export & Global & Local Variables 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_enum_strings_sneaky.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | enum type w32flagsAndEx by *2 4 | FLAG1 = 0 & 1, 5 | FLAG2 = 0 & 2, 6 | FLAG3 = 0 & 4 7 | end type 8 | 9 | test_pass("t_c_enum_strings_sneaky") 10 | -------------------------------------------------------------------------------- /tests/t_c_eu_nonbuiltin.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_eu_nonbuiltin.e:3 2 | <0074>:: Errors resolving the following references: 3 | 'test_pass' (t_c_eu_nonbuiltin.e:3) is not a builtin. 4 | 5 | eu:test_pass("This should never happen") 6 | ^ 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/t_c_eu_nonbuiltin.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e as ut 2 | 3 | eu:test_pass("This should never happen") 4 | test_report() 5 | -------------------------------------------------------------------------------- /tests/t_c_fwd_constasgn.d/control.err: -------------------------------------------------------------------------------- 1 | .\fwd_constasgn.e:3 2 | <0110>:: may not change the value of a constant 3 | foo = 2 4 | ^ 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_fwd_constasgn.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | include fwd_constasgn.e 4 | 5 | export constant foo = 1 6 | 7 | test_fail( "forward assignment to a constant" ) 8 | test_report() 9 | -------------------------------------------------------------------------------- /tests/t_c_fwd_dollar_length.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_fwd_dollar_length.e:29 2 | Errors resolving the following references: 3 | t_c_fwd_dollar_length.e (29): data_result 4 | 5 | data_result[$][i] = sprintf("%s",{col_attr[i][ColumnName]}) 6 | ^ 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/t_c_fwd_enum_type.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_fwd_enum_type.e:11 2 | <0074>:: Errors resolving the following references: 3 | 'foo' (t_c_fwd_enum_type.e:11) has not been declared. 4 | 5 | THURSDAY = foo, 6 | ^ 7 | -------------------------------------------------------------------------------- /tests/t_c_fwd_enum_type.e: -------------------------------------------------------------------------------- 1 | -- foo is not a literal but it is a constant and it is an integer. It's 2 | -- a forward reference. 3 | 4 | 5 | include std/unittest.e 6 | 7 | type enum weekday 8 | MONDAY = 1, 9 | TUESDAY = 2, 10 | WEDNESDAY = 3, 11 | THURSDAY = foo, 12 | FRIDAY 13 | end type 14 | 15 | constant foo = 4 16 | 17 | test_pass("type enum fwd references") 18 | 19 | test_report() 20 | -------------------------------------------------------------------------------- /tests/t_c_fwd_init.e: -------------------------------------------------------------------------------- 1 | -- t_c_fwd_inint.e 2 | include std/unittest.e 3 | 4 | include c_fwd_init.e 5 | 6 | export atom x 7 | ifdef EC then 8 | puts(1, "die because init checks aren't done for the translator\n") 9 | end ifdef 10 | test_equal( "fail forward init check", 0, 1 ) 11 | test_report() 12 | -------------------------------------------------------------------------------- /tests/t_c_fwd_samefile.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_fwd_samefile.e:4 2 | <0074>:: Errors resolving the following references: 3 | 'x' (t_c_fwd_samefile.e:4) has not been declared. 4 | 5 | x = 1 6 | ^ 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/t_c_fwd_samefile.e: -------------------------------------------------------------------------------- 1 | -- t_c_fwd_samefile.e 2 | include std/unittest.e 3 | 4 | x = 1 5 | 6 | atom x 7 | 8 | test_equal( "fail forward ref of variable, same file", 0, 1 ) 9 | test_report() 10 | -------------------------------------------------------------------------------- /tests/t_c_fwd_typecheck.e: -------------------------------------------------------------------------------- 1 | -- t_c_fwd_typecheck.e 2 | include std/unittest.e 3 | 4 | include c_fwd_typecheck.e 5 | 6 | export sequence s 7 | 8 | ifdef EC then 9 | die a horrible death 10 | elsedef 11 | -- typechecks are turned off when translated... 12 | test_equal( "fail forward type check", 0, 1 ) 13 | end ifdef 14 | test_report() 15 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_bad.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_ifdef_bad.e:5 2 | <0075>:: Expecting 'end ifdef' to match 'ifdef' on line 4 3 | end if 4 | ^ 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_bad.e: -------------------------------------------------------------------------------- 1 | with define DEFINED 2 | include std/unittest.e 3 | 4 | ifdef DEFINED then 5 | end if 6 | end ifdef 7 | 8 | test_report() 9 | 10 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_bad2.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_ifdef_bad2.e:4 2 | <0111>:: Mismatched 'end if'. Should this be an 'end ifdef' to match 'ifdef' on line 3 3 | end if 4 | ^ 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_bad2.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | ifdef NOT_DEFINED then 4 | end if 5 | end ifdef 6 | 7 | ifdef NOT_DEF_1 then 8 | integer n=0 9 | ifdef NOT_DEF_2 then 10 | include dos_safe.e 11 | end ifdef 12 | elsedef 13 | integer n=1 14 | ifdef NOT_DEF_2 then 15 | include dos_machine.e 16 | end ifdef 17 | end ifdef 18 | 19 | test_equal("Nested ifdefs 1",1,n) 20 | test_report() 21 | 22 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_else_bad.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_ifdef_else_bad.e:6 2 | <0075>:: Expecting 'end ifdef' to match 'ifdef' on line 4 3 | end for 4 | ^ 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_else_bad.e: -------------------------------------------------------------------------------- 1 | with define DEFINED 2 | include std/unittest.e 3 | 4 | ifdef NOT_DEFINED then 5 | elsifdef DEFINED then 6 | end for 7 | elsedef 8 | end while 9 | end ifdef 10 | 11 | test_report() 12 | 13 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_no_then.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_ifdef_no_then.e:3 2 | <0082>:: expecting possibly 'then' not end of line 3 | ifdef NOT_DEFINED 4 | ^ 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_no_then.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | ifdef NOT_DEFINED 4 | ? 0 5 | end ifdef 6 | 7 | test_report() 8 | 9 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_scope.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_ifdef_scope.e:12 2 | <0132>:: Syntax error - expected to see possibly 'end', not '(' 3 | foo = foo() 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU4_0 10 | EU4_0_0 11 | UNIX 12 | LINUX 13 | UNITTEST 14 | CRASH 15 | EUI 16 | FOO 17 | ------------------- 18 | -------------------------------------------------------------------------------- /tests/t_c_ifdef_scope.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | with define FOO 4 | 5 | function foo() 6 | return 1 7 | end function 8 | 9 | function bar( object bat ) 10 | object foo = 0 11 | ifdef FOO then 12 | foo = foo() 13 | end ifdef 14 | return foo 15 | end function 16 | 17 | test_pass("fake pass...this file should fail") 18 | 19 | test_report() 20 | -------------------------------------------------------------------------------- /tests/t_c_inline_literal.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_inline_literal.e:8 2 | <0146>:: Type Check Error when inlining literal 3 | short( 0 ) 4 | ^ 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/t_c_inline_literal.e: -------------------------------------------------------------------------------- 1 | constant 2 | M_DIR = 22 3 | 4 | function short( sequence name ) 5 | return machine_func(M_DIR, name) 6 | end function 7 | 8 | short( 0 ) 9 | gets(0) 10 | -------------------------------------------------------------------------------- /tests/t_c_integer_destroys.d/control.err: -------------------------------------------------------------------------------- 1 | /home/alumno/development/modified/euphoria/bugfix/tests/t_c_integer_destroys.e:16 2 | Cannot assign value with a destructor to an integer 3 | 4 | 5 | Public & Export & Global & Local Variables 6 | 7 | /home/alumno/development/modified/euphoria/bugfix/tests/t_c_integer_destroys.e: 8 | enable_my_close = 0 9 | f_debug = 100 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/t_c_integer_destroys.e: -------------------------------------------------------------------------------- 1 | include std/error.e 2 | 3 | type enum boolean T,F=0 end type 4 | 5 | boolean enable_my_close = F 6 | 7 | procedure destroy_this_thing(atom fh) 8 | if not enable_my_close then 9 | crash("Premature destruction of thing.") 10 | else 11 | crash("Thing gets destroyed after all lines terminate") 12 | end if 13 | end procedure 14 | 15 | integer f_debug = 100 16 | f_debug = delete_routine(f_debug, routine_id("destroy_this_thing")) 17 | enable_my_close = T -------------------------------------------------------------------------------- /tests/t_c_integer_type.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_integer_type.e:4 2 | <0025>:: found ... reserved word ... but was expecting an identifier name 3 | integer type foo 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU400 10 | EU40000 11 | WINDOWS 12 | WIN32 13 | WIN32_CONSOLE 14 | UNITTEST 15 | CRASH 16 | EUI 17 | ------------------- 18 | -------------------------------------------------------------------------------- /tests/t_c_integer_type.e: -------------------------------------------------------------------------------- 1 | 2 | include std/unittest.e 3 | 4 | integer type foo 5 | bar 6 | end type 7 | 8 | test_fail("should not be able to declare integers as typed enums") 9 | 10 | test_report() 11 | -------------------------------------------------------------------------------- /tests/t_c_map_large_bad_init.d/control.err: -------------------------------------------------------------------------------- 1 | ..\include\std\map.e:723 in procedure put() 2 | Inappropriate initial operation given to map.e:put() 3 | -------------------------------------------------------------------------------- /tests/t_c_map_large_bad_init.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/map.e 3 | 4 | map the_map 5 | 6 | the_map = map:new(map:threshold() + 1) 7 | map:put(the_map, 1, 2, map:MULTIPLY) 8 | -------------------------------------------------------------------------------- /tests/t_c_map_large_bad_next.d/control.err: -------------------------------------------------------------------------------- 1 | ..\include\std\map.e:716 in procedure put() 2 | Unknown operation given to map.e:put() 3 | -------------------------------------------------------------------------------- /tests/t_c_map_large_bad_next.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/map.e 3 | 4 | map the_map 5 | constant BAD_ACTION = 0 6 | the_map = map:new(map:threshold() + 1) 7 | map:put(the_map, 1, 2, PUT) 8 | map:put(the_map, 1, 2, BAD_ACTION) 9 | -------------------------------------------------------------------------------- /tests/t_c_map_small_bad_init.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/map.e 3 | 4 | map the_map 5 | 6 | the_map = map:new(map:threshold()) 7 | map:put(the_map, 1, 2, map:DIVIDE) 8 | -------------------------------------------------------------------------------- /tests/t_c_map_small_bad_next.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/map.e 3 | 4 | map the_map 5 | constant BAD_ACTION = 0 6 | the_map = map:new(map:threshold()) 7 | map:put(the_map, 1, 2, PUT) 8 | map:put(the_map, 1, 2, BAD_ACTION) 9 | -------------------------------------------------------------------------------- /tests/t_c_ns_builtin.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_ns_builtin.e:5 2 | <0074>:: Errors resolving the following references: 3 | 'puts' (t_c_ns_builtin.e:5) was not declared in '../include/std/unittest.e' or is not visible. 4 | 5 | ut:puts( 1, "This should crash\n" ) 6 | ^ 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/t_c_ns_builtin.e: -------------------------------------------------------------------------------- 1 | -- A similar counter test file is t_c_qualpredef.e 2 | -- A similar counter test file is t_c_scope_local_include.e 3 | include std/unittest.e as ut 4 | 5 | ut:puts( 1, "This should crash\n" ) 6 | 7 | test_pass("This should never happen") 8 | test_report() 9 | -------------------------------------------------------------------------------- /tests/t_c_overflow_sci1.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_overflow_sci1.e:4 2 | <0608>:: The number specified here is too big. 3 | atom a = 1.18974e+4932 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU4_2 10 | EU4_2_0 11 | CONSOLE 12 | UNIX 13 | LINUX 14 | X86_64 15 | BITS64 16 | LONG64 17 | EUI 18 | ------------------- 19 | -------------------------------------------------------------------------------- /tests/t_c_overflow_sci1.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/error.e 3 | -- the biggest long double (scinot.e:391) 4 | atom a = 1.18974e+4932 5 | test_pass("Huge floating point notation number") 6 | test_report() 7 | -------------------------------------------------------------------------------- /tests/t_c_overflow_sci2.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_overflow_sci2.e:3 2 | <0608>:: The number specified here is too big. 3 | atom a = 1.18973e+4933 4 | ^ 5 | 6 | -------------------------------------------------------------------------------- /tests/t_c_overflow_sci2.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/error.e 3 | atom a = 1.18973e+4933 4 | test_pass("Huge floating point notation number") 5 | test_report() 6 | -------------------------------------------------------------------------------- /tests/t_c_overflow_sci3.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_overflow_sci3.e:4 2 | <0608>:: The number specified here is too big. 3 | atom a = -1.18974e+4932 4 | ^ 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_overflow_sci3.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/error.e 3 | -- bigger than the biggest long double. 4 | atom a = -1.18974e+4932 5 | test_pass("Huge floating point notation number") 6 | test_report() 7 | -------------------------------------------------------------------------------- /tests/t_c_overflow_sci4.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_overflow_sci4.e:4 2 | <0608>:: The number specified here is too big. 3 | atom a = -1.18973e+4933 4 | ^ 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_overflow_sci4.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/error.e 3 | -- bigger than the biggest double. 4 | atom a = -1.18973e+4933 5 | test_pass("Huge floating point notation number") 6 | test_report() 7 | -------------------------------------------------------------------------------- /tests/t_c_qualpredef.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_qualpredef.e:6 2 | <0074>:: Errors resolving the following references: 3 | 'puts' (t_c_qualpredef.e:6) was not declared in 't_c_qualpredef.e' or is not visible. 4 | 5 | fail:puts(1, 1) 6 | ^ 7 | 8 | 9 | --- Defined Words --- 10 | EU4 11 | EU4_0 12 | EU4_0_3 13 | WINDOWS 14 | WIN32 15 | CONSOLE 16 | EUI 17 | ------------------- 18 | -------------------------------------------------------------------------------- /tests/t_c_qualpredef.e: -------------------------------------------------------------------------------- 1 | -- A similar counter test file is t_c_ns_builtin.e 2 | -- A similar counter test file is t_c_scope_local_include.e 3 | namespace fail 4 | include std/unittest.e 5 | 6 | fail:puts(1, 1) 7 | 8 | test_fail("resolved file-qualified procedure to predefined routine") 9 | test_report() 10 | -------------------------------------------------------------------------------- /tests/t_c_safe_badpoke.d/control.err: -------------------------------------------------------------------------------- 1 | E:\EUPHORIA\include\std\safe.e:292 in procedure die() 2 | BAD POKE ADDRESS!!!! 3735928559 (#DEADBEEF) 3 | msg = {66'B',65'A',68'D',32' ',80'P',79'O',75'K',69'E',32' ',65'A',68'D', 4 | 68'D',82'R',69'E',83'S',83'S',33'!',33'!',33'!',33'!',32' ',51'3',55'7', 5 | 51'3',53'5',57'9',50'2',56'8',53'5',53'5',57'9',32' ',40'(',35'#',68'D', 6 | 69'E',65'A',68'D',66'B',69'E',69'E',70'F',41')'} 7 | i = 3 8 | 9 | -------------------------------------------------------------------------------- /tests/t_c_safe_badpoke.e: -------------------------------------------------------------------------------- 1 | with define SAFE 2 | 3 | include std/unittest.e 4 | include std/machine.e 5 | edges_only = 0 6 | 7 | 8 | atom addr 9 | addr = #DEADBEEF 10 | poke(addr,"Hello") 11 | 12 | test_pass("Should not be able to register a non-extrnal block of memory.") 13 | -------------------------------------------------------------------------------- /tests/t_c_safe_c_func_nodep.e: -------------------------------------------------------------------------------- 1 | with define SAFE 2 | include std/unittest.e 3 | include std/machine.e 4 | include std/dll.e 5 | include std/os.e 6 | 7 | 8 | constant add_code = { 9 | -- first int argument is at stack offset +4, 2nd int is at +8 10 | #8B, #44, #24, #04, -- mov eax, +4[esp] 11 | #03, #44, #24, #08, -- add eax, +8[esp] 12 | #C2, #00, #08 * platform() = WIN32 -- ret 8 -- pop 8 bytes off the stack 13 | } 14 | integer r 15 | atom code_space 16 | code_space = allocate(length(add_code)) 17 | poke(code_space,add_code) 18 | r = define_c_func("", code_space, {C_INT, C_INT}, C_INT) 19 | 20 | test_pass("Should not be able to define a c function in non-executable memory") 21 | -------------------------------------------------------------------------------- /tests/t_c_safe_free_allocate_protect.e: -------------------------------------------------------------------------------- 1 | with define SAFE 2 | 3 | include std/machine.e 4 | include std/unittest.e 5 | 6 | atom addr = allocate_protect( 4, , PAGE_READ ) 7 | free( addr ) 8 | 9 | test_report() 10 | -------------------------------------------------------------------------------- /tests/t_c_safe_leading_border.e: -------------------------------------------------------------------------------- 1 | with define SAFE 2 | 3 | include std/machine.e 4 | include std/unittest.e 5 | 6 | atom addr = allocate( 4 ) 7 | eu:poke( addr - 1, 0 ) 8 | free( addr ) 9 | 10 | test_report() 11 | -------------------------------------------------------------------------------- /tests/t_c_safe_non_extblock.e: -------------------------------------------------------------------------------- 1 | with define SAFE 2 | 3 | include std/unittest.e 4 | include std/machine.e 5 | 6 | atom read_write_memory 7 | read_write_memory = allocate(100) 8 | register_block(read_write_memory, 100, PAGE_READ_WRITE) 9 | 10 | test_pass("Should not be able to register a non-external block of memory.") 11 | 12 | -------------------------------------------------------------------------------- /tests/t_c_safe_trailing_border.e: -------------------------------------------------------------------------------- 1 | with define SAFE 2 | 3 | include std/machine.e 4 | include std/unittest.e 5 | 6 | atom addr = allocate( 4 ) 7 | eu:poke( addr + 4, 0 ) 8 | free( addr ) 9 | 10 | test_report() 11 | -------------------------------------------------------------------------------- /tests/t_c_safe_unregister_free.e: -------------------------------------------------------------------------------- 1 | with define SAFE 2 | 3 | include std/machine.e 4 | include std/unittest.e 5 | 6 | atom addr = allocate_protect( 4, , PAGE_READ ) 7 | unregister_block( addr ) 8 | free( addr ) 9 | 10 | test_report() 11 | -------------------------------------------------------------------------------- /tests/t_c_scope_local_include.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_scope_local_include.e:4 2 | <0074>:: Errors resolving the following references: 3 | 'foo' (t_c_scope_local_include.e:4) was not declared in 'scope_local_include.e' or is not visible. 4 | 5 | my_include:foo() 6 | ^ 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/t_c_scope_local_include.e: -------------------------------------------------------------------------------- 1 | -- A similar counter test file is t_c_qualpredef.e 2 | -- A similar counter test file is t_c_ns_builtin.e 3 | include "scope_local_include.e" as my_include 4 | my_include:foo() 5 | -------------------------------------------------------------------------------- /tests/t_c_sequence_type.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_sequence_type.e:4 2 | <0025>:: found ... reserved word ... but was expecting an identifier name 3 | sequence type foo 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU400 10 | EU40000 11 | WINDOWS 12 | WIN32 13 | WIN32_CONSOLE 14 | UNITTEST 15 | CRASH 16 | EUI 17 | ------------------- 18 | -------------------------------------------------------------------------------- /tests/t_c_sequence_type.e: -------------------------------------------------------------------------------- 1 | 2 | include std/unittest.e 3 | 4 | sequence type foo 5 | bar 6 | end type 7 | 8 | test_fail("should not be able to declare sequences as typed enums") 9 | 10 | test_report() 11 | -------------------------------------------------------------------------------- /tests/t_c_singularity.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_singularity.e:27 2 | math function singularity error 3 | 4 | 5 | 6 | 7 | Public & Export & Global & Local Variables 8 | 9 | -------------------------------------------------------------------------------- /tests/t_c_slice_past_end_double.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_slice_past_end_double.e:4 2 | slice upper index is less than 0 (-2147483648) - in slice/subscript #1 of 's' 3 | 4 | 5 | Global & Local Variables 6 | 7 | t_c_slice_past_end_double.e: 8 | s = {12,23,34'"'} 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/t_c_slice_past_end_double.e: -------------------------------------------------------------------------------- 1 | sequence s 2 | s = {12, 23, 34} 3 | -- this errors out as too small see the fp. comment in be_runtime.c:3412 4 | s[1..#1_0000_0000_0000_0000] += 1 5 | -------------------------------------------------------------------------------- /tests/t_c_switch_dup.d/control.err: -------------------------------------------------------------------------------- 1 | /home/matt/eu/oe/tests/t_c_switch_dup.e:9 2 | duplicate case value used in switch: D = 1 3 | case D then 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU4_1 10 | EU4_1_0 11 | CONSOLE 12 | UNIX 13 | LINUX 14 | X86_64 15 | BITS64 16 | LONG64 17 | E64 18 | EUI 19 | ------------------- 20 | -------------------------------------------------------------------------------- /tests/t_c_switch_dup.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | enum A, B 4 | enum D 5 | 6 | switch 1 do 7 | case A then 8 | test_fail("should not get here") 9 | case D then 10 | test_fail("should not get here") 11 | end switch 12 | 13 | test_fail("should not get here") 14 | test_report() 15 | -------------------------------------------------------------------------------- /tests/t_c_switch_rt_dup.d/control.err: -------------------------------------------------------------------------------- 1 | /home/matt/eu/oe/tests/t_c_switch_rt_dup.e:6 in procedure foo() 2 | duplicate values in a switch: A and D 3 | 4 | ... called from t_c_switch_rt_dup.e:16 5 | -------------------------------------------------------------------------------- /tests/t_c_switch_rt_dup.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | enum A, B 4 | 5 | procedure foo() 6 | switch 1 do 7 | case A then 8 | test_fail("should not get here") 9 | case D then 10 | test_fail("should not get here") 11 | end switch 12 | end procedure 13 | 14 | enum D 15 | 16 | foo() 17 | 18 | test_fail("should not get here") 19 | test_report() 20 | -------------------------------------------------------------------------------- /tests/t_c_type_check_atom.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_type_check_atom.e:10 2 | type_check failure, aAtom is {10,20,30} 3 | 4 | 5 | Global & Local Variables 6 | -------------------------------------------------------------------------------- /tests/t_c_type_check_atom.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | with type_check 3 | 4 | function seq() 5 | return {10,20,30} 6 | end function 7 | 8 | constant aSequence = seq() 9 | 10 | atom aAtom = aSequence 11 | 12 | test_fail("should not be able to assign a sequence to an atom") 13 | 14 | test_report() 15 | -------------------------------------------------------------------------------- /tests/t_c_type_check_atom_compile.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_type_check_atom_compile.e:9 2 | <0346>:: Type check error: assigning a sequence to an atom 3 | atom aAtom = aSequence 4 | ^ 5 | -------------------------------------------------------------------------------- /tests/t_c_type_check_atom_compile.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | with type_check 3 | 4 | constant aSequence = "" 5 | 6 | -- this should generate a compile error 7 | atom aAtom = aSequence 8 | 9 | test_fail("should not be able to assign a sequence to an atom") 10 | 11 | test_report() 12 | -------------------------------------------------------------------------------- /tests/t_c_type_check_integer.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_type_check_integer.e:10 2 | type_check failure, aInteger is {10,20,30} 3 | 4 | 5 | Global & Local Variables 6 | -------------------------------------------------------------------------------- /tests/t_c_type_check_integer.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | with type_check 3 | 4 | function seq() 5 | return {10,20,30} 6 | end function 7 | 8 | constant aSequence = seq() 9 | 10 | integer aInteger = aSequence 11 | 12 | test_fail("should not be able to assign a sequence to an integer") 13 | 14 | test_report() 15 | -------------------------------------------------------------------------------- /tests/t_c_type_check_integer2.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_type_check_integer2.e:10 2 | type_check failure, aInteger is 30.5 3 | 4 | 5 | Global & Local Variables 6 | -------------------------------------------------------------------------------- /tests/t_c_type_check_integer2.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | with type_check 3 | 4 | function atm() 5 | return 30.5 6 | end function 7 | 8 | constant aAtom = atm() 9 | 10 | integer aInteger = aAtom 11 | 12 | test_fail("should not be able to assign an atom to an integer") 13 | 14 | test_report() 15 | -------------------------------------------------------------------------------- /tests/t_c_type_check_sequence.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_type_check_sequence.e:10 2 | type_check failure, aSequence is 30.5 3 | 4 | 5 | Global & Local Variables 6 | -------------------------------------------------------------------------------- /tests/t_c_type_check_sequence.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | with type_check 3 | 4 | function atm() 5 | return 30.5 6 | end function 7 | 8 | constant aAtom = atm() 9 | 10 | sequence aSequence = aAtom 11 | 12 | test_fail("should not be able to assign an atom to a sequence") 13 | 14 | test_report() 15 | -------------------------------------------------------------------------------- /tests/t_c_udt_type.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_udt_type.e:8 2 | <0025>:: found ... reserved word ... but was expecting an identifier name 3 | blah type foo 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU400 10 | EU40000 11 | WINDOWS 12 | WIN32 13 | WIN32_CONSOLE 14 | UNITTEST 15 | CRASH 16 | EUI 17 | ------------------- 18 | -------------------------------------------------------------------------------- /tests/t_c_udt_type.e: -------------------------------------------------------------------------------- 1 | 2 | include std/unittest.e 3 | 4 | type blah( object o ) 5 | return 1 6 | end type 7 | 8 | blah type foo 9 | bar 10 | end type 11 | 12 | test_fail("should not be able to declare user defined types as typed enums") 13 | 14 | test_report() 15 | -------------------------------------------------------------------------------- /tests/t_c_underflow_sci.d/control.err: -------------------------------------------------------------------------------- 1 | t_c_underflow_sci.e:5 2 | <0607>:: The number specified here is too small. 3 | atom epsilon = 3e-4932 4 | ^ 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/t_c_underflow_sci.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | -- A very small unparsible positive value. Too small for this notation. 4 | -- Should throw an error here, warning the user the number is so small it is interpreted as zero. 5 | atom epsilon = 3e-4932 6 | 7 | -- test below for numbers really close to zero works better than test_not_equal() 8 | test_false("Number is not zero", epsilon + epsilon = epsilon) 9 | ? 1/epsilon 10 | test_pass("Tiny standard decimal notation number") 11 | test_report() 12 | test_pass("Tiny floating point notation atom") 13 | test_report() 14 | -------------------------------------------------------------------------------- /tests/t_call.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | integer gb 3 | 4 | procedure foo(integer a) 5 | gb = a 6 | end procedure 7 | 8 | function bar(integer a) 9 | return gb + a 10 | end function 11 | 12 | integer r_foo = routine_id("foo") 13 | integer r_bar = routine_id("bar") 14 | 15 | call_proc(r_foo, {5}) 16 | test_equal("procedure call", 5, gb) 17 | test_equal("function call", 15, call_func(r_bar, {10})) 18 | 19 | 20 | test_report() 21 | 22 | -------------------------------------------------------------------------------- /tests/t_de_dep.e: -------------------------------------------------------------------------------- 1 | -- same as t_dep.e but with DATA_EXECUTE defined 2 | with define DATA_EXECUTE 3 | include t_dep.e 4 | -------------------------------------------------------------------------------- /tests/t_de_math.e: -------------------------------------------------------------------------------- 1 | -- same as t_math.e but with DATA_EXECUTE defined 2 | with define DATA_EXECUTE 3 | include t_math.e 4 | -------------------------------------------------------------------------------- /tests/t_de_memory.e: -------------------------------------------------------------------------------- 1 | -- same as t_memory.e but with DATA_EXECUTE defined 2 | with define DATA_EXECUTE 3 | include t_memory.e 4 | -------------------------------------------------------------------------------- /tests/t_de_safe.e: -------------------------------------------------------------------------------- 1 | -- same as t_safe.e but with DATA_EXECUTE defined 2 | with define DATA_EXECUTE 3 | include t_safe.e 4 | -------------------------------------------------------------------------------- /tests/t_de_unsafe.e: -------------------------------------------------------------------------------- 1 | -- same as t_unsafe.e but with DATA_EXECUTE defined 2 | with define DATA_EXECUTE 3 | include t_unsafe.e 4 | -------------------------------------------------------------------------------- /tests/t_declasgn.e: -------------------------------------------------------------------------------- 1 | namespace decl 2 | constant cmd = command_line() 3 | 4 | include std/unittest.e 5 | include std/error.e 6 | 7 | with warning {short_circuit} 8 | 9 | integer n=3,n0 10 | sequence s0="Useless code" 11 | 12 | function f(sequence s="abcd") 13 | if n<0 then ?0 end if 14 | return length(s) 15 | end function 16 | 17 | if n and f()=7 then end if 18 | 19 | with warning &= {not_used, custom} 20 | 21 | function foo() 22 | integer n = decl:n + f() 23 | return n 24 | end function 25 | 26 | test_equal("Assign on declare 1",s0,"Useless code") 27 | test_equal("Assign on declare 1",n,3) 28 | test_equal("Use default params in initial value", 7, foo()) 29 | warning("Useless code") 30 | 31 | without warning &= (short_circuit) 32 | if n and f()=7 then end if 33 | 34 | ifdef EUI then 35 | warning_file("warning.lst") 36 | end ifdef 37 | integer n1 38 | procedure bar() 39 | integer nha = 2 40 | nha+=1 41 | n1=nha 42 | end procedure 43 | bar() 44 | test_equal("assign_op after assign on declare",3,n1) 45 | 46 | test_report() 47 | -------------------------------------------------------------------------------- /tests/t_dep.d/DOS32/control.err: -------------------------------------------------------------------------------- 1 | .\dep3.e:9 2 | <0005>:: call_back() is not supported in Euphoria for DOS32 3 | 4 | 5 | Global & Local Variables 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/t_deprecate.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | deprecate procedure hi() 4 | printf(1, "Hi\n", {}) 5 | end procedure 6 | 7 | test_pass("deprecate keyword assigned to a procedure") 8 | 9 | deprecate public procedure hi2() 10 | printf(1, "Hi2\n", {}) 11 | end procedure 12 | 13 | test_pass("deprecate keyword assigned to a public procedure") 14 | 15 | test_report() 16 | -------------------------------------------------------------------------------- /tests/t_dll.d/DOS32/control.err: -------------------------------------------------------------------------------- 1 | c:\euphoria\include\std/dll.e:143 in function open_dll() 2 | <0005>:: open_dll() is not supported in Euphoria for DOS32 3 | file_name = { 4 | {110'n',111'o',110'n',97'a',109'm',101'e',100'd',108'l', 5 | 108'l',46'.',100'd',108'l',108'l'}, 6 | {117'u',115's',101'e',114'r',51'3',50'2',46'.',100'd', 7 | 108'l',108'l'}, 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/t_dll.e: -------------------------------------------------------------------------------- 1 | include std/dll.e 2 | include std/unittest.e 3 | 4 | -- Tests to ensure dll.e is parsed correctly 5 | 6 | test_pass("std/dll.e parses correctly") 7 | 8 | atom fh = open_dll({ "nonamedll.dll", "user32.dll", "libc.so", "libc.so.1", "libc.so.2", 9 | "libc.so.3", "libc.so.4", "libc.so.5", "libc.so.6", "libc.so.7", "libc.so.8", "libc.dylib" }) 10 | 11 | test_true("open_dll with sequence of filenames", not fh = 0) 12 | 13 | test_report() 14 | -------------------------------------------------------------------------------- /tests/t_dup_case.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | 4 | constant HALF_DOZEN = 6 5 | constant SIX = 6 6 | 7 | switch 6 do 8 | case HALF_DOZEN, SIX then 9 | test_pass("distinct symbols of the same value are allowed") 10 | end switch 11 | 12 | test_report() 13 | -------------------------------------------------------------------------------- /tests/t_elsifdef_bad.e: -------------------------------------------------------------------------------- 1 | with define DEFINED 2 | include std/unittest.e 3 | 4 | ifdef DEFINED then 5 | elsifdef DEFINED then 6 | etohdsgfjcduofu 7 | end ifdef 8 | 9 | test_report() 10 | 11 | -------------------------------------------------------------------------------- /tests/t_enum.e: -------------------------------------------------------------------------------- 1 | include std/get.e 2 | include std/unittest.e 3 | 4 | constant ABC=20 5 | 6 | enum A,B,C 7 | enum D=-2,E,F,G 8 | enum H,I,J=20,K,L=30,M 9 | enum O=50,P,Q=0,R,S=50,T 10 | enum U=#50,V,W 11 | enum X=10,Y=X,Z=X,ZZ=ABC 12 | 13 | test_equal("enum #1", {1,2,3}, {A,B,C}) 14 | test_equal("enum #2", {-2,-1,0,1}, {D,E,F,G}) 15 | test_equal("enum #3", {1,2,20,21,30,31}, {H,I,J,K,L,M}) 16 | test_equal("enum #4", {50,51,0,1,50,51}, {O,P,Q,R,S,T}) 17 | test_equal("enum #5", {#50,#51,#52}, {U,V,W}) 18 | test_equal("enum #6", {10,10,10,20}, {X,Y,Z,ZZ}) 19 | 20 | test_report() 21 | 22 | -------------------------------------------------------------------------------- /tests/t_enum_expressions.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | enum type numbers 4 | one, 5 | two, 6 | three = two + one, 7 | four = three + one 8 | end type 9 | 10 | switch 3 do 11 | case one then 12 | puts(1, "one") 13 | case two then 14 | puts(1, "two") 15 | case three then 16 | puts(1, "three") 17 | end switch 18 | 19 | test_pass("type enum expressions") 20 | test_report() 21 | -------------------------------------------------------------------------------- /tests/t_enum_type.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | type enum weekday 3 | MONDAY = 2, 4 | TUESDAY = 1, 5 | WEDNESDAY = 3, 6 | THURSDAY = 9, 7 | FRIDAY = 5, 8 | $ 9 | end type 10 | test_equal("assigned values", {2,1,3,9,5}, {MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY}) 11 | 12 | enum type inner_planet 13 | MERCURY, 14 | VENUS, 15 | EARTH, 16 | MARS 17 | end type 18 | test_equal("derived values", {1,2,3,4}, {MERCURY, VENUS, EARTH, MARS}) 19 | 20 | weekday thisday 21 | thisday = MONDAY 22 | thisday = TUESDAY 23 | thisday = WEDNESDAY 24 | thisday = THURSDAY 25 | thisday = FRIDAY 26 | 27 | test_pass("type enum") 28 | test_true("MONDAY is a weekday", weekday(MONDAY)) 29 | test_true("THURSDAY is a weekday", weekday(THURSDAY)) 30 | test_true("FRIDAY is a weekday", weekday(FRIDAY)) 31 | test_true("MERCURY is an inner_planet", inner_planet(MERCURY)) 32 | test_true("VENUS is an inner_planet", inner_planet(VENUS)) 33 | test_true("EARTH is an inner_planet", inner_planet(EARTH)) 34 | test_true("MARS is an inner_planet", inner_planet(MARS)) 35 | 36 | test_false("8 is not a weekday", weekday(8)) 37 | 38 | test_report() 39 | -------------------------------------------------------------------------------- /tests/t_eucfg.e: -------------------------------------------------------------------------------- 1 | include std/cmdline.e 2 | include std/unittest.e 3 | include std/pipeio.e as pipe 4 | include std/get.e 5 | 6 | sequence cmd = command_line() 7 | 8 | ifdef EUI then 9 | object this_pipe = pipe:create() 10 | object ph = pipe:exec(build_commandline(cmd[1..1] & { "-c", "definenum.cfg", "runnum.ex" }),this_pipe) 11 | object read_number = pipe:read(ph[pipe:STDOUT], 256) 12 | sequence buf = value(read_number) 13 | if buf[1] = GET_SUCCESS then 14 | test_equal("Explicit Configuration files are respected.",2,buf[2]) 15 | else 16 | test_fail("Explicit Configuration files are respected") 17 | end if 18 | 19 | end ifdef 20 | test_report() 21 | -------------------------------------------------------------------------------- /tests/t_eumem.e: -------------------------------------------------------------------------------- 1 | include std/eumem.e 2 | include std/unittest.e 3 | object myspot 4 | 5 | myspot = malloc(10) 6 | 7 | test_equal("eumem allocation", 10, length(ram_space[myspot])) 8 | 9 | test_true("eumem validation", valid(myspot, 10)) 10 | 11 | free(myspot) 12 | 13 | test_false("eumem free", valid(myspot, 10)) 14 | 15 | 16 | test_report() 17 | -------------------------------------------------------------------------------- /tests/t_export_ns_type.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/map.e as m 3 | 4 | public m:map people 5 | 6 | test_pass("public map:m people") 7 | 8 | test_report() 9 | 10 | -------------------------------------------------------------------------------- /tests/t_fwd_enum_type.d/control.err: -------------------------------------------------------------------------------- 1 | t_fwd_enum_type.e:11 2 | <0331>:: Forward references are not supported for enums 3 | THURSDAY = foo, 4 | ^ 5 | 6 | 7 | --- Defined Words --- 8 | EU4 9 | EU400 10 | EU40000 11 | WINDOWS 12 | WIN32 13 | WIN32_CONSOLE 14 | EUI 15 | ------------------- 16 | -------------------------------------------------------------------------------- /tests/t_fwd_mutual1.e: -------------------------------------------------------------------------------- 1 | -- t_fwd_mutual1.e 2 | include std/unittest.e 3 | include fwd_mutual1.e 4 | include fwd_mutual2.e 5 | 6 | test_equal( "mutual inclusion 1", 1, fwd1 ) 7 | test_equal( "mutual inclusion 2", 2, fwd2 ) 8 | 9 | test_equal( "forward addition", 2, fwd_add ) 10 | test_equal( "forward subtraction", 0, fwd_sub ) 11 | test_equal( "forward multiplication", 12, fwd_mult ) 12 | test_equal( "forward multiplication by 2", 4, fwd_mult2 ) 13 | test_equal( "forward division", 3, fwd_div ) 14 | test_equal( "forward division by 2", 2, fwd_div2 ) 15 | test_equal( "forward subscript assign", {1}, fwd_sub_assign ) 16 | 17 | test_report() 18 | -------------------------------------------------------------------------------- /tests/t_fwd_mutual2.e: -------------------------------------------------------------------------------- 1 | -- t_fwd_mutual1.e 2 | include std/unittest.e 3 | include fwd_mutual2.e 4 | include fwd_mutual1.e 5 | 6 | test_equal( "mutual inclusion 1", 1, fwd1 ) 7 | test_equal( "mutual inclusion 2", 2, fwd2 ) 8 | test_report() 9 | 10 | -------------------------------------------------------------------------------- /tests/t_goto_.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/error.e 3 | 4 | warning_file(-1) 5 | integer n,m,c 6 | n = 0 7 | 8 | goto "a" 9 | n = 1 10 | label "a" 11 | 12 | test_equal("Goto skip", 0,n) 13 | 14 | m = 0 15 | label "b" 16 | if m = 9 then 17 | goto "c" 18 | end if 19 | m += 1 20 | goto "b" 21 | 22 | label "c" 23 | 24 | test_equal("Goto loop", 0,n) 25 | 26 | for i = 1 to 10 do 27 | goto "d" 28 | test_fail("Goto jump out of for loop") 29 | end for 30 | 31 | label "d" 32 | test_pass("Goto jump out of for loop") 33 | 34 | function foo( integer x ) 35 | return x * 0 36 | end function 37 | 38 | c = 1 39 | goto "e" 40 | while c = 0 do -- translator used to, but should not optimize this loop away 41 | crash("should never get to this statement") 42 | label "e" 43 | c = 2 44 | end while 45 | 46 | test_equal("Goto jump into while loop", 2,c) 47 | 48 | while c = 2 do 49 | goto "f" 50 | test_fail("Goto jump out of while loop") 51 | end while 52 | 53 | label "f" 54 | test_pass("Goto jump out of while loop") 55 | 56 | test_report() 57 | 58 | -------------------------------------------------------------------------------- /tests/t_goto_warning.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | test_equal("warning_file(-1)", -1, open("warning.lst","r")) 4 | 5 | test_report() 6 | -------------------------------------------------------------------------------- /tests/t_graphics.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/graphics.e 3 | 4 | -- TODO: add actual tests 5 | 6 | test_pass("graphics.e at least loads") 7 | 8 | test_report() 9 | -------------------------------------------------------------------------------- /tests/t_if.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | procedure ticket_666() 4 | sequence foo = "" 5 | if 0 and length( foo ) then 6 | test_fail("translated if optimization of known temp false value") 7 | end if 8 | test_pass("translated if optimization of known temp false value") 9 | end procedure 10 | ticket_666() 11 | 12 | test_report() 13 | -------------------------------------------------------------------------------- /tests/t_ifdef_const.e: -------------------------------------------------------------------------------- 1 | with define DEFINED 2 | include std/unittest.e 3 | 4 | 5 | ifdef NOT_DEFINED then 6 | constant a = 0 7 | elsifdef DEFINED then 8 | constant a = 1 9 | end ifdef 10 | 11 | ifdef DEFINED then 12 | constant b = 1 13 | elsifdef NOT_DEFINED then 14 | constant b = 0 15 | end ifdef 16 | 17 | test_equal("ifdef constant a", 1, a) 18 | test_equal("ifdef constant b", 1, b) 19 | 20 | test_report() 21 | -------------------------------------------------------------------------------- /tests/t_ifdef_proc.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | ifdef NOT_DEFINED then 4 | procedure abc() 5 | integer a 6 | a = 10 7 | end procedure 8 | 9 | procedure def() 10 | integer a 11 | a = 10 12 | end procedure 13 | elsedef 14 | procedure abc() 15 | integer a 16 | a = 10 17 | end procedure 18 | 19 | procedure def() 20 | integer a 21 | a = 10 22 | end procedure 23 | end ifdef 24 | 25 | integer n=1 26 | ifdef NOT_DEFINED then 27 | if n=1 then n=2 end if 28 | elsedef 29 | n=0 30 | end ifdef 31 | test_equal("Format of ifdef code",0,n) 32 | 33 | 34 | function recursion1( sequence x, integer level=1 ) 35 | ifdef DONT_DEFINE_FOO then 36 | return 0 37 | elsedef 38 | integer count 39 | integer foo 40 | count = 0 41 | for i = 1 to length(x) do 42 | if sequence(x[i]) then 43 | foo = recursion1( x[i], level + 1 ) 44 | end if 45 | count += 1 46 | end for 47 | return count 48 | end ifdef 49 | end function 50 | 51 | function recursion2( sequence x, integer level=1 ) 52 | integer count 53 | integer foo 54 | count = 0 55 | for i = 1 to length(x) do 56 | if sequence(x[i]) then 57 | foo = recursion1( x[i], level + 1 ) 58 | end if 59 | count += 1 60 | end for 61 | return count 62 | end function 63 | 64 | test_equal( "ifdef at beginning of function breaks recursion", recursion2({"one","two"}), recursion1({"one","two"}) ) 65 | 66 | test_report() 67 | 68 | -------------------------------------------------------------------------------- /tests/t_ifdef_switch.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | with define FOO 4 | 5 | integer foo = 0 6 | ifdef FOO then 7 | integer bar = 0 8 | for i = 1 to 3 do 9 | switch i with fallthru do 10 | case 1 then 11 | case 2 then 12 | case else 13 | bar = i 14 | end switch 15 | end for 16 | foo = 1 17 | elsedef 18 | 19 | end ifdef 20 | 21 | test_equal( "ifdef recognizes 'case else'", 1, foo ) 22 | 23 | test_report() 24 | -------------------------------------------------------------------------------- /tests/t_image.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/filesys.e 3 | 4 | include std/image.e 5 | include std/console.e 6 | 7 | sequence palette = { {1,1,1} } 8 | sequence image = { 9 | { 1, 0, 1, 0 }, 10 | { 0, 1, 0, 1 } 11 | } 12 | 13 | procedure test_bmp( integer i, sequence p, sequence img ) 14 | test_equal( sprintf("save bitmap %d", i), BMP_SUCCESS, save_bitmap( { p, img }, "test.bmp" ) ) 15 | test_true( sprintf( "read bitmap sequence %d", i ), sequence( read_bitmap("test.bmp") ) ) 16 | delete_file( "test.bmp" ) 17 | end procedure 18 | 19 | delete_file( "test.bmp" ) 20 | -- test the various palette sizes... 21 | for i = 1 to 7 do 22 | palette &= palette + 1 23 | if find( length(palette), { 2, 4, 16, 256} ) then 24 | test_bmp( i, palette, image ) 25 | end if 26 | end for 27 | 28 | 29 | test_equal( "no bmp file", BMP_OPEN_FAILED, read_bitmap("not a real file" ) ) 30 | 31 | -- doesn't truly test, but at least makes sure it's not completely broken: 32 | sequence img = save_text_image( {1,1}, {3, 50}) 33 | display_text_image( {24,2}, img ) 34 | test_pass( "save / display text image" ) 35 | 36 | test_report() 37 | -------------------------------------------------------------------------------- /tests/t_include.e: -------------------------------------------------------------------------------- 1 | 2 | include std/unittest.e 3 | 4 | without indirect_includes 5 | include std/sort.e as srt 6 | include indirect.e 7 | include indirect2.e 8 | 9 | test_equal( "global w/out indirect_includes doesn't interfere", {1,2,3}, sort({3,2,1}, ASCENDING ) ) 10 | 11 | integer 12 | qualified_rid = routine_id("srt:sort"), 13 | unqualified_rid = routine_id("sort") 14 | 15 | test_not_equal( "qualified routine id with namespace", -1, qualified_rid ) 16 | test_not_equal( "unqualified routine id with namespace", -1, unqualified_rid ) 17 | test_equal( "qualified rid = unqualified rid", qualified_rid, unqualified_rid ) 18 | 19 | test_equal( "qualified rid call_func", {3,2,1}, call_func( qualified_rid, { {2,3,1}, DESCENDING} ) ) 20 | test_equal( "unqualified rid call_func", {3,2,1}, call_func( unqualified_rid, { {2,3,1}, DESCENDING} ) ) 21 | 22 | test_report() 23 | -------------------------------------------------------------------------------- /tests/t_include_subdir.e: -------------------------------------------------------------------------------- 1 | 2 | include std/unittest.e 3 | include std/filesys.e 4 | include std/io.e 5 | include std/sequence.e 6 | 7 | chdir("include_subdir/foo") 8 | 9 | ifdef EUI then 10 | -- interpret only 11 | sequence eui = command_line() 12 | 13 | system( eui[1] & " -batch foo.ex > test.err", 2) 14 | 15 | 16 | integer success = 0 17 | integer fn = open("test.err", "r") 18 | if fn != -1 then 19 | sequence lines = flatten(read_lines(fn)) 20 | close(fn) 21 | if equal("Success.", lines) then 22 | success = 1 23 | end if 24 | end if 25 | 26 | test_true("include relying on main file path when in different subdirectory", success) 27 | 28 | end ifdef 29 | test_report() 30 | -------------------------------------------------------------------------------- /tests/t_incpath.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | test_equal( "include_paths(0) doesn't crash and returns a sequence", 1, sequence( include_paths( 0 ) ) ) 4 | test_equal( "include_paths(1) doesn't crash and returns a sequence", 1, sequence( include_paths( 1 ) ) ) 5 | 6 | test_report() 7 | -------------------------------------------------------------------------------- /tests/t_legacy_callback.e: -------------------------------------------------------------------------------- 1 | include dll.e 2 | 3 | include std/unittest.e 4 | 5 | function foo( atom a ) 6 | return a + 1 7 | end function 8 | 9 | 10 | constant 11 | FOO_RID = routine_id("foo"), 12 | FOO_DEFAULT = call_back( FOO_RID ), 13 | FOO_CDECL = call_back( '+' & FOO_RID ), 14 | CFOO_DEFAULT = define_c_func( "", FOO_DEFAULT, { C_INT }, C_INT ), 15 | CFOO_CDECL = define_c_func( "", '+' & FOO_CDECL, { C_INT }, C_INT ) 16 | 17 | test_equal( "default convention", 2, c_func( CFOO_DEFAULT, {1})) 18 | test_equal( "explicit cdecl convention", 3, c_func( CFOO_CDECL, {2})) 19 | 20 | test_report() 21 | -------------------------------------------------------------------------------- /tests/t_machine_info.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | constant M_MACHINE_INFO = 106 3 | constant machine_info = machine_func(M_MACHINE_INFO, {}) 4 | constant ARCH = 1 5 | test_true("Machine Info returns one of ARM, X86 or X86_64", 6 | find(machine_info[ARCH], {"ARM", "X86", "X86_64"})) 7 | test_report() -------------------------------------------------------------------------------- /tests/t_msgbox.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | ifdef WINDOWS then 4 | include std/win32/msgbox.e 5 | end ifdef 6 | 7 | test_pass("msgbox.e at least loads") 8 | 9 | test_report() 10 | -------------------------------------------------------------------------------- /tests/t_multiassign.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | -- Literals: 4 | object a, b 5 | 6 | {a, b} = { 1, 2 } 7 | test_equal( "a {a, b} = { 1, 2 }", a, 1 ) 8 | test_equal( "b {a, b} = { 1, 2 }", b, 2 ) 9 | 10 | {?, b} = {2, 3} 11 | test_equal( "b {?, b} = { 2, 3 }", b, 3 ) 12 | 13 | -- Swap 14 | a = 1 15 | b = 2 16 | {a, b} = {b, a} 17 | test_equal( "swap a", a, 2 ) 18 | test_equal( "swap b", b, 1 ) 19 | 20 | without inline 21 | function foo() 22 | return {1, 2, 3, 4, 5} 23 | end function 24 | 25 | {a} = foo() 26 | test_equal( "{a} = foo()", a, 1 ) 27 | 28 | {?, a, ?, b, ? } = foo() 29 | test_equal( "a {?, a, ?, b, ? } = foo()", a, 2 ) 30 | test_equal( "b {?, a, ?, b, ? } = foo()", b, 4 ) 31 | 32 | test_report() 33 | -------------------------------------------------------------------------------- /tests/t_net_http.d/DOS32/control.err: -------------------------------------------------------------------------------- 1 | F:\EUMOD\include\std/net/http.e:12 2 | http.e is not supported on the DOS platform 3 | 4 | 5 | Global & Local Variables 6 | 7 | -------------------------------------------------------------------------------- /tests/t_ns_routine_id.e: -------------------------------------------------------------------------------- 1 | -- 2 | -- This test is a bit contorted, but it was the smallest test I could come 3 | -- up with that produced the machine exception. When trying 4 | -- routine_id("t:t_upper") outside of the type function, call_func reported 5 | -- an invalid routine_id. When trying it on a non-map type, it seemed to 6 | -- work just fine also. 7 | -- 8 | namespace nsroutineid 9 | 10 | include std/unittest.e 11 | include std/map.e as map 12 | include std/types.e as t 13 | 14 | type str_key_map(object o) 15 | integer srid = routine_id("t:t_upper") 16 | return 1 17 | end type 18 | 19 | str_key_map m = map:new(10) 20 | map:put(m, "a", 1) 21 | 22 | test_pass("type check cause machine exception?") 23 | 24 | test_not_equal( "default namespace forward reference routine_id", -1, routine_id("nsroutineid:foo") ) 25 | function foo() 26 | return 1 27 | end function 28 | 29 | test_report() 30 | -------------------------------------------------------------------------------- /tests/t_os.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/os.e 3 | 4 | test_equal("getenv() #1", -1, getenv("EUTEST_EXAMPLE")) 5 | test_equal("setenv() new", 1, setenv("EUTEST_EXAMPLE", "1")) 6 | test_equal("getenv() #2", "1", getenv("EUTEST_EXAMPLE")) 7 | test_equal("setenv() overwrite", 1, setenv("EUTEST_EXAMPLE", "2")) 8 | test_equal("getenv() #3", "2", getenv("EUTEST_EXAMPLE")) 9 | test_equal("setenv() no overwrite", 1, setenv("EUTEST_EXAMPLE", "3", 0)) 10 | test_equal("getenv() #4", "2", getenv("EUTEST_EXAMPLE")) 11 | test_equal("unsetenv()", 1, unsetenv("EUTEST_EXAMPLE")) 12 | test_equal("getenv() #5", -1, getenv("EUTEST_EXAMPLE")) 13 | 14 | test_true( "get_pid()", get_pid() > 0) 15 | 16 | test_report() 17 | 18 | -------------------------------------------------------------------------------- /tests/t_override.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/error.e 3 | 4 | warning_file(-1) 5 | 6 | integer fn = open("override.txt","w") 7 | 8 | override procedure puts(integer channel,sequence text) 9 | eu:puts(fn,"This is the new puts()!\n") 10 | eu:puts(fn,text) 11 | end procedure 12 | 13 | puts(fn,"This is a test") 14 | close(fn) 15 | 16 | fn = open("override.txt","r") 17 | test_equal("Alternate version used", "This is the new puts()!\n", gets(fn)) 18 | test_equal("Task carried out", "This is a test\n", gets(fn)) 19 | close(fn) 20 | 21 | include std/filesys.e 22 | include override.e 23 | fn = open("override.txt","r") 24 | test_equal("Standard version used", "This is another test\n", gets(fn)) 25 | test_equal("Anything else?", -1, gets(fn)) 26 | close(fn) 27 | 28 | fn=delete_file("override.txt") 29 | 30 | test_report() 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tests/t_pipeio.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/pipeio.e as pipe 3 | include std/filesys.e as fs 4 | include std/sequence.e 5 | 6 | sequence list, interpreter 7 | list = command_line() 8 | ifdef not EUI then 9 | -- The tests test are here to test interpreters and libraries as we do not know where the 10 | -- interpreter is we just quit. 11 | test_report() 12 | abort(0) 13 | elsedef 14 | if compare(list[1],list[2]) != 0 then 15 | -- okay, let's trust the EC variable. 16 | interpreter = list[1] 17 | else 18 | -- It's most likely the EC variable was not defined when translating 19 | -- yet this is a translated application. 20 | interpreter = "eui" 21 | end if 22 | end ifdef 23 | 24 | object z = pipe:create() 25 | 26 | object p = pipe:exec(interpreter & " "& stdseq:join({"..","demo","pipe_sub.ex"},fs:SLASH), z) 27 | if atom(p) then 28 | test_fail("pipe:exec #1") 29 | abort(1) 30 | end if 31 | 32 | sequence message = "Hello from eutest!" 33 | integer bytes = pipe:write(p[STDIN], message & "\n") 34 | test_equal("pipe:write #1", length(message), bytes - 1) 35 | 36 | object r = pipe:read(p[STDOUT], 256) 37 | if atom(r) then 38 | test_fail("pipe:read") 39 | else 40 | test_equal("pipe:read", sprintf("pipe_sub.ex: read from STDIN: '%s'", { message }), r) 41 | end if 42 | 43 | pipe:kill(p) 44 | 45 | test_report() 46 | 47 | -------------------------------------------------------------------------------- /tests/t_recursion.e: -------------------------------------------------------------------------------- 1 | -- tail recursion tests 2 | include std/unittest.e 3 | 4 | -- The Computer Language Shootout Benchmarks 5 | -- http://shootout.alioth.debian.org/ 6 | -- 7 | -- contributed by Derek Parnell 8 | -- 9 | -- run: eui ackermann.ex [N=1] 10 | 11 | function Ack(integer M, integer N) 12 | if M = 0 then 13 | return N+1 14 | elsif N = 0 then 15 | return Ack(M-1,1) 16 | end if 17 | return Ack(M-1, Ack(M, N-1)) 18 | end function 19 | test_equal( "Ackermann 3, 2", 29, Ack(3, 2 ) ) 20 | 21 | function recursive_sequence( sequence s, integer x ) 22 | s &= x 23 | if x = 0 then 24 | return s 25 | end if 26 | 27 | x -= 1 28 | return recursive_sequence( s, x ) 29 | end function 30 | test_equal( "recursive sequence", {3,2,1,0}, recursive_sequence( {}, 3 ) ) 31 | 32 | test_report() 33 | -------------------------------------------------------------------------------- /tests/t_regex_alternation.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/regex.e as re 3 | 4 | regex Regex1 = re:new("^(a|b|c|d|e|f|g)+$") 5 | sequence TestString = "" 6 | 7 | -- Passes if for loop is 1 to 22 but begins to fail if loop is > 23 8 | -- on Jeremy's machine 9 | for i = 1 to 200 do 10 | TestString &= "abababdedfg" 11 | end for 12 | 13 | re:matches(Regex1, TestString) 14 | 15 | test_pass("regex alternation benchmark, bug #2794240") 16 | 17 | test_report() 18 | -------------------------------------------------------------------------------- /tests/t_regex_asterisk.e: -------------------------------------------------------------------------------- 1 | include std/types.e 2 | include std/regex.e as regex 3 | include std/unittest.e 4 | 5 | cstring argument_name = regex:find_replace(regex:new("\\*"), "*", "") 6 | test_pass("Can find replace a asterisk from a asterisk") 7 | test_report() -------------------------------------------------------------------------------- /tests/t_retval.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | include std/filesys.e 3 | include std/io.e 4 | include std/utils.e 5 | 6 | constant full_cl = command_line() 7 | constant test_file = full_cl[2] 8 | ifdef WINDOWS then 9 | constant ext = ".exe" 10 | elsedef 11 | constant ext = "" 12 | end ifdef 13 | constant naiive_dir = dirname(test_file) 14 | constant testfile_dir = iif( equal(naiive_dir, ""), ".", naiive_dir) 15 | constant return15_program = testfile_dir & SLASH & "return15" & ext 16 | test_true(return15_program & " was found", file_exists( return15_program ) ) 17 | constant return15exe = return15_program 18 | test_equal("Program that returns 15", 15, system_exec( return15_program, 2 )) 19 | 20 | test_report() -------------------------------------------------------------------------------- /tests/t_routine_id.e: -------------------------------------------------------------------------------- 1 | 2 | integer fwd_id = routine_id("test_equal") 3 | include std/unittest.e 4 | integer id = routine_id("test_equal") 5 | test_equal( "forward, regular routine id include", id, fwd_id ) 6 | 7 | 8 | fwd_id = routine_id("foo") 9 | 10 | procedure bar() 11 | end procedure 12 | 13 | procedure foo() 14 | end procedure 15 | 16 | id = routine_id("foo") 17 | test_equal( "forward, regular routine id same proc", id, fwd_id ) 18 | 19 | fwd_id = routine_id("baz") 20 | function baz() 21 | return 0 22 | end function 23 | id = routine_id("baz") 24 | test_equal( "forward, regular routine id same func", id, fwd_id ) 25 | 26 | without inline 27 | function retname(sequence a, sequence b) 28 | return routine_id(a & b) 29 | end function 30 | 31 | fwd_id = retname("cra", "sh") 32 | include std/error.e 33 | id = routine_id("crash") 34 | test_equal( "forward, computed routine id included", id, fwd_id ) 35 | 36 | include routine_id.e 37 | 38 | test_report() 39 | -------------------------------------------------------------------------------- /tests/t_scanner.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | test_equal("Scaning fp #1", 24, floor(10 * 2.35 + 0.5) ) 4 | 5 | /* Start of nested comment 6 | test_true("Failed level 1", 1) 7 | /* 8 | test_true("Failed level 2", 1) 9 | */ 10 | */ 11 | 12 | test_true("Success one one line", /* not /* seen */ */ 1) 13 | 14 | /* 15 | test_true("Failed eol slash", 1)/ 16 | */ 17 | 18 | /* 19 | test_true("Failed eol star", 1)* 20 | */ 21 | 22 | /* 23 | test_true("Failed many stars", 1) 24 | **/ 25 | 26 | /* 27 | test_true("Failed embedded complex", 1) 28 | ///*** ***/// 29 | */ 30 | 31 | test_report() 32 | -------------------------------------------------------------------------------- /tests/t_scope.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | 3 | include scope_3.e 4 | include scope_1.e as s1 5 | 6 | test_equal( "public include (not on initial include)", "public constant", PUBLIC_CONSTANT ) 7 | test_equal( "public include (not on initial include) using default namespace", 1, S2:sprintf() ) 8 | 9 | test_equal( "resolve to local fwd public when unqualified", 0, public_foo() ) 10 | test_equal( "resolve to local fwd export when unqualified", 0, export_foo() ) 11 | 12 | test_equal( "resolve to other fwd public when qualified", 1, s1:public_foo() ) 13 | test_equal( "resolve to other fwd export when qualified", 1, s1:export_foo() ) 14 | 15 | public function public_foo() 16 | return 0 17 | end function 18 | 19 | export function export_foo() 20 | return 0 21 | end function 22 | 23 | include scope_4.e 24 | 25 | test_report() 26 | -------------------------------------------------------------------------------- /tests/t_socket.d/DOS32/control.err: -------------------------------------------------------------------------------- 1 | F:\EUMOD\include\std/socket.e:9 2 | socket.e is not supported on the DOS platform 3 | 4 | 5 | Global & Local Variables 6 | 7 | -------------------------------------------------------------------------------- /tests/t_trace.e: -------------------------------------------------------------------------------- 1 | include std/unittest.e 2 | with trace 3 | trace(0) 4 | 5 | test_pass("trace(0)") 6 | 7 | --improve unittest.e coverage 8 | assert(1, "trace(0)") 9 | assert("trace(0)", 1) 10 | set_wait_on_summary(0) 11 | 12 | test_report() 13 | -------------------------------------------------------------------------------- /tests/t_types.e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/t_types.e -------------------------------------------------------------------------------- /tests/t_utils.e: -------------------------------------------------------------------------------- 1 | include std/utils.e 2 | include std/unittest.e 3 | 4 | test_equal("iif() false", 9, iif(0,4,9)) 5 | test_equal("iif() true", 4, iif(1,4,9)) 6 | 7 | test_equal("deprecated iff() false", 9, iff(0,4,9)) 8 | test_equal("deprecated iff() true", 4, iff(1,4,9)) 9 | 10 | test_report() 11 | 12 | -------------------------------------------------------------------------------- /tests/t_walkdir.e: -------------------------------------------------------------------------------- 1 | include std/filesys.e 2 | include std/unittest.e 3 | include std/os.e 4 | ifdef LINUX then 5 | include std/dll.e 6 | constant libc = open_dll("libc") 7 | constant c_alarm = define_c_func(libc, "alarm", {C_UINT}, C_UINT) 8 | end ifdef 9 | sequence names = {} 10 | function my_function( sequence path_name, sequence item ) 11 | names = append(names, item[D_NAME]) 12 | return 0 13 | end function 14 | 15 | -- WINDOWS doesn't allow * in filenames. 16 | ifdef not WINDOWS then 17 | create_directory("tmp") 18 | create_directory("tmp/*.*") 19 | create_directory("tmp/sue") 20 | -- wait for the fs changes to become visible here 21 | while file_exists("tmp/*.*") = 0 do 22 | sleep(0.001) 23 | end while 24 | ifdef LINUX then 25 | -- On Linux, thanks to this alarm call, 26 | -- if the next calls take more than ten seconds, 27 | -- an alarm will go off and kill this process. 28 | -- eutest will be able to continue its testing. 29 | c_func(c_alarm, {10}) 30 | end ifdef 31 | walk_dir( "tmp", routine_id( "my_function" ), 1 ) 32 | test_pass( "walkdir works with a *.* directory" ) 33 | ifdef LINUX then 34 | c_func(c_alarm, {0}) 35 | end ifdef 36 | end ifdef 37 | test_report() 38 | -------------------------------------------------------------------------------- /tests/t_warning_options.d/dependency.e: -------------------------------------------------------------------------------- 1 | integer local_boo, local_2_boo 2 | public integer p_boo 3 | foo = local_boo 4 | global function floor(integer x) 5 | return x 6 | end function 7 | 8 | -------------------------------------------------------------------------------- /tests/t_wildcard.e: -------------------------------------------------------------------------------- 1 | include std/wildcard.e 2 | include std/unittest.e 3 | 4 | test_equal("is_match()", 1, is_match("A?B*", "AQBXXYY")) 5 | test_equal("is_match()", 0, is_match("A?BZ*", "AQBXXYY")) 6 | test_equal("is_match()", 0, is_match("A*B*C", "a111b222c")) 7 | test_equal("is_match()", 1, is_match("HelloWorld*", "HelloWorld")) 8 | test_report() 9 | -------------------------------------------------------------------------------- /tests/test.lng: -------------------------------------------------------------------------------- 1 | # Example PO translation file 2 | # 3 | 4 | 5 | hello Hello 6 | world World 7 | greeting %s, %s! 8 | long_message Hello %s, & 9 | I hope you enjoy this email! 10 | 11 | # End of example PO 12 | -------------------------------------------------------------------------------- /tests/test2.lng: -------------------------------------------------------------------------------- 1 | # Example PO translation file #2 2 | # 3 | 4 | 5 | hello Hola 6 | world Mundo 7 | greeting %s, %s! 8 | 9 | help text = & 10 | This is an example of some & 11 | translation text that spans & 12 | multiple lines. 13 | 14 | # End of example PO #2 15 | -------------------------------------------------------------------------------- /tests/test_bad_map.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/test_bad_map.dat -------------------------------------------------------------------------------- /tests/test_map.txt: -------------------------------------------------------------------------------- 1 | This is a map file for testing the load_map function. 2 | 3 | -- A comment with '=' in it. 4 | foo = bar 5 | bar = foo 6 | 7 | trail=comment -- trailing comment 8 | 9 | int = 10 10 | 11 | atom = 3.4 12 | 13 | "seq" = {"one", 2, 3.4} 14 | 15 | equal = = 16 | 17 | padding = " padded " 18 | 19 | embed = \-\- -- Value contains a comment marker. 20 | -------------------------------------------------------------------------------- /tests/test_map_small.txt: -------------------------------------------------------------------------------- 1 | a=bcd 2 | -------------------------------------------------------------------------------- /tests/testlocale.edb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/testlocale.edb -------------------------------------------------------------------------------- /tests/testlocale_two.edb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/testlocale_two.edb -------------------------------------------------------------------------------- /tests/tip.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEuphoria/euphoria/fdac8fd9a58d53ac08156143ea376df06a614195/tests/tip.tar.bz2 -------------------------------------------------------------------------------- /tests/unknown_defparm.e: -------------------------------------------------------------------------------- 1 | constant something = 3 2 | 3 | public function unk_foo(object x = something) 4 | return x 5 | end function 6 | 7 | include unknown_defparm2.e as unk 8 | 9 | public function unk_foo1(object x = unk:something) 10 | return x 11 | end function 12 | 13 | -------------------------------------------------------------------------------- /tests/unknown_defparm2.e: -------------------------------------------------------------------------------- 1 | public constant something = 3 2 | 3 | public function unk_foo(object x = something) 4 | return x 5 | end function 6 | 7 | -------------------------------------------------------------------------------- /tests/use_default.e: -------------------------------------------------------------------------------- 1 | 2 | include foo_default.e 3 | 4 | export function use_default() 5 | return foo:test() 6 | end function 7 | -------------------------------------------------------------------------------- /tests/warning_code1.e: -------------------------------------------------------------------------------- 1 | global procedure puts(integer fd, sequence txt) 2 | eu:puts(fd, "*" & txt) 3 | end procedure 4 | -------------------------------------------------------------------------------- /tests/x1.e: -------------------------------------------------------------------------------- 1 | export integer x 2 | 3 | -------------------------------------------------------------------------------- /tests/x2.e: -------------------------------------------------------------------------------- 1 | export integer x 2 | 3 | -------------------------------------------------------------------------------- /tutorial/calc.ex: -------------------------------------------------------------------------------- 1 | with trace 2 | trace(1) 3 | 4 | -- Tutorial - evaluate simple expressions 5 | 6 | -- To run this tutorial, keep pressing the Enter key 7 | -- to execute the next statement, and the F1 and F2 8 | -- keys to flip between the main screen and this trace screen. 9 | 10 | -- Step 1 - We can use the question mark (?) to print 11 | -- the value of any expression on the screen. Let's 12 | -- calculate 2+2 13 | ? 2 + 2 14 | -- Press F1 then F2 to see the result printed on the screen. 15 | 16 | -- Let's try something a bit harder: 17 | ? 3 * 3 * sqrt(16) 18 | -- Press F1 then F2 to see the result (and the previous result) 19 | -- printed on the screen. 20 | 21 | -- Notice that multiply has higher precedence than addition: 22 | ? 2 * 3 + 4 * 5 23 | 24 | 25 | -------------------------------------------------------------------------------- /tutorial/celsius.ex: -------------------------------------------------------------------------------- 1 | include std/console.e -- so we can use the prompt_number() function 2 | 3 | -- Tutorial - Convert Fahrenheit to Celsius 4 | 5 | -- In this tutorial we will: 6 | -- 1. Ask the user to enter a Fahrenheit temperature 7 | -- 2. Read a number from the user 8 | -- 3. Convert the number to Celsius 9 | -- 4. Print the result on the screen 10 | 11 | -- Some variables: 12 | atom ftemp -- holds Fahrenheit temperature 13 | atom ctemp -- holds Celsius temperature 14 | 15 | -- Prompt the user to enter a number: 16 | -- We included the file "get.e", so we can use prompt_number(). 17 | ftemp = prompt_number("Enter a Fahrenheit temperature: ", {}) 18 | -- {} means the user can enter any number. 19 | -- If we said {10,20} he would have to enter a number from 10 to 20. 20 | 21 | -- Now, using the magic formula, convert it to Celsius: 22 | ctemp = 5/9 * (ftemp - 32) 23 | 24 | -- Now print the Celsius temperature: 25 | ? ctemp 26 | 27 | -- To be neat, we can print exactly 2 decimal places 28 | -- by calling printf() - formatted print 29 | printf(1, "with two decimal places: %.2f\n", ctemp) 30 | 31 | -------------------------------------------------------------------------------- /tutorial/hello.ex: -------------------------------------------------------------------------------- 1 | include std/graphics.e 2 | with trace 3 | trace(1) 4 | 5 | -- Tutorial - Print Hello World on the Screen 6 | 7 | -- To run this tutorial, 8 | -- Press Enter to execute the highlighted Euphoria statement. 9 | -- Press F1 to flip to the main output screen. 10 | -- Press F2 to flip back to this trace screen. 11 | -- Read the comments as you go. 12 | 13 | -- Step 1: Just to be neat - we'll clear the screen. 14 | -- First, press F1 then F2. 15 | -- Then press Enter: 16 | text_color(3) 17 | bk_color(7) 18 | clear_screen() 19 | -- Check again with F1/F2 - was the screen cleared? 20 | 21 | -- Step 2: Let's position the cursor at line 10, column 30 22 | position(10, 30) 23 | -- Is the cursor now at 10,30? Press F1/F2 24 | 25 | -- Step 3: Display the text: 26 | text_color(3) 27 | bk_color(15) 28 | puts(1, "Hello World") 29 | -- Is the text there? Press F1/F2 30 | 31 | text_color(7) 32 | bk_color(0) 33 | -- Step 4 Output 2 blank lines and we're done 34 | puts(1, "\n\n") 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /tutorial/seqcalc.ex: -------------------------------------------------------------------------------- 1 | with trace 2 | trace(1) 3 | 4 | -- Tutorial - Sequences 5 | 6 | -- To run this tutorial, keep pressing the Enter key 7 | -- to execute the next statement, and the F1 and F2 8 | -- keys to flip between the main screen and this trace screen. 9 | 10 | -- The most important feature of Euphoria is the "sequence". 11 | -- Once you learn how sequences work, everything else is easy. 12 | 13 | -- A sequence is just a collection of numbers, sort of like the 14 | -- "array" in other programming languages, but much more flexible. 15 | -- Here's an example of a simple sequence: 16 | -- {5, 1, 9} 17 | -- It's a collection of 3 numbers. The order is important. 18 | -- {5,1,9} is certainly *not* equivalent to {1,9,5}. 19 | 20 | -- Let's try some calculations: 21 | ? {5, 1, 9} 22 | ? {5, 1, 9} * 2 23 | ? {5, 1, 9} + {5, 1, 9} 24 | -- Euphoria lets you perform arithmetic calculations on sequences. 25 | -- The rules are fairly intuitive. You can also store a sequence 26 | -- into a variable. First you have to declare a variable that 27 | -- is allowed to hold a sequence: 28 | sequence fred 29 | 30 | fred = {5,1,9} 31 | ? fred 32 | ? fred * 2 33 | ? fred + fred 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tutorial/simple.ex: -------------------------------------------------------------------------------- 1 | -------------------------------- 2 | -- A very simple sort program -- 3 | -------------------------------- 4 | with trace -- make everything traceable 5 | trace(1) -- turn on tracing 6 | 7 | function simple_sort(sequence x) 8 | object temp 9 | for i = 1 to length(x) - 1 do 10 | for j = i + 1 to length(x) do 11 | if compare(x[j],x[i]) < 0 then 12 | -- swap x[j], x[i] 13 | temp = x[j] 14 | x[j] = x[i] 15 | x[i] = temp 16 | end if 17 | end for 18 | end for 19 | return x 20 | end function 21 | 22 | -- Hold down the Enter key and 23 | -- watch x get sorted before your eyes! 24 | ? simple_sort( {9, 10, 3, 1, 4, 5, 8, 7, 6, 2} ) 25 | --------------------------------------------------------------------------------