From 1711052eae985e042ab22108f0975d9bb0906abf Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Sun, 19 Aug 2018 12:31:21 -0500 Subject: [PATCH] Add move capability, handle compile duplicate names --- README.md | 2 ++ nimgen.nimble | 2 +- src/nimgen/fileops.nim | 23 +++++++++++++++++------ src/nimgen/gencore.nim | 14 +++++++++++++- src/nimgen/globals.nim | 1 + src/nimgen/runcfg.nim | 11 ++++++++--- 6 files changed, 42 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 66db546..7cb0f1c 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,8 @@ The following keys apply to library source code (before processing) and generate ```replace``` = string value to replace search string in file. Regex captures can be referred to using $1, $2, etc. +```move``` = search string providing context for location to move the results of a preceding search or regex match + ```comment``` = number of lines to comment from search location The following key only applies before processing and allows renaming the generated .nim files as required to enable successful wrapping. This may be for organizational purposes or to prevent usage of non-nim supported strings in module names (E.g. first letter is a number). Destination is relative to output directory if defined. diff --git a/nimgen.nimble b/nimgen.nimble index 841cb09..6ca5b9e 100644 --- a/nimgen.nimble +++ b/nimgen.nimble @@ -1,6 +1,6 @@ # Package -version = "0.3.1" +version = "0.4.0" author = "genotrance" description = "c2nim helper to simplify and automate the wrapping of C libraries" license = "MIT" diff --git a/src/nimgen/fileops.nim b/src/nimgen/fileops.nim index 4e8f858..e416cf1 100644 --- a/src/nimgen/fileops.nim +++ b/src/nimgen/fileops.nim @@ -31,15 +31,26 @@ proc append*(file: string, data: string, search="") = if idx != -1: content = content[0..