incubator-lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marvin Humphrey (JIRA)" <>
Subject [jira] Updated: (LUCY-71) Remove Perl dependency of METAQUOTE
Date Sat, 30 Jan 2010 02:01:34 GMT


Marvin Humphrey updated LUCY-71:

    Attachment: quote.diff

A couple more minor issues with the latest QUOTE strategem popped up.  First,
MSVC complained about not getting enough arguments when the macro was fed
either pure whitespace or just a comment, forcing such lines to go unquoted:

QUOTE(      int i;                                                   )
QUOTE(      int retval;                                              )
            /* Rebuild command line args. */ 
QUOTE(      for (i = 1; i < argc; i++) {                             )
QUOTE(          command_len += strlen(argv[i]) + 1;                  )

Second, GCC warned about embedding __VA_ARGS__, so I manually quoted that.

QUOTE(  #include "_charm.h"                                   )   
QUOTE(  #define ISO_TEST(fmt, ...) \\                         )   
"           printf(fmt, __VA_ARGS__)                        \n"
QUOTE(  int main() {                                          )  

Despite the limitations, though, in my opinion QUOTE is still better than global 
manual quoting -- so here's the complete quote.diff patch, which purges 
METAQUOTE from the Charmonizer source files.

> Remove Perl dependency of METAQUOTE
> -----------------------------------
>                 Key: LUCY-71
>                 URL:
>             Project: Lucy
>          Issue Type: Improvement
>          Components: Charmonizer
>            Reporter: Nathan Kurz
>            Priority: Minor
>         Attachments: charm_and_harm_to_c_and_h.diff, quote.diff
>   Original Estimate: 168h
>  Remaining Estimate: 168h
> Charmonizer currently uses a Perl script 'METAQUOTE' to preprocess its '.charm' files
into '.c' files and '.harm' files into '.h' files.   This works, but requires a dependency
on Perl that seems inappropriate for a C language tool.
> The suggested alternatives were to use manual quoting or standard macros.  
> Manual quoting seemed error prone and cumbersome, so this patch proposes the using the
'stringify' (#expr) function within standard C preprocessor macros.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message