public static ExpressionOptions GetExpressionOptions(this MSBuildValueKind kind)
        {
            var options = ExpressionOptions.Items;

            if (kind.AllowLists())
            {
                options |= ExpressionOptions.Lists;
            }
            if (kind.AllowCommaLists())
            {
                options |= ExpressionOptions.CommaLists;
            }

            //FIXME: need more context to figure out whether to allow metadata. say yes for now.
            options |= ExpressionOptions.Metadata;

            return(options);
        }
Пример #2
0
        //validates CommaValue and SemicolonValue, and collapses them to Value
        public static bool ValidateListPermitted(ListKind listKind, MSBuildValueKind kind)
        {
            switch (listKind)
            {
            case ListKind.Comma:
                if (kind.AllowCommaLists())
                {
                    return(true);
                }
                return(false);

            case ListKind.Semicolon:
                if (kind.AllowLists())
                {
                    return(true);
                }
                return(false);

            default:
                return(true);
            }
        }
        public static List <string> GetTypeDescription(this MSBuildValueKind kind)
        {
            var    modifierList = new List <string> ();
            string kindName     = FormatKind(kind);

            if (kindName != null)
            {
                modifierList.Add(kindName);
                if (kind.AllowLists())
                {
                    modifierList.Add("list");
                }
                else if (kind.AllowCommaLists())
                {
                    modifierList.Add("comma-list");
                }
                if (!kind.AllowExpressions())
                {
                    modifierList.Add("literal");
                }
            }

            return(modifierList);
        }
Пример #4
0
        //validates CommaValue and SemicolonValue, and collapses them to Value
        public static bool ValidateListPermitted(ref TriggerState triggerState, MSBuildValueKind kind)
        {
            switch (triggerState)
            {
            case TriggerState.CommaValue:
                if (kind.AllowCommaLists())
                {
                    triggerState = TriggerState.Value;
                    return(true);
                }
                return(false);

            case TriggerState.SemicolonValue:
                if (kind.AllowLists())
                {
                    triggerState = TriggerState.Value;
                    return(true);
                }
                return(false);

            default:
                return(true);
            }
        }