Also fixed some grammar in the station blueprint code.
Conflicts:
code/game/objects/items/blueprints.dm
code/game/objects/items/devices/uplinks.dm
code/modules/admin/verbs/debug.dm
code/modules/clothing/masks/gasmask.dm
code/modules/detectivework/scanner.dm
code/modules/flufftext/TextFilters.dm
code/modules/mob/living/carbon/human/say.dm
code/modules/mob/living/silicon/ai/say.dm
Source-code for the dll can be found here under LGPL license:
https://github.com/Carn/bygex
It is merely an interface to boost::regex. It uses perl syntax (non-recursive).
Guidelines for use:
var/datum/regex/Rgx = regex_findall(haystack, regex_expression)
for(var/i=1, i<=Rgx.matches.len, ++i)
world << Rgx.str(i)
The implementation is different to the one other regex-in-byond library I found. This implementation only returns a string containing the position and length of each match and submatch. This uses far less memory than also passing back the matched strings (especially in large files like dream-maker maps).
Note: Regex indexes begin at 1 (since byond lists begin at 1), unlike traditional regex. If we are using a procedure such as regex_findall(), with 3 sub-expressions, match 1 will be the overall match. Match 2 will be subexpression 1, match 3 will be subexpression 2.... Match 5 will be the overall match of the next match...and so on. To ease use, there is /datum/regex/var/anchors which is a numerical value which can be used inside loops like so:
for(var/i=1, i<=Rgx.matches.len, i+=Rgx.anchors)
world << Rgx.str(i+1)
This will print the first submatch of each match to world.
>dd_replacetext and dd_replacetext_case are now replacetext and replacetextEx respectively.
>replacetext and replacetextEx works using strings only; it doesn't convert it into a list and then back into a string.
Fixes some dumb-dumbs in textlist and text2listEx
> "<" where there should be a "<="
> no else case for when the separator is longer than the text (causing empty lists to be returned)
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4971 316c924e-a436-60f5-8080-3fe189b3f50e
>Replaced dd_text2list, dd_text2listcase, tg_text2listcase and tg_text2list with text2list and text2listEx. text2list will return a list of each and every character in the string if you set separator=""
>added return_file_text(filepath) which returns text from a file after doing some checks: does the file exist? is the file empty? It prints helpful error messages to the world.log if it runs into problems
>Replaced dd_file2list(filepath, seperator) with file2list(filepath, seperator). It just calls text2list(return_file_text(filepath), seperator). rather than copypasta
>Replaced time_stamp() so it's not as retarded
>Lots of the world setup stuff uses file2list now, rather than file2text -> sanity -> text2list
>Added error() warning() testing() procs. These print messages to world.log with a prefix. e.g. ## ERROR: msg.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4948 316c924e-a436-60f5-8080-3fe189b3f50e