Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[htm8 refactor] Use token IDs in htm8.asdl #2231

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions doctools/src-tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ source build/common.sh # log

export PYTHONPATH=.

src-tree-py() {
PYTHONPATH='.:vendor/' doctools/src_tree.py "$@"
}

install-deps() {
sudo apt-get install moreutils # for isutf8
}
Expand Down Expand Up @@ -141,7 +145,7 @@ all-html-to-files() {
log "=== $lang ==="

cat $BASE_DIR/$lang.txt | xargs _tmp/micro-syntax/micro_syntax -l $lang -w \
| doctools/src_tree.py write-html-fragments $out_dir
| $0 src-tree-py write-html-fragments $out_dir
log ''
done
}
Expand Down Expand Up @@ -184,7 +188,7 @@ highlight() {
time all-html-to-files $www_dir > $attrs

# Now write index.html dir listings
time doctools/src_tree.py dirs $www_dir < $attrs
time src-tree-py dirs $www_dir < $attrs
}

soil-run() {
Expand Down
9 changes: 7 additions & 2 deletions doctools/ul-table-test.ysh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ source $LIB_OSH/task-five.sh
#source $LIB_YSH/yblocks.ysh

proc run-py {
### Run with the shebang setting
PYTHONPATH='.:vendor/' @ARGV
}

proc run-py3 {
PYTHONPATH='.' python3 @ARGV
}

deps() {
# Good: only 3 files: ul_table, lazylex/html, util.py
build/dynamic-deps.sh py-tool doctools.ul_table
Expand All @@ -76,7 +81,7 @@ test-unit-py2() {
# Problem: We import cmark, which imports ctypes
test-unit-py3() {
# like test/unit.sh
run-py python3 doctools/ul_table_test.py
run-py3 doctools/ul_table_test.py
}

# Taken from unit test
Expand Down Expand Up @@ -116,7 +121,7 @@ test-without-cmark-py2() {
}

test-without-cmark-py3() {
echo $TD_ATTRS | cmark-bin --unsafe | run-py python3 doctools/ul_table.py
echo $TD_ATTRS | cmark-bin --unsafe | run-py3 doctools/ul_table.py
}

proc run-tests() {
Expand Down
4 changes: 2 additions & 2 deletions doctools/util.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python2
"""util.py."""
from __future__ import print_function

import sys

# Note: from typing import Any causes ImportError when PYTHONPATH is not .:vendor
# So we import from vendor.typing which is a little inconsistent
from vendor.typing import Any
#from vendor.typing import Any
from typing import Any


def log(msg, *args):
Expand Down
6 changes: 5 additions & 1 deletion test/spec-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,16 @@ all-parallel() {
time $0 _all-parallel "$@"
}

src-tree-py() {
PYTHONPATH='.:vendor/' doctools/src_tree.py "$@"
}

all-tests-to-html() {
local manifest=$1
local output_base_dir=$2
# ignore attrs output
head -n $NUM_SPEC_TASKS $manifest \
| xargs --verbose -- doctools/src_tree.py spec-files $output_base_dir >/dev/null
| xargs --verbose -- $0 src-tree-py spec-files $output_base_dir >/dev/null

#| xargs -n 1 -P $MAX_PROCS -- $0 test-to-html $output_base_dir
log "done: all-tests-to-html"
Expand Down