Skip to content

Undocumented "compare" statement #35

@ggs67

Description

@ggs67

What is the undocumented (hoping I was not blind) "compare" statement in the config file for ?

Some background info:

After I did run out of time in my attempt to submit some changes for csync2 I decided to restart from scratch, resetting my fork and started cleaning up the parser/scanner before implementing new features.

For this I did switch from yacc to requiring bison (i.e. also running bison in native mode, not yacc compatible mode). This step is required by some changes I introduce but seemed also trivial as the original file uses the non-posix %expect statement. However my clean-up of the parser also includes changing the one step recursions to two steps. This removes the requirement for empty rules which has two positive effects : it disallows useless (and probably bogus) empty statements and in the same way removes the shift/reduce errors and thus does not require the %expect anymore

In my progress through the parser I am now on the "compare " and I think there is a bug in the parser or I alternatively I do not understand the use of the command. The comp_list rule parses to "incl_list TK_STRING" , while I guess this should be comp_list ? This seems top be confirmed by the code as there is no way for the code to distinguish between include patterns from the compare statement or a previous include statement.

Orgiginal rule:

comp_list:
        /* empty */
|       incl_list TK_STRING
                { add_patt(2, on_cygwin_lowercase($2)); }
;

I guess it should be comp_list and I will change to:

comp_list: comp
         | comp_list comp
         ;
         
comp     : TK_STRING
              { add_patt(2, on_cygwin_lowercase($1)); }
         ;

Still would be interested to know the use case of this statement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions