diff options
Diffstat (limited to 'hscript/script_l.hh')
-rw-r--r-- | hscript/script_l.hh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/hscript/script_l.hh b/hscript/script_l.hh new file mode 100644 index 0000000..1f048c6 --- /dev/null +++ b/hscript/script_l.hh @@ -0,0 +1,35 @@ +/* + * script_l.hh - Definition of the ScriptLocation structure + * libhscript, the HorizonScript library for + * Project Horizon + * + * Copyright (c) 2020 Adélie Linux and contributors. All rights reserved. + * This code is licensed under the AGPL 3.0 license, as noted in the + * LICENSE-code file in the root directory of this repository. + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#ifndef SCRIPT_L_HH +#define SCRIPT_L_HH + +#include <string> + +namespace Horizon { + +/*! Defines a location within a script. */ +struct ScriptLocation { + /*! The filename of the script. */ + std::string name; + /*! The line number of the current location. */ + int line; + /*! Whether this script is nested or the original script. */ + bool nested; + + ScriptLocation(std::string _n, int _l, bool _nest = false) : + name{_n}, line{_l}, nested{_nest} {}; +}; + +} + +#endif /* !SCRIPT_L_HH */ |