cpp

Coverage Report

Created: 2022-11-10 11:34

/home/andy/git/oilshell/oil/cpp/leaky_osh.h
Line
Count
Source (jump to first uncovered line)
1
// leaky_osh.h
2
3
#ifndef LEAKY_OSH_H
4
#define LEAKY_OSH_H
5
6
#include "_gen/frontend/syntax.asdl.h"
7
#include "cpp/leaky_frontend_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(Str* fd_str, word_t* blame_word);
29
bool DoUnaryOp(Id_t op_id, Str* s);
30
bool DoBinaryOp(Id_t op_id, Str* s1, Str* s2);
31
32
}  // namespace bool_stat
33
34
namespace sh_expr_eval {
35
36
0
inline bool IsLower(Str* ch) {
37
0
  assert(len(ch) == 1);
38
0
  uint8_t c = ch->data_[0];
39
0
  return ('a' <= c && c <= 'z');
40
0
}
41
42
0
inline bool IsUpper(Str* ch) {
43
0
  assert(len(ch) == 1);
44
0
  uint8_t c = ch->data_[0];
45
0
  return ('A' <= c && c <= 'Z');
46
0
}
47
48
}  // namespace sh_expr_eval
49
50
#endif  // LEAKY_OSH_H