mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
treat normal events like fields (their delegate type is sufficient for the translation). Still need to address add/remove blocks
This commit is contained in:
parent
05c15f501a
commit
f49d562c9c
@ -531,7 +531,7 @@ class_member_declaration:
|
||||
a=attributes?
|
||||
m=modifiers?
|
||||
( c='const' ct=type constant_declarators ';' -> ^(FIELD[$c.token, "FIELD"] $a? $m? { addConstModifiers($c.token, $m.modList) } $ct constant_declarators)
|
||||
| ev=event_declaration -> ^(EVENT[$ev.start.Token, "EVENT"] $a? $m? $ev)
|
||||
| ev=event_declaration[$a.tree, $m.tree] -> $ev
|
||||
| p='partial' { Warning($p.line, "[UNSUPPORTED] 'partial' definition"); } (v1=void_type m3=method_declaration[$a.tree, $m.tree, $m.modList, $v1.tree, $v1.text] -> $m3
|
||||
| pi=interface_declaration[$a.tree, $m.tree] -> $pi
|
||||
| pc=class_declaration[$a.tree, $m.tree, false /* toplevel */] -> $pc
|
||||
@ -1253,10 +1253,10 @@ accessor_modifier:
|
||||
'protected' 'internal'? | 'private' | 'internal' 'protected'?;
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
event_declaration:
|
||||
'event' type
|
||||
((member_name '{') => member_name '{' event_accessor_declarations '}'
|
||||
| variable_declarators ';') // typename=foo;
|
||||
event_declaration[CommonTree atts, CommonTree mods]:
|
||||
e='event' type
|
||||
((member_name '{') => member_name '{' event_accessor_declarations '}' -> ^(EVENT[$e.token, "EVENT"] { dupTree(atts) } { dupTree(mods) } type member_name '{' event_accessor_declarations '}')
|
||||
| variable_declarators ';' -> ^(FIELD[$e.token,"FIELD"] { dupTree(atts) } { dupTree(mods) } type variable_declarators)) // typename=foo;
|
||||
;
|
||||
event_modifiers:
|
||||
modifier+ ;
|
||||
|
@ -828,7 +828,7 @@ accessor_body:
|
||||
event_declaration:
|
||||
'event' type
|
||||
((member_name '{') => member_name '{' event_accessor_declarations '}' { ((ClassRepTemplate)$NSContext::currentTypeRep).Events.Add(new FieldRepTemplate($type.thetext, $member_name.name)); }
|
||||
| variable_declarators[$type.thetext, true] ';') // typename=foo;
|
||||
| variable_declarators[$type.thetext, false] ';') // typename=foo;
|
||||
{ DebugDetail("Processing event declaration: " + $member_name.name); }
|
||||
;
|
||||
event_modifiers:
|
||||
|
Loading…
x
Reference in New Issue
Block a user