protected override SyntaxNode VisitArrayLiteralSyntax(ArrayLiteralSyntax pNode)
 {
     if (_types.ContainsKey(pNode.TypeNode.Value))
     {
         return(SyntaxFactory.ArrayLiteral(PolyType(pNode.TypeNode), pNode.Size));
     }
     return(base.VisitArrayLiteralSyntax(pNode));
 }
Exemple #2
0
 protected override void VisitArrayLiteralSyntax(ArrayLiteralSyntax pNode)
 {
     if (pNode.Type == SmallTypeCache.Undefined)
     {
         CompilerErrors.UndeclaredType(pNode.TypeNode.Value, pNode.Span);
     }
     base.VisitArrayLiteralSyntax(pNode);
 }
Exemple #3
0
 public override void Visit(ArrayLiteralSyntax pNode)
 {
     if (pNode.Size.Type == SmallType.Undefined)
     {
         Compiler.ReportError(CompilerErrorType.UndefinedType, pNode);
     }
     else
     {
         if (!SmallType.I32.IsAssignableFrom(pNode.Size.Type))
         {
             Compiler.ReportError(CompilerErrorType.TypeMismatch, pNode, SmallType.I32.ToString(), pNode.Size.Type.ToString());
         }
     }
     base.Visit(pNode);
 }
Exemple #4
0
 protected virtual void VisitArrayLiteralSyntax(ArrayLiteralSyntax pNode)
 {
     Visit(pNode.TypeNode);
     Visit(pNode.Size);
 }
Exemple #5
0
 protected virtual SyntaxNode VisitArrayLiteralSyntax(ArrayLiteralSyntax pNode)
 {
     return(SyntaxFactory.ArrayLiteral((TypeSyntax)Visit(pNode.TypeNode), Visit(pNode.Size)));
 }