mirror of
https://github.com/ksherlock/hystricomorph.git
synced 2024-06-15 13:29:27 +00:00
rename
This commit is contained in:
parent
0789568d06
commit
6e97295623
|
@ -11,7 +11,7 @@ Generates code to match an input string against one or more target strings.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
python3 string_compiler.py [-ilvE] [-o outfile_file] function_name [input_file]
|
python3 hystricomorph.py [-ilvE] [-o outfile_file] function_name [input_file]
|
||||||
|
|
||||||
-i case insensitive comparison
|
-i case insensitive comparison
|
||||||
-E run input file through c pre-processor
|
-E run input file through c pre-processor
|
||||||
|
|
|
@ -155,15 +155,6 @@ def encode_string(s):
|
||||||
return "".join([encode_map.get(x, x) for x in s])
|
return "".join([encode_map.get(x, x) for x in s])
|
||||||
|
|
||||||
|
|
||||||
def usage(ex=1):
|
|
||||||
print("Usage: string_compiler [-cilvE] [-o output_file] function_name [input_file]")
|
|
||||||
print(" -c add implicit 0-terminator to strings")
|
|
||||||
print(" -i case insensitive")
|
|
||||||
print(" -l include string length in lsb of return value")
|
|
||||||
print(" -v be verbose")
|
|
||||||
print(" -E use c pre-processor")
|
|
||||||
print(" -o output_file specify output file")
|
|
||||||
sys.exit(ex)
|
|
||||||
|
|
||||||
|
|
||||||
def read_data(f, name):
|
def read_data(f, name):
|
||||||
|
@ -274,6 +265,15 @@ def init_maps():
|
||||||
encode_map[chr(11)] = '\\v'
|
encode_map[chr(11)] = '\\v'
|
||||||
|
|
||||||
|
|
||||||
|
def usage(ex=1):
|
||||||
|
print("Usage: hystricomorph [-cilvE] [-o output_file] function_name [input_file]")
|
||||||
|
print(" -c add implicit 0-terminator to strings")
|
||||||
|
print(" -i case insensitive")
|
||||||
|
print(" -l include string length in lsb of return value")
|
||||||
|
print(" -v be verbose")
|
||||||
|
print(" -E use c pre-processor")
|
||||||
|
print(" -o output_file specify output file")
|
||||||
|
sys.exit(ex)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global flag_i, flag_l, flag_E, flag_c
|
global flag_i, flag_l, flag_E, flag_c
|
||||||
|
@ -284,12 +284,6 @@ def main():
|
||||||
argv = sys.argv[1:]
|
argv = sys.argv[1:]
|
||||||
opts, args = getopt.getopt(argv, "ivo:leEc")
|
opts, args = getopt.getopt(argv, "ivo:leEc")
|
||||||
|
|
||||||
# flags = {}
|
|
||||||
# for k, v in opts: flags[k] = v
|
|
||||||
# # booleans
|
|
||||||
# for k in ("-i","-v","-l","-e"):
|
|
||||||
# flags[k] = k in flags
|
|
||||||
|
|
||||||
for k, v in opts:
|
for k, v in opts:
|
||||||
if k == '-i': flag_i = True
|
if k == '-i': flag_i = True
|
||||||
elif k == '-o': flag_o = v
|
elif k == '-o': flag_o = v
|
Loading…
Reference in New Issue
Block a user