Permalink
Browse files

Fixed codigstd tests

  • Loading branch information...
1 parent 167abf5 commit cc0610ab4ec0c4fb214e64d37f1dea13c7d1fa8d @bluescreen10 bluescreen10 committed Dec 19, 2010
Showing with 1,058 additions and 293 deletions.
  1. +6 −1 MANIFEST
  2. +16 −3 compilers/imcc/main.c
  3. +0 −39 examples/embed/embedded_pir.c
  4. +0 −4 examples/embed/hello_world.pir
  5. +182 −88 include/parrot/api.h
  6. +8 −6 src/debug.c
  7. +228 −67 src/embed/api.c
  8. +17 −4 src/embed/embed_private.h
  9. +331 −34 src/embed/pmc.c
  10. +155 −21 src/embed/strings.c
  11. +22 −2 src/exit.c
  12. +12 −1 src/gc/api.c
  13. +12 −1 src/global_setup.c
  14. +10 −0 src/library.c
  15. +3 −0 src/longopt.c
  16. +44 −20 src/main.c
  17. +12 −2 src/pbc_disassemble.c
View
@@ -900,6 +900,7 @@ ext/nqp-rx/t/p6regex/rx_modifiers [test]
ext/nqp-rx/t/p6regex/rx_quantifiers [test]
ext/nqp-rx/t/p6regex/rx_subrules [test]
ext/nqp-rx/t/p6regex/rx_syntax [test]
+include/parrot/api.h [main]include
include/parrot/atomic.h [main]include
include/parrot/atomic/fallback.h [main]include
include/parrot/atomic/gcc_pcc.h [main]include
@@ -915,7 +916,6 @@ include/parrot/datatypes.h [main]include
include/parrot/debugger.h [main]include
include/parrot/dynext.h [main]include
include/parrot/embed.h [main]include
-include/parrot/api.h [main]include
include/parrot/encoding.h [main]include
include/parrot/enums.h [main]include
include/parrot/exceptions.h [main]include
@@ -1246,6 +1246,9 @@ src/dynpmc/rotest.pmc []
src/dynpmc/subproxy.pmc []
src/embed.c []
src/embed/api.c []
+src/embed/embed_private.h []
+src/embed/pmc.c []
+src/embed/strings.c []
src/exceptions.c []
src/exit.c []
src/extend.c []
@@ -1937,6 +1940,8 @@ t/src/README []doc
t/src/atomic.t [test]
t/src/basic.t [test]
t/src/embed.t [test]
+t/src/embed/pmc.t [test]
+t/src/embed/strings.t [test]
t/src/exit.t [test]
t/src/extend.t [test]
t/src/pointer_array.t [test]
View
@@ -156,12 +156,13 @@ Set up the const struct declaration for cmd_options
*/
-// TODO: Weed out the options that IMCC doesn't use, and rename this function
-// to something more imcc-ish
+/* TODO: Weed out the options that IMCC doesn't use, and rename this function
+ to something more imcc-ish
+*/
+
static const struct longopt_opt_decl *
Parrot_cmd_options(void)
{
- //ASSERT_ARGS(Parrot_cmd_options)
static const struct longopt_opt_decl cmd_options[] = {
{ '.', '.', (OPTION_flags)0, { "--wait" } },
{ 'D', 'D', OPTION_optional_FLAG, { "--parrot-debug" } },
@@ -636,6 +637,18 @@ compile_to_bytecode(PARROT_INTERP,
return pf;
}
+/*
+
+=item C<int imcc_run_api(PMC * interp_pmc, const char *sourcefile, int argc,
+const char **argv, PMC **pbcpmc)>
+
+This is a wrapper around C<imcc_run> function in which the input parameter is a
+PMC interpreter.
+
+=cut
+
+*/
+
PARROT_API
int
imcc_run_api(ARGMOD(PMC * interp_pmc), ARGIN(const char *sourcefile), int argc,
@@ -1,39 +0,0 @@
-/*
- * Sample of an embedding application: compiles and executes "hello_world.pir"
- */
-
-#include<stdio.h>
-#include <stdlib.h>
-
-#include "parrot/api.h"
-
-int main(int argc, const char **argv)
-{
- int exitcode;
- Parrot_PMC * interp;
- Parrot_PMC * compiler;
- Parrot_PMC * bytecode;
-
- // Create the interpreter
- if (!Parrot_api_make_interpreter(NULL,NULL,NULL,&interp) ) {
- fprintf(stderr,"FATAL: Can't create the interpreter");
- return 1;
- }
-
- // Compile hello_world.pir and execute it
- if ( Parrot_api_load_language(interp, "PIR") &&
- Parrot_api_get_compiler(interp, "PIR", &compiler) &&
- Parrot_api_compile_file(interp, compiler, "hello_world.pir", &bytecode) &&
- Parrot_api_load_bytecode(interp, bytecode) &&
- Parrot_api_run(interp, &exitcode))
- {
- return exitcode;
- }
- else
- {
- // Print last error to stderr
- const char * err = Parrot_api_get_last_error(interp);
- fprintf(stderr, err);
- return 1;
- }
-}
@@ -1,4 +0,0 @@
-# Sample creation of a "Hello world" program
-.sub 'main' :main
- say 'Hello World!'
-.end
Oops, something went wrong. Retry.

0 comments on commit cc0610a

Please sign in to comment.