Repository navigation
Expand file tree
/
Copy pathparser.hpp
More file actions
52 lines (40 loc) · 1.9 KB
/
Copy pathparser.hpp
File metadata and controls
52 lines (40 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2012 Twan van Laarhoven and Sean Hunt |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_SCRIPT_PARSER
#define HEADER_SCRIPT_PARSER
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <util/error.hpp>
#include <script/script.hpp>
class Packaged;
// ----------------------------------------------------------------------------- : Parser
/// Parse a String to a Script
/** If string_mode then s is interpreted as a string,
* escaping to script mode can be done with {}.
*
* Errors are stored in the output vector.
* If there are errors, the result is a null pointer
*
* The package is for loading included files, it may be null
*/
ScriptP parse(const String& s, Packaged* package, bool string_mode, vector<ScriptParseError>& errors_out);
/// Parse a String to a Script
/** If string_mode then s is interpreted as a string,
* escaping to script mode can be done with {}.
*
* If an error is encountered, an exception is thrown.
*/
ScriptP parse(const String& s, Packaged* package = nullptr, bool string_mode = false);
/// Parse a String to a ScriptValue
/** Can return nullptr in case of parse errors
*/
ScriptValueP parse_value(const String& s, Packaged* package, vector<ScriptParseError>& errors_out);
/// Parse a String to a ScriptValue
/** Throws an exception in case of parse errors
*/
ScriptValueP parse_value(const String& s, Packaged* package = nullptr);
// ----------------------------------------------------------------------------- : EOF
#endif