diff options
| author | data-man <datamanrb@gmail.com> | 2018-07-13 13:33:43 +0300 |
|---|---|---|
| committer | data-man <datamanrb@gmail.com> | 2018-07-13 13:33:43 +0300 |
| commit | 2e332b29af2ce5e30f740aff47011744803e52f9 (patch) | |
| tree | 9011251deca7e545a95bed4e5320fa4ebab663f4 /src | |
| parent | 9e0eb256857b9dce6895b3dcb0e3f6a9dd2b5def (diff) | |
| download | nimgen-2e332b29af2ce5e30f740aff47011744803e52f9.tar.gz nimgen-2e332b29af2ce5e30f740aff47011744803e52f9.zip | |
Use multiReplace in some places
Diffstat (limited to 'src')
| -rw-r--r-- | src/nimgen/c2nim.nim | 2 | ||||
| -rw-r--r-- | src/nimgen/file.nim | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/nimgen/c2nim.nim b/src/nimgen/c2nim.nim index 28a3b77..4d721b4 100644 --- a/src/nimgen/c2nim.nim +++ b/src/nimgen/c2nim.nim @@ -48,7 +48,7 @@ proc c2nim*(fl, outfile: string, c2nimConfig: c2nimConfigObj) = for prag in c2nimConfig.pragma: outpragma &= "{." & prag & ".}\n" - let fname = file.splitFile().name.replace(re"[\.\-]", "_") + let fname = file.splitFile().name.multiReplace([(".", "_"), ("-", "_")]) if c2nimConfig.dynlib.len() != 0: let diff --git a/src/nimgen/file.nim b/src/nimgen/file.nim index b46f7be..d78c692 100644 --- a/src/nimgen/file.nim +++ b/src/nimgen/file.nim @@ -6,7 +6,7 @@ import globals # File loction proc getNimout*(file: string, rename=true): string = - result = file.splitFile().name.replace(re"[\-\.]", "_") & ".nim" + result = file.splitFile().name.multiReplace([("-", "_"), (".", "_")]) & ".nim" if gOutput != "": result = gOutput & "/" & result |
