示例#1
0
 static void WriteStringImpl(StringBuilder sb, string s, bool comment, GUIDToCommentMap comments)
 {
     if (comment)
     {
         comments.WriteStringBuilder(sb, s);
     }
     else
     {
         sb.Append(PBXStream.QuoteStringIfNeeded(s));
     }
 }
示例#2
0
        public static PBXElementString ParseIdentifierAST(IdentifierAST ast, TokenList tokens, string text)
        {
            Token  tok = tokens[ast.value];
            string value;

            switch (tok.type)
            {
            case TokenType.String:
                value = text.Substring(tok.begin, tok.end - tok.begin);
                return(new PBXElementString(value));

            case TokenType.QuotedString:
                value = text.Substring(tok.begin, tok.end - tok.begin);
                value = PBXStream.UnquoteString(value);
                return(new PBXElementString(value));

            default:
                throw new Exception("Internal parser error");
            }
        }