示例#1
0
        private static HeaderValueModel MatchValue(string text, HeaderModel parent, Scope scope)
        {
            var assignment = CSharp.ParseExpression(text) as AssignmentExpressionSyntax;

            if (assignment == null)
            {
                return(null); //td: error
            }
            parent.Values.Add(assignment);
            return(new HeaderValueModel());
        }
示例#2
0
        private static HeaderModel MatchHeader(string text, RootModel parent, Scope scope)
        {
            if (text.StartsWith("[") && text.EndsWith("]"))
            {
                var header = new HeaderModel {
                    Name = text
                };
                parent.Headers.Add(header);
                return(header);
            }

            return(null);
        }