summary refs log tree commit diff stats
path: root/lib/pure/strutils.nim
Commit message (Collapse)AuthorAgeFilesLines
* strutils.nim: fixes the indentation of formatEngAraq2019-04-101-5/+5
|
* Fix dead sequtils link (#10960) [ci skip]MrZoraman2019-04-041-1/+1
|
* strutils: document `parseEnum` [ci skip]narimiran2019-02-251-0/+23
|
* fixes a critical strutils bug [backport]Araq2019-02-191-1/+1
|
* fixes #6832Araq2019-02-191-5/+2
|
* documentation: remove author field [ci skip]narimiran2019-01-171-2/+0
|
* better docs: strutilsnarimiran2019-01-161-768/+1265
|
* strutils: minor code cleanupAraq2018-12-191-1/+0
|
* removes deprecated T/P typesAraq2018-11-161-2/+0
|
* better implementation for wrapWordsAraq2018-11-081-1/+2
|
* stripLineEnd aka chomp (#9623)Timothee Cour2018-11-051-0/+1
|
* Add 'dedent' to documentation index (#9615)Federico Ceratto2018-11-041-0/+1
|
* changelog entryArne Döring2018-10-311-1/+1
|
* fix typoArne Döring2018-10-311-1/+1
|
* fixes #9557Arne Döring2018-10-301-32/+34
|
* Fixes #9525 (#9526)Neelesh Chandola2018-10-281-1/+1
|
* Some documentation added to strutils (#9379)eqperes2018-10-161-2/+102
| | | | | | | | | | | | | | | | * wip documentation strutils * some runnableExamples in strutils * assert -> doAssert * corrected doc for abbrev; some more runnable examples * runnableExamples for join * fix c&p error * corrections
* math.round is not needed in strutils (#9383)skilchen2018-10-161-5/+4
|
* Add strip() example (#8002)Federico Ceratto2018-10-141-0/+2
|
* struils: don't use the deprecated accumulateResultAndreas Rumpf2018-10-141-8/+12
|
* added new editdistance stdlib module, deprecated strutils.editDistance, refs ↵Andreas Rumpf2018-10-141-1/+4
| | | | #6301
* strutils/unicode: deprecate isLower and friends operating on complete ↵Andreas Rumpf2018-10-141-45/+12
| | | | strings; fixes #7963 properly
* add strutils.stripLineEnd (#9346)Timothee Cour2018-10-131-0/+23
|
* Proposed solution for issue #8919 (#9280)eqperes2018-10-121-0/+2
| | | | | | * Proposed solution for issue #8919 * count sub/subs must be non-empty
* fixes #8911Andreas Rumpf2018-09-161-7/+7
|
* Fix too broad generic match for toHex (#8889)LemonBoy2018-09-051-1/+1
| | | Fixes #8865
* strutils: don't deprecate escape/unescape, too much code uses itAraq2018-08-311-6/+2
|
* Merge branch 'devel' into araq-miscAraq2018-08-131-11/+20
|\
| * Fixed 7478: splitLines keepEol option (#8621)Iván Montes2018-08-131-12/+21
| |
* | fixes more nil string bugsAraq2018-08-081-4/+6
| |
* | strutils: minor code cleanupAraq2018-08-081-4/+1
|/
* Testament should run tests with no action (#8232)genotrance2018-07-081-3/+6
| | | | | | * Testament should run tests with no action * Fix strutils tests for JS
* Workaround VM bug in strutilsDominik Picheta2018-06-171-2/+3
|
* Exports unicode.toUpper/toLower in strutils module.Dominik Picheta2018-06-171-0/+3
|
* Add parse bin int, fixes #8018 (#8020)Vindaar2018-06-131-39/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * clarify `parseHexInt`, `parseOctInt` docstring and exception msgs * add `parseBinInt` based on `parseutil.parseBin` implementation Adds a `parseBinInt`, which parses a binary integer string and returns it as an integer. This is based on the implementation of `parseutil.parseBin`, removing the unnecessary parts. * add tests for all `parse(Hex|Oct|Bin)Int` procs * replace `parse*Int` proc impls by call to parseutil procs Replaces the `parse(Hex|Oct|Bin)Int` procedure implementation by calls to the `parseutil` procs, which receive a mutable argument. Has the main advantage that the empty string as well as a "prefix only" string, e.g. "0x" counts as an invalid integer. Also moves the `parseOctInt` proc further up in the file so that all `parse` procs are below one another. * replace `var L` by `let L` in `parse` procs There's no reason for the usage of `var` here. * add `maxLen` optional arg for `parseutil.parse(Oct|Bin)` Plus small change to test cases. * update changelog about `parse*Int` procs * fix `rejectParse` template in `tstrutils` * make sure only `s.len` chars are parsed, if `maxLen+start` > s.len Fixes a previous bug in `parseHex` (and now affected `parseOct` and `parseBin`), which allowed to set `start + maxLen` to be larger than the strings length. This resulted in an out of bounds access. * move `parse*Int` proc change to breaking changes, add double `
* Make isUpper (and variants) work for strings with non-alpha charsKaushal Modi2018-06-081-19/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The other variants are isLower, isUpperAscii and isLowerAscii Fixes https://github.com/nim-lang/Nim/issues/7963. This commit changes the behavior and signatures of: - isUpper, isLower in the unicode module - isUpperAscii, isLowerAscii in the strutils module A second mandatory parameter skipNonAlpha is added to these 4 procs. (This change affects only for the case where the input is a *string*.) --- With skipNonAlpha set to true, the behavior mimics the Python isupper and islower behavior i.e. non-alphabetic chars/runes are ignored when checking if the string is upper-case or lower-case. Before this commit: doAssert(not isUpper("A B")) After this commit: doAssert(not isUpper("A B", false)) <-- old behavior doAssert isUpper("A B", true) Below two are equivalent: isUpper("A B", true) isAlpha("A B") and isUpper("A B", false) .. and the similar for other 3 procs.
* fix handling of default precision in formatBiggestFloat for the js backend ↵skilchen2018-06-011-0/+7
| | | | (#7928)
* bugfix: strutils.find was broken for strings with uneven number of charsZahary Karadjov2018-05-071-248/+284
| | | | | | | | | | | | For some reason, the problem was manifesting only inside the VM, it was detecting an attempt to read past the string end (i.e. the formerly accessible null byte). To catch such errors, strutils now performs static tests too. I've solved the problem by re-implementing the Boyer-Moore algotihm in a cleaner way and I took the opportunity to make some other optimisations to strutils.
* make more tests greenAndreas Rumpf2018-04-301-1/+1
|
* strutils: code cleanups and do not rely on the terminating binary zero anymoreAndreas Rumpf2018-04-281-289/+94
|
* Don't escape multibyte characters (#7570)Oscar Nihlgård2018-04-231-3/+14
|
* remove dead code elimination option (#7669)Jacek Sieka2018-04-231-1/+1
|
* fixes #7507Araq2018-04-191-3/+11
|
* move eqIdent to vm.nim (#7585)Arne Döring2018-04-151-5/+6
| | | | | | * Strutils comment changes. * fix typo
* fixes #6205Andreas Rumpf2018-04-141-19/+19
|
* FIXUP: Removed +1 causing substr slicing to skip chars on first iteration of ↵ryanc-signiq2018-03-081-1/+6
| | | | while loop (#7312)
* strutils.strip: improve the documentation; fixes #7159Andreas Rumpf2018-03-051-1/+3
|
* fixes #7293Andreas Rumpf2018-03-051-3/+3
|
* Merge pull request #6517 from FedericoCeratto/hexstrDominik Picheta2018-01-261-0/+50
|\ | | | | Add string-to-hex and back conversions
| * Add string-to-hex and back conversionsFederico Ceratto2017-11-271-0/+50
| | | | | | | | Add parseHexStr and toHex and tests.
056'>1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363