fix wrc to parse '~' and '&' in style specification
Michael Lin
mlin at corvu.com.au
Mon Mar 28 18:29:09 CST 2005
Borland C++ compiler allows bitwise operation & and ~ to specify it's style
It was discussed before why not use xpr rule instead as it is a free
expression, ie
style
: xpr { $$ = new_style($1, 0); }
;
However, this will render the style->and_mask useless as it is never used.
In style expression, '~' and tNOT are treated differently.
'~' is applied as it is parsed, ie from left to right like normal
expressions,
tNOT is applied at the very end, after all other or_mask are combined.
xpr won't work here as it treats tNOT and '~' the same.
So adding '&' and '~' is a better solution here.
ChangeLog:
* get wrc to parse '&' and '~' when specifying style.
-------------- next part --------------
Index: tools/wrc/parser.y
===================================================================
RCS file: /home/wine/wine/tools/wrc/parser.y,v
retrieving revision 1.49
diff -u -r1.49 parser.y
--- tools/wrc/parser.y 8 Mar 2005 19:09:16 -0000 1.49
+++ tools/wrc/parser.y 28 Mar 2005 23:41:40 -0000
@@ -1004,6 +1004,8 @@
| '(' style ')' { $$ = $2; }
| any_num { $$ = new_style($1, 0); }
| tNOT any_num { $$ = new_style(0, $2); }
+ | style '&' style { $$ = new_style($1->or_mask & $3->or_mask, $1->and_mask & $3->and_mask); free($1); free($3);}
+ | '~' any_num { $$ = new_style(~$2, 0); }
;
ctlclass
More information about the wine-patches
mailing list