/[autoconf]/autoconf/lib/m4sugar/m4sugar.m4
ViewVC logotype

Diff of /autoconf/lib/m4sugar/m4sugar.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2.60 by akim, Tue Nov 13 10:42:05 2001 UTC revision 2.61 by akim, Mon Mar 4 15:02:21 2002 UTC
# Line 521  m4_define([m4_popdef], Line 521  m4_define([m4_popdef],
521  m4_builtin([popdef], $@)])  m4_builtin([popdef], $@)])
522    
523    
524  # m4_quote(STRING)  # m4_quote(ARGS)
525  # ----------------  # --------------
526  # Return STRING quoted.  # Return ARGS quoted.  Note that a list of quoted arguments is returned,
527    # not a quoted list.
528  #  #
529  # It is important to realize the difference between `m4_quote(exp)' and  # It is important to realize the difference between `m4_quote(exp)' and
530  # `[exp]': in the first case you obtain the quoted *result* of the  # `[exp]': in the first case you obtain the quoted *result* of the
531  # expansion of EXP, while in the latter you just obtain the string  # expansion of EXP, while in the latter you just obtain the string
532  # `exp'.  # `exp'.
533  m4_define([m4_quote], [[$*]])  m4_define([m4_quote],  [[$*]])
534  m4_define([m4_dquote], [[[$*]]])  m4_define([m4_lquote], [$@])
535    m4_define([m4_dquote], [[$@]])
536    
537    
538  # m4_noquote(STRING)  # m4_noquote(STRING)
# Line 696  m4_define([m4_foreach], Line 698  m4_define([m4_foreach],
698    
699  # Low level macros used to define m4_foreach.  # Low level macros used to define m4_foreach.
700  m4_define([m4_car], [[$1]])  m4_define([m4_car], [[$1]])
701  m4_define([m4_car2], [[$@]])  m4_define([m4_cdr], [m4_dquote(m4_shift($@))])
702  m4_define([_m4_foreach],  m4_define([_m4_foreach],
703  [m4_if(m4_quote($2), [], [],  [m4_if([$2], [[]], [],
704         [m4_define([$1], [m4_car($2)])$3[]_m4_foreach([$1],         [m4_define([$1], [m4_car($2)])$3[]_m4_foreach([$1],
705                                                       m4_car2(m4_shift($2)),                                                       m4_cdr($2),
706                                                       [$3])])])                                                       [$3])])])
707    
708    
# Line 1375  m4_define([m4_re_escape], Line 1377  m4_define([m4_re_escape],
1377  # ------------  # ------------
1378  # Regexp for `[a-zA-Z_0-9]*'  # Regexp for `[a-zA-Z_0-9]*'
1379  m4_define([m4_re_string],  m4_define([m4_re_string],
1380  m4_dquote(m4_defn([m4_cr_symbols2]))dnl  m4_quote(m4_defn([m4_cr_symbols2]))dnl
1381  [*]dnl  [*]dnl
1382  )  )
1383    
# Line 1384  m4_dquote(m4_defn([m4_cr_symbols2]))dnl Line 1386  m4_dquote(m4_defn([m4_cr_symbols2]))dnl
1386  # ----------  # ----------
1387  # Regexp for `[a-zA-Z_][a-zA-Z_0-9]*'  # Regexp for `[a-zA-Z_][a-zA-Z_0-9]*'
1388  m4_define([m4_re_word],  m4_define([m4_re_word],
1389  m4_dquote(m4_defn([m4_cr_symbols1]))dnl  m4_quote(m4_defn([m4_cr_symbols1]))dnl
1390  m4_defn([m4_re_string])dnl  m4_defn([m4_re_string])dnl
1391  )  )
1392    
# Line 1554  m4_define([m4_append_uniq], Line 1556  m4_define([m4_append_uniq],
1556            [m4_append($@)])])            [m4_append($@)])])
1557    
1558    
 # m4_foreach_quoted(VARIABLE, LIST, EXPRESSION)  
 # ---------------------------------------------  
 # FIXME: This macro should not exists.  Currently it's used only in  
 # m4_wrap, which needs to be rewritten.  But it's godam hard.  
 m4_define([m4_foreach_quoted],  
 [m4_pushdef([$1], [])_m4_foreach_quoted($@)m4_popdef([$1])])  
   
 # Low level macros used to define m4_foreach.  
 m4_define([m4_car_quoted], [[$1]])  
 m4_define([_m4_foreach_quoted],  
 [m4_if($2, [()], ,  
        [m4_define([$1], [m4_car_quoted$2])$3[]_m4_foreach_quoted([$1],  
                                                                [(m4_shift$2)],  
                                                                [$3])])])  
   
   
1559  # m4_text_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH])  # m4_text_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH])
1560  # -------------------------------------------------------  # -------------------------------------------------------
1561  # Expands into STRING wrapped to hold in WIDTH columns (default = 79).  # Expands into STRING wrapped to hold in WIDTH columns (default = 79).
# Line 1617  m4_Prefix1[]dnl Line 1603  m4_Prefix1[]dnl
1603  m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),  m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
1604        1, [m4_define([m4_Cursor], m4_len(m4_Prefix))        1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
1605  m4_Prefix])[]dnl  m4_Prefix])[]dnl
1606  m4_foreach_quoted([m4_Word], (m4_split(m4_normalize([$1]))),  m4_foreach([m4_Word], m4_quote(m4_split(m4_normalize([$1]))),
1607  [m4_define([m4_Cursor], m4_eval(m4_Cursor + m4_len(m4_Word) + 1))dnl  [m4_define([m4_Cursor], m4_eval(m4_Cursor + m4_len(m4_defn([m4_Word])) + 1))dnl
1608  dnl New line if too long, else insert a space unless it is the first  dnl New line if too long, else insert a space unless it is the first
1609  dnl of the words.  dnl of the words.
1610  m4_if(m4_eval(m4_Cursor > m4_Width),  m4_if(m4_eval(m4_Cursor > m4_Width),
1611        1, [m4_define([m4_Cursor],        1, [m4_define([m4_Cursor],
1612                      m4_eval(m4_len(m4_Prefix) + m4_len(m4_Word) + 1))]                      m4_eval(m4_len(m4_Prefix) + m4_len(m4_defn([m4_Word])) + 1))]
1613  m4_Prefix,  m4_Prefix,
1614         [m4_Separator])[]dnl         [m4_Separator])[]dnl
1615  m4_Word[]dnl  m4_defn([m4_Word])[]dnl
1616  m4_define([m4_Separator], [ ])])dnl  m4_define([m4_Separator], [ ])])dnl
1617  m4_popdef([m4_Separator])dnl  m4_popdef([m4_Separator])dnl
1618  m4_popdef([m4_Cursor])dnl  m4_popdef([m4_Cursor])dnl

Legend:
Removed from v.2.60  
changed lines
  Added in v.2.61

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26