View unanswered posts | View active topics



Reply to topic  [ 4 posts ] 
bug fix: FD does not replace $(ProjectID) in templates 
Author Message
Member

Joined: Mon Jul 02, 2012 9:50 am
Posts: 2
Reply with quote
Hi Mika or Philippe or any developer of FD,

Bug:

FlashDeveloper v4.0.4 does not replace some template variables in template files on Turkish Windows.

if variable includes the "i" or "I" letter (i.e. $(ProjectID), $(AppDir), $(CBI)...) then replace failed.
Because UpperCase of "i" on Turkish windows is "İ" not "I"...

Bug fix for new project template files (Runs on Project->New) in "ProjectManager.dll";
@FD4\External\Plugins\ProjectManager\Helpers\ProjectCreator.cs

1- line 27:
Code:
/*old*/ private static Regex reArgs = new Regex("\\$\\(([a-z$]+)\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
/*new*/ private static Regex reArgs = new Regex("\\$\\(([a-z$]+)\\)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled);


2- line 168:
Code:
/*old*/ string name = match.Groups[1].Value.ToUpper();
/*new*/ string name = match.Groups[1].Value.ToUpper(CultureInfo.InvariantCulture);


Bug fix for new file template files (Runs on File->New) in "FlashDevelop.exe";
@"FD4_Source\FD4\FlashDevelop\Utilities\ArgsProcessor.cs"

1- line 24:
Code:
/*old*/ private static Regex reArgs = new Regex("\\$\\(([a-z$]+)\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
/*new*/ private static Regex reArgs = new Regex("\\$\\(([a-z$]+)\\)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled);


2- line 30:
Code:
/*old*/ private static Regex reUserArgs = new Regex("\\$\\$\\(([a-z0-9]+)\\=?([^\\)]+)?\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
/*new*/ private static Regex reUserArgs = new Regex("\\$\\$\\(([a-z0-9]+)\\=?([^\\)]+)?\\)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled);


3- line 31:
Code:
/*old*/ private static Regex reSpecialArgs = new Regex("\\$\\$\\(\\#([a-z]+)\\#=?([^\\)]+)?\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
/*new*/ private static Regex reSpecialArgs = new Regex("\\$\\$\\(\\#([a-z]+)\\#=?([^\\)]+)?\\)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled);


4- line 32:
Code:
/*old*/ private static Regex reEnvArgs = new Regex("\\$\\$\\(\\%([a-z]+)\\%\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
/*new*/ private static Regex reEnvArgs = new Regex("\\$\\$\\(\\%([a-z]+)\\%\\)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled);


5- line 433:
Code:
/*old*/ switch (match.Groups[1].Value.ToUpper())
/*new*/ switch (match.Groups[1].Value.ToUpper(System.Globalization.CultureInfo.InvariantCulture))


Shortly: Please use InvariantCulture on UpperCase funcs.
I compiled and tested above codes, the problem fixed. Can you fix this bug in next release of FD please?

Thank you.


Mon Jul 02, 2012 9:59 am
Profile
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 3046
Location: Finland
Reply with quote
Applied to SVN, thanks.


Mon Aug 20, 2012 7:02 am
Profile WWW
Member

Joined: Mon Jul 02, 2012 9:50 am
Posts: 2
Reply with quote
Hi,
FD doesn't replace some variables in code snippets on Turkish Windows.

Fix

file:
External\Plugins\ASCompletion\Completion\ArgumentsProcessor.cs

line 18:
Code:
/*old*/ new Regex("\\$\\((?<name>[a-z]+)\\)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
/*new*/ new Regex("\\$\\((?<name>[a-z]+)\\)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);


Thank you.


Fri Jun 17, 2016 2:22 pm
Profile
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 3046
Location: Finland
Reply with quote
Added.


Fri Aug 26, 2016 1:00 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.