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
3975
pub fn parse_hurl_file(s: &str) -> ParseResult<HurlFile> {
21
3975
    let mut reader = Reader::new(s);
22
3975
    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 function;
44
mod json;
45
mod key_string;
46
mod multiline;
47
mod number;
48
mod option;
49
mod parsers;
50
mod placeholder;
51
mod predicate;
52
mod predicate_value;
53
mod primitives;
54
mod query;
55
mod sections;
56
mod string;
57
mod template;
58
mod xml;