1 # Types that don't depend on Id. (To break dependency)
2
3 module types {
4 bool_arg_type = Undefined | Path | Int | Str | Other
5 redir_arg_type = Path | Desc | Here
6
7 opt_group = StrictAll | YshUpgrade | YshAll
8 generate [integers]
9
10 # Fifteen lexer modes for OSH
11
12 lex_mode =
13 Undefined
14 | Comment
15 | ShCommand
16 | Backtick # preprocessing before Outer
17 | DBracket
18 | SQ_Raw | DQ | SQ_C
19 | Arith
20 | ExtGlob
21 | VSub_1 | VSub_2 | VSub_ArgUnquoted | VSub_ArgDQ
22 | BashRegex | BashRegexChars
23 | FuncParens # for Id.LookAhead_FuncParens
24
25 # Two for printf builtin
26 | PrintfOuter | PrintfPercent
27
28 # YSH/eggex both use Expr
29 | Expr # var x = 1 + 2 * 3; echo $f(a, b + 1)
30
31 # TODO: J8Str is bit like SQ_C
32 | QSN
33
34 # More possibilities
35 # - printf formatting ${x %05d}. I think that is mostly in expression mode
36 # like ${x|html} or ${x|title}
37
38 # CommandParser context
39 # Note: cmd_mode_e.Hay is better done with CommandParser.hay_attrs_stack,
40 # which is nested
41 cmd_mode =
42 Shell # Top level, and inside shell-style functions
43 | Func # Inside a func, return (x) is required
44 | Proc # Inside proc { } -- shell assignments are disallowed
45 }