Example #1
0
        private static bool _parseReference(MacroContext context, AstExpr macroRef)
        {
            if (macroRef.IsPlaceholder())
            {
                context.ReportMessage(
                    Message.Error(
                        Resources.CallMacro_notOnPlaceholder, context.Invocation.Position,
                        MessageClasses.CallMacroNotOnPlaceholder));
                return false;
            }

            return true;
        }
Example #2
0
 private static bool _hasPlaceholder(AstExpr expr)
 {
     var lit = expr as AstListLiteral;
     return expr.IsPlaceholder() || (lit != null && lit.CheckForPlaceholders());
 }
Example #3
0
 private static bool _parsePrototype(MacroContext context,
     AstExpr specProto, out PCall protoCall, out IList<AstExpr> protoArguments,
     out AstExpr macroSpec)
 {
     var proto2 = specProto as AstExpand;
     if (specProto.IsPlaceholder())
     {
         //As an exception, allow a placeholder here
         macroSpec = specProto;
         protoCall = PCall.Get;
         protoArguments = new List<AstExpr>();
     }
     else if (proto2 != null)
     {
         macroSpec = _getMacroSpecExpr(context, proto2);
         protoCall = proto2.Call;
         protoArguments = proto2.Arguments;
     }
     else
     {
         _errorUsagePrototype(context);
         macroSpec = null;
         protoCall = PCall.Get;
         protoArguments = null;
         return false;
     }
     return true;
 }