1
/*
2
 * Hurl (https://hurl.dev)
3
 * Copyright (C) 2024 Orange
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 *          http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 *
17
 */
18
pub type ParseResult<T> = Result<T, ParseError>;
19

            
20
3415
pub fn parse_hurl_file(s: &str) -> ParseResult<HurlFile> {
21
3415
    let mut reader = Reader::new(s);
22
3415
    parsers::hurl_file(&mut reader)
23
}
24

            
25
pub use self::error::{JsonErrorVariant, ParseError, ParseErrorKind};
26
pub use self::json::{
27
    boolean_value as parse_json_boolean, null_value as parse_json_null,
28
    number_value as parse_json_number, parse as parse_json,
29
};
30
pub use self::template::templatize;
31
use crate::ast::HurlFile;
32
use crate::reader::Reader;
33

            
34
mod base64;
35
mod bytes;
36
mod cookiepath;
37
mod duration;
38
mod error;
39
mod expr;
40
mod filename;
41
mod filename_password;
42
mod filter;
43
mod json;
44
mod key_string;
45
mod multiline;
46
mod number;
47
mod option;
48
mod parsers;
49
mod predicate;
50
mod predicate_value;
51
mod primitives;
52
mod query;
53
mod sections;
54
mod string;
55
mod template;
56
mod url;
57
mod xml;