automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 2/5] [ng] refactor: merge lang_{yacc, lex}_finish f


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 2/5] [ng] refactor: merge lang_{yacc, lex}_finish functions
Date: Wed, 6 Jun 2012 00:52:09 +0200

They are identical after the last commit, so no need to keep them
separated anymore

* automake.in (yacc_lex_finish_helper, lang_yacc_finish,
lang_lex_finish): Merge into ..
(lang_yacc_lex_finish): ... this.
Adjust calls to 'register_language' for Yacc and Lex accordingly.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 automake.in |   29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

diff --git a/automake.in b/automake.in
index 3cce00f..bd9c980 100644
--- a/automake.in
+++ b/automake.in
@@ -830,7 +830,7 @@ register_language ('name' => 'yacc',
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/y/c/;
                                                return ($ext,) },
                   'rule_file' => 'yacc',
-                  '_finish' => \&lang_yacc_finish,
+                  '_finish' => \&lang_yacc_lex_finish,
                   '_target_hook' => \&lang_yacc_target_hook,
                   'nodist_specific' => 1);
 register_language ('name' => 'yaccxx',
@@ -844,7 +844,7 @@ register_language ('name' => 'yaccxx',
                   'extensions' => ['.y++', '.yy', '.yxx', '.ypp'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/y/c/;
                                                return ($ext,) },
-                  '_finish' => \&lang_yacc_finish,
+                  '_finish' => \&lang_yacc_lex_finish,
                   '_target_hook' => \&lang_yacc_target_hook,
                   'nodist_specific' => 1);
 
@@ -860,7 +860,7 @@ register_language ('name' => 'lex',
                   'extensions' => ['.l'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/l/c/;
                                                return ($ext,) },
-                  '_finish' => \&lang_lex_finish,
+                  '_finish' => \&lang_yacc_lex_finish,
                   '_target_hook' => \&lang_lex_target_hook,
                   'nodist_specific' => 1);
 register_language ('name' => 'lexxx',
@@ -874,7 +874,7 @@ register_language ('name' => 'lexxx',
                   'extensions' => ['.l++', '.ll', '.lxx', '.lpp'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/l/c/;
                                                return ($ext,) },
-                  '_finish' => \&lang_lex_finish,
+                  '_finish' => \&lang_yacc_lex_finish,
                   '_target_hook' => \&lang_lex_target_hook,
                   'nodist_specific' => 1);
 
@@ -5511,8 +5511,7 @@ sub lang_lex_target_hook
     $clean_files{$output} = $transform{'DIST_SOURCE'} ? MAINTAINER_CLEAN : 
CLEAN;
 }
 
-# This is a helper for both lex and yacc.
-sub yacc_lex_finish_helper
+sub lang_yacc_lex_finish
 {
   return if defined $language_scratch{'lex-yacc-done'};
   $language_scratch{'lex-yacc-done'} = 1;
@@ -5522,24 +5521,6 @@ sub yacc_lex_finish_helper
   define_variable ('YLWRAP', INTERNAL, '$(am__config_aux_dir)/ylwrap');
 }
 
-sub lang_yacc_finish
-{
-  return if defined $language_scratch{'yacc-done'};
-  $language_scratch{'yacc-done'} = 1;
-
-  yacc_lex_finish_helper;
-}
-
-
-sub lang_lex_finish
-{
-  return if defined $language_scratch{'lex-done'};
-  $language_scratch{'lex-done'} = 1;
-
-  yacc_lex_finish_helper;
-}
-
-
 # Given a hash table of linker names, pick the name that has the most
 # precedence.  This is lame, but something has to have global
 # knowledge in order to eliminate the conflict.  Add more linkers as
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]