Skip to content

Commit

Permalink
Merge pull request #8 from shamanas/patch-1
Browse files Browse the repository at this point in the history
Fixed namespace type access
  • Loading branch information
alexnask committed May 12, 2012
2 parents 2fce136 + 5c8cb7a commit 7fdcebb
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions grammar/nagaqueen.leg
Original file line number Diff line number Diff line change
Expand Up @@ -960,29 +960,28 @@ TypeBase = FuncType |
# a GenericType is just like a Type but with non-optional generic type arguments
# it's used when we have to decide between a Type and a VariableAccess
GenericType
= (t:TypeBase
= (
temp: Old # When entering the TypeBase rule, i gets overwritten, so we just use a dummy rule to store it
- i:IDENT { temp=nq_StringClone(i); }
- t:TypeBase { t=$$=nq_onTypeNamespace(core->this, t, temp); }
- '<' - t2:Type { nq_onTypeGenericArgument(core->this, t, t2); }
(- ',' - t2:Type { nq_onTypeGenericArgument(core->this, t, t2); })*
- '>'
- ('*' { t=$$=nq_onTypePointer (core->this, t); }
| '@' { t=$$=nq_onTypeReference(core->this, t); }
| "[" WS { inner=NULL; } - inner:Expr? "]" { t=$$=nq_onTypeBrackets(core->this, t, inner); }
)*
- { $$=t; }) |
('('
temp: Old # When entering the TypeBase rule, i gets overwritten, so we just use a dummy rule to store it
- i:IDENT { temp=nq_StringClone(i); }
- t:TypeBase { t=$$=nq_onTypeNamespace(core->this, t, temp); }
- { $$=t; }
) |
(t:TypeBase
- '<' - t2:Type { nq_onTypeGenericArgument(core->this, t, t2); }
(- ',' - t2:Type { nq_onTypeGenericArgument(core->this, t, t2); })*
- '>'
- ('*' { t=$$=nq_onTypePointer (core->this, t); }
| '@' { t=$$=nq_onTypeReference(core->this, t); }
| "[" WS { inner=NULL; } - inner:Expr? "]" { t=$$=nq_onTypeBrackets(core->this, t, inner); }
)*
- { $$=t; }
')'
)
- { $$=t; })

Type = list:TypeList { $$=list; } | (
t:TypeBase
Expand Down

0 comments on commit 7fdcebb

Please sign in to comment.