-
Notifications
You must be signed in to change notification settings - Fork 0
/
location.h
59 lines (48 loc) · 1.13 KB
/
location.h
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
53
54
55
56
57
58
59
#ifndef RBS_LOCATION_H
#define RBS_LOCATION_H
#include "ruby.h"
#include "lexer.h"
/**
* RBS::Location class
* */
extern VALUE RBS_Location;
typedef struct rbs_loc_list {
ID name;
range rg;
struct rbs_loc_list *next;
} rbs_loc_list;
typedef struct {
VALUE buffer;
range rg;
rbs_loc_list *requireds;
rbs_loc_list *optionals;
} rbs_loc;
/**
* Returns new RBS::Location object, with given buffer and range.
* */
VALUE rbs_new_location(VALUE buffer, range rg);
/**
* Return rbs_loc associated with the RBS::Location object.
* */
rbs_loc *rbs_check_location(VALUE location);
/**
* Add a required child range with given name.
* */
void rbs_loc_add_required_child(rbs_loc *loc, ID name, range r);
/**
* Add an optional child range with given name.
* */
void rbs_loc_add_optional_child(rbs_loc *loc, ID name, range r);
/**
* Returns RBS::Location object with start/end positions.
*
* @param start_pos
* @param end_pos
* @return New RSS::Location object.
* */
VALUE rbs_location_pp(VALUE buffer, const position *start_pos, const position *end_pos);
/**
* Define RBS::Location class.
* */
void rbs__init_location();
#endif