cpp

Coverage Report

Created: 2024-06-29 02:38

/home/uke/oil/cpp/osh.h
Line
Count
Source (jump to first uncovered line)
1
// osh.h
2
3
#ifndef LEAKY_OSH_H
4
#define LEAKY_OSH_H
5
6
#include "_gen/frontend/syntax.asdl.h"
7
#include "cpp/osh_tdop.h"
8
#include "mycpp/runtime.h"
9
10
namespace arith_parse {
11
12
extern tdop::ParserSpec* kArithSpec;
13
14
0
inline tdop::ParserSpec* Spec() {
15
0
  return kArithSpec;
16
0
}
17
18
// Generated tables in _devbuild/gen-cpp/
19
extern tdop::LeftInfo kLeftLookup[];
20
extern tdop::NullInfo kNullLookup[];
21
22
}  // namespace arith_parse
23
24
namespace bool_stat {
25
26
using syntax_asdl::word_t;
27
28
bool isatty(BigStr* fd_str, word_t* blame_word);
29
bool DoUnaryOp(Id_t op_id, BigStr* s);
30
bool DoBinaryOp(Id_t op_id, BigStr* s1, BigStr* s2);
31
32
}  // namespace bool_stat
33
34
namespace sh_expr_eval {
35
36
3
inline bool IsLower(BigStr* ch) {
37
3
  assert(len(ch) == 1);
38
0
  uint8_t c = ch->data_[0];
39
3
  return ('a' <= c && c <= 'z');
40
3
}
41
42
3
inline bool IsUpper(BigStr* ch) {
43
3
  assert(len(ch) == 1);
44
0
  uint8_t c = ch->data_[0];
45
3
  return ('A' <= c && c <= 'Z');
46
3
}
47
48
}  // namespace sh_expr_eval
49
50
#endif  // LEAKY_OSH_H