[svn:parrot] r46898 - trunk/compilers/imcc

plobsing at svn.parrot.org plobsing at svn.parrot.org
Sat May 22 20:53:30 UTC 2010


Author: plobsing
Date: Sat May 22 20:53:29 2010
New Revision: 46898
URL: https://trac.parrot.org/parrot/changeset/46898

Log:
[IMCC] do_yylex_init() is a duplicate of yylex_init_extra()

Modified:
   trunk/compilers/imcc/imc.h
   trunk/compilers/imcc/main.c
   trunk/compilers/imcc/parser_util.c

Modified: trunk/compilers/imcc/imc.h
==============================================================================
--- trunk/compilers/imcc/imc.h	Sat May 22 20:50:13 2010	(r46897)
+++ trunk/compilers/imcc/imc.h	Sat May 22 20:53:29 2010	(r46898)
@@ -199,11 +199,6 @@
         __attribute__nonnull__(4)
         FUNC_MODIFIES(*fullname);
 
-int do_yylex_init(PARROT_INTERP, ARGOUT(yyscan_t* yyscanner))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(* yyscanner);
-
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 PMC * imcc_compile(PARROT_INTERP,
@@ -345,9 +340,6 @@
     , PARROT_ASSERT_ARG(fullname) \
     , PARROT_ASSERT_ARG(name) \
     , PARROT_ASSERT_ARG(r))
-#define ASSERT_ARGS_do_yylex_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(yyscanner))
 #define ASSERT_ARGS_imcc_compile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(s) \

Modified: trunk/compilers/imcc/main.c
==============================================================================
--- trunk/compilers/imcc/main.c	Sat May 22 20:50:13 2010	(r46897)
+++ trunk/compilers/imcc/main.c	Sat May 22 20:53:29 2010	(r46898)
@@ -422,7 +422,7 @@
 {
     yyscan_t yyscanner = IMCC_INFO(interp)->yyscanner;
 
-    do_yylex_init(interp, &yyscanner);
+    yylex_init_extra(interp, &yyscanner);
 
     Parrot_block_GC_mark(interp);
     Parrot_block_GC_sweep(interp);

Modified: trunk/compilers/imcc/parser_util.c
==============================================================================
--- trunk/compilers/imcc/parser_util.c	Sat May 22 20:50:13 2010	(r46897)
+++ trunk/compilers/imcc/parser_util.c	Sat May 22 20:53:29 2010	(r46898)
@@ -494,27 +494,6 @@
 
 /*
 
-=item C<int do_yylex_init(PARROT_INTERP, yyscan_t* yyscanner)>
-
-=cut
-
-*/
-
-int
-do_yylex_init(PARROT_INTERP, ARGOUT(yyscan_t* yyscanner))
-{
-    ASSERT_ARGS(do_yylex_init)
-    const int retval = yylex_init(yyscanner);
-
-    /* This way we can get the interpreter via yyscanner */
-    if (!retval)
-        yyset_extra(interp, *yyscanner);
-
-    return retval;
-}
-
-/*
-
 =item C<PMC * imcc_compile(PARROT_INTERP, const char *s, int pasm_file, STRING
 **error_message)>
 
@@ -546,7 +525,7 @@
     UINTVAL regs_used[4] = {3, 3, 3, 3};
     INTVAL eval_number;
 
-    do_yylex_init(interp, &yyscanner);
+    yylex_init_extra(interp, &yyscanner);
 
     /* we create not yet anchored PMCs - e.g. Subs: turn off GC */
     Parrot_block_GC_mark(interp);
@@ -864,7 +843,7 @@
 
     if (ext && STREQ(ext, ".pasm")) {
         void *yyscanner;
-        do_yylex_init(interp, &yyscanner);
+        yylex_init_extra(interp, &yyscanner);
 
         IMCC_INFO(interp)->state->pasm_file = 1;
         /* see imcc.l */
@@ -874,7 +853,7 @@
     }
     else {
         void *yyscanner;
-        do_yylex_init(interp, &yyscanner);
+        yylex_init_extra(interp, &yyscanner);
 
         IMCC_INFO(interp)->state->pasm_file = 0;
         compile_file(interp, fp, yyscanner);


More information about the parrot-commits mailing list