forked from oils-for-unix/oils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosh.h
50 lines (34 loc) · 936 Bytes
/
osh.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
// osh.h
#ifndef LEAKY_OSH_H
#define LEAKY_OSH_H
#include "_gen/frontend/syntax.asdl.h"
#include "cpp/osh_tdop.h"
#include "mycpp/runtime.h"
namespace arith_parse {
extern tdop::ParserSpec kArithSpec;
inline tdop::ParserSpec* Spec() {
return &kArithSpec;
}
// Generated tables in _devbuild/gen-cpp/
extern tdop::LeftInfo kLeftLookup[];
extern tdop::NullInfo kNullLookup[];
} // namespace arith_parse
namespace bool_stat {
using syntax_asdl::word_t;
bool isatty(Str* fd_str, word_t* blame_word);
bool DoUnaryOp(Id_t op_id, Str* s);
bool DoBinaryOp(Id_t op_id, Str* s1, Str* s2);
} // namespace bool_stat
namespace sh_expr_eval {
inline bool IsLower(Str* ch) {
assert(len(ch) == 1);
uint8_t c = ch->data_[0];
return ('a' <= c && c <= 'z');
}
inline bool IsUpper(Str* ch) {
assert(len(ch) == 1);
uint8_t c = ch->data_[0];
return ('A' <= c && c <= 'Z');
}
} // namespace sh_expr_eval
#endif // LEAKY_OSH_H