View
@@ -0,0 +1,21 @@
-- Types that don't depend on Id. (To break dependency)
module types {
-- Also invalid because of duplicate 'Path' -- to fix
-- bool_operand_type = Undefined | Path | Int | Str | Other
redir_type = Path | Desc | Here
-- Fifteen lexer modes for osh.
-- Possible additional modes:
-- nested backticks: echo `echo \`echo foo\` bar`
lex_mode =
NONE
| COMMENT
| OUTER
| DBRACKET
| SQ | DQ | DOLLAR_SQ
| ARITH
| EXTGLOB
| VS_1 | VS_2 | VS_ARG_UNQ | VS_ARG_DQ
| BASH_REGEX | BASH_REGEX_CHARS
}
View
@@ -18,11 +18,11 @@
from core import util
from osh import arith_parse
from osh.meta import ast
from osh.meta import ast, types
word_part_e = ast.word_part_e
word_e = ast.word_e
lex_mode_e = ast.lex_mode_e
lex_mode_e = types.lex_mode_e
p_die = util.p_die
log = util.log
View
@@ -14,17 +14,16 @@
from asdl import const
from core import alloc
from osh.meta import Id
from core import test_lib
from core import word
from osh.meta import ast
from osh.meta import ast, Id, types
from osh import ast_lib
from osh import parse_lib
from osh.word_parse import WordParser # module under test
arith_expr_e = ast.arith_expr_e
lex_mode_e = ast.lex_mode_e
lex_mode_e = types.lex_mode_e
def _InitWordParserWithArena(s):