Skip to content
Open
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions expand.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import getopt
import tempfile
import subprocess
import pathlib

usage = '''Usage:expand.py [options] <output modules>
Output Modules:
Expand Down Expand Up @@ -43,14 +44,14 @@
'scc': ('internal_scc',),
'segtree': ('internal_bit', 'internal_type_traits',),
'twosat': ('internal_scc',), }
src_path = 'src/'
src_path = pathlib.Path(sys.argv[0]).parent.joinpath('src')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execution from . also success

% python3 ${HOME}/src/github.com/rust-lang-ja/ac-library-rs/expand.py segtree | pbcopy
%



def output_file(filename):
global src_path

res = []
with open(src_path+filename+'.rs', 'r') as f:
with open(src_path.joinpath(filename+'.rs'), 'r') as f:
res.append('pub mod {} {{'.format(filename))

for line in f:
Expand Down