Skip to content

Commit

Permalink
[translation] Start porting osh/word_.py to tagswitch
Browse files Browse the repository at this point in the history
- And also tighten some of the static type signatures, e.g. to
  word__Compound rather than word_t.

34 compile errors left.
  • Loading branch information
Andy Chu committed Nov 15, 2019
1 parent b1ed0b6 commit 8e5127c
Show file tree
Hide file tree
Showing 4 changed files with 224 additions and 170 deletions.
4 changes: 2 additions & 2 deletions mycpp/cppgen_pass.py
Expand Up @@ -1550,9 +1550,9 @@ def visit_import_from(self, o: 'mypy.nodes.ImportFrom') -> T:

# TODO: Should these be moved to core/pylib.py or something?
# They are varargs functions that have to be rewritten.
if name == 'log':
if name in ('log', 'p_die'):
return # do nothing
if name == 'p_die':
if name in ('switch', 'tagswitch'): # mylib
return # do nothing

if '.' in o.id:
Expand Down
5 changes: 3 additions & 2 deletions mycpp/examples.sh
Expand Up @@ -294,9 +294,10 @@ namespace arith_nt {
$REPO_ROOT/pgen2/parse.py \
$REPO_ROOT/oil_lang/expr_parse.py \
$REPO_ROOT/oil_lang/expr_to_ast.py \
$REPO_ROOT/osh/bool_parse.py \
$REPO_ROOT/osh/word_.py \
examples/$name.py
#$REPO_ROOT/osh/word_.py \

#$REPO_ROOT/osh/bool_parse.py \

# TODO:
# osh/word_.py needs its own case
Expand Down
1 change: 1 addition & 0 deletions mycpp/examples/pgen2_demo.py
Expand Up @@ -90,6 +90,7 @@ def run_tests():
f.close()

ParseDemo(gr)
print('done')


def run_benchmarks():
Expand Down

0 comments on commit 8e5127c

Please sign in to comment.