diff options
author | milo-minderbender <bushtic2000-general@yahoo.com> | 2013-05-13 16:27:16 +0300 |
---|---|---|
committer | milo-minderbender <bushtic2000-general@yahoo.com> | 2013-05-13 16:27:16 +0300 |
commit | 5ab2f666be87be494416298f07aa874fed6e1d42 (patch) | |
tree | d2ff84565364d269dd7b22cc2c29172f86585e6d /src/main/scala | |
parent | b6088379e7c4c20ddbc74d0f2b0ee4c693d3d228 (diff) | |
download | sbt-boilerplate-5ab2f666be87be494416298f07aa874fed6e1d42.tar.gz sbt-boilerplate-5ab2f666be87be494416298f07aa874fed6e1d42.tar.bz2 sbt-boilerplate-5ab2f666be87be494416298f07aa874fed6e1d42.zip |
Insert patterns for i+1
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/spray/boilerplate/Generator.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/scala/spray/boilerplate/Generator.scala b/src/main/scala/spray/boilerplate/Generator.scala index f124691..0dc79ec 100644 --- a/src/main/scala/spray/boilerplate/Generator.scala +++ b/src/main/scala/spray/boilerplate/Generator.scala @@ -16,10 +16,12 @@ object Generator { def formatNumSpace(num: Int) = num.formatted("%d") def replaceInPattern(pattern: String)(idx: Int): String = // in likely identifiers replace by '04' etc. - pattern.replaceAll("(?<=\\w)(?<!\\d)(?<!##)1(?!\\d)", formatNum0(idx)) + pattern.replaceAll("(?<=\\w)(?<!\\d)(?<!##)2(?!\\d)", formatNum0(idx + 1)) + .replaceAll("(?<=\\w)(?<!\\d)(?<!##)1(?!\\d)", formatNum0(idx)) .replaceAll("(?<=\\w)(?<!\\d)(?<!##)0(?!\\d)", formatNum0(idx - 1)) // in other places replace by ' 4' etc. + .replaceAll("(?<!\\w)(?<!\\d)(?<!##)2(?!\\d)", formatNumSpace(idx + 1)) .replaceAll("(?<!\\w)(?<!\\d)(?<!##)1(?!\\d)", formatNumSpace(idx)) .replaceAll("(?<!\\w)(?<!\\d)(?<!##)0(?!\\d)", formatNumSpace(idx - 1)) |