OILS / demo / bugs / fd_state.py View on Github | oilshell.org

36 lines, 21 significant
1#!/usr/bin/env python2
2"""
3u2.py
4"""
5from __future__ import print_function
6
7import sys
8
9
10from core import completion
11from core import test_lib
12from frontend import parse_lib
13from osh import state
14
15
16def main(argv):
17 init_code = ' echo hi >&2 '
18
19 arena = test_lib.MakeArena('<InitCompletionTest>')
20 parse_ctx = parse_lib.ParseContext(arena, {})
21 mem = state.Mem('', [], {}, arena)
22
23 comp_lookup = completion.Lookup()
24 ex = test_lib.EvalCode(init_code, parse_ctx, comp_lookup=comp_lookup,
25 mem=mem)
26
27 print('hi')
28
29
30if __name__ == '__main__':
31 try:
32 main(sys.argv)
33 except RuntimeError as e:
34 print('FATAL: %s' % e, file=sys.stderr)
35 sys.exit(1)
36