lib-ruby-parser (C++ bindings)
4.0.1+ruby-3.1.1
C++ bindings for lib-ruby-parser library
loc.hpp
Go to the documentation of this file.
1
#ifndef LIB_RUBY_PARSER_LOC_HPP
2
#define LIB_RUBY_PARSER_LOC_HPP
3
4
#include <cstddef>
5
#include <cstdint>
6
#include <string>
7
#include "
decoded_input.hpp
"
8
9
namespace
lib_ruby_parser
10
{
12
class
Loc
13
{
14
public
:
15
size_t
begin
;
16
size_t
end
;
17
18
explicit
Loc
(
size_t
begin_,
size_t
end_);
19
20
std::string
source
(
const
DecodedInput
&decoded_input)
const
;
21
};
22
24
class
MaybeLoc
25
{
26
public
:
27
enum class
Tag
28
{
29
NONE
= 0,
30
SOME
= 1,
31
};
32
33
union
Value
34
{
35
Loc
loc
;
36
uint8_t
none
;
37
};
38
39
Tag
tag
;
40
Value
as
;
41
42
static
MaybeLoc
Some
(
Loc
loc);
43
static
MaybeLoc
None
();
44
};
45
}
// namespace lib_ruby_parser
46
47
#endif // LIB_RUBY_PARSER_LOC_HPP
lib_ruby_parser::Loc
Loc struct from lib-ruby-parser
Definition:
loc.hpp:12
lib_ruby_parser::MaybeLoc::Value::none
uint8_t none
Definition:
loc.hpp:36
lib_ruby_parser::MaybeLoc::Tag
Tag
Definition:
loc.hpp:27
lib_ruby_parser::MaybeLoc::Value::loc
Loc loc
Definition:
loc.hpp:35
decoded_input.hpp
lib_ruby_parser::MaybeLoc::tag
Tag tag
Definition:
loc.hpp:39
lib_ruby_parser::MaybeLoc::Tag::SOME
@ SOME
lib_ruby_parser::MaybeLoc::as
Value as
Definition:
loc.hpp:40
lib_ruby_parser::MaybeLoc::Tag::NONE
@ NONE
lib_ruby_parser::Loc::source
std::string source(const DecodedInput &decoded_input) const
lib_ruby_parser::Loc::begin
size_t begin
Definition:
loc.hpp:15
lib_ruby_parser::Loc::Loc
Loc(size_t begin_, size_t end_)
lib_ruby_parser::DecodedInput
Equivalent of lib_ruby_parser::source::DecodedInput
Definition:
decoded_input.hpp:11
lib_ruby_parser::MaybeLoc
Equivalent of Option<Loc>
Definition:
loc.hpp:24
lib_ruby_parser::MaybeLoc::Value
Definition:
loc.hpp:33
lib_ruby_parser
Definition:
api.hpp:7
lib_ruby_parser::MaybeLoc::None
static MaybeLoc None()
lib_ruby_parser::Loc::end
size_t end
Definition:
loc.hpp:16
lib_ruby_parser::MaybeLoc::Some
static MaybeLoc Some(Loc loc)
loc.hpp
Generated by
1.8.17