View previous topic :: View next topic |
Author |
Message |
hasan
Joined: 02 May 2005 Posts: 58
|
Posted: Fri Aug 04, 2006 12:25 am Post subject: new import syntax |
|
|
I took a stab at it and made a little modification to the source code of build, namely the function doImport in file source.d line 1163:
Code: |
void doImport (in char[] pFileText, inout int pPos)
{
char[] lCurrentToken;
char[] lModName;
int lSavedPos;
while ((lSavedPos = pPos,
lCurrentToken = GetNextToken (pFileText, pPos)) !is null
&& (lCurrentToken != ";"))
{
if ( (lCurrentToken == ",") && (lModName.length > 0)) {
mReferencedImports ~= ModuleToFilename(lModName);
lModName = "";
}
else if ( (lCurrentToken == "=") && (lModName.length > 0))
{
lModName = "";
}
else if( (lCurrentToken == ":") )
{
break;
}
else {
lModName ~= lCurrentToken;
}
}
// Don't forget the last one!
if (lModName.length > 0) {
mReferencedImports ~= ModuleToFilename(lModName);
}
if (lCurrentToken == ";")
pPos = lSavedPos;
}
|
Compiled and tested it on a couple of files and it seems to work. |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Fri Aug 04, 2006 2:00 am Post subject: Re: new import syntax |
|
|
hasan wrote: | I took a stab at it and made a little modification to the source code of build, namely the function doImport in file source.d line 1163:
...
Compiled and tested it on a couple of files and it seems to work. |
Thanks.
I was planning to work on this tonight so I can release the next version this weekend. You have saved me some valuable time. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
hasan
Joined: 02 May 2005 Posts: 58
|
Posted: Fri Aug 04, 2006 2:25 am Post subject: Re: new import syntax |
|
|
Derek Parnell wrote: | hasan wrote: | I took a stab at it and made a little modification to the source code of build, namely the function doImport in file source.d line 1163:
...
Compiled and tested it on a couple of files and it seems to work. |
Thanks.
I was planning to work on this tonight so I can release the next version this weekend. You have saved me some valuable time. |
You're welcome!
But please be aware that I didn't test it very much .. so you still have to waste time testing it |
|
Back to top |
|
|
|