Пример #1
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");
            }
        }
Пример #2
0
 public static string ExtractValue(string src)
 {
     return(PBXStream.UnquoteString(src.Trim().TrimEnd(',')));
 }