mines 183 lines, it will end up being about 210 when im done.
that funny all i have left to do is the keyword highlighting to.
mines 183 lines, it will end up being about 210 when im done.
that funny all i have left to do is the keyword highlighting to.
Last edited by ILoveVectors; 08-25-2005 at 10:28 PM.
Although half my code is comments lol...
i will post my code when i have finished so it can be critized and
what not, and shortly after that a html version will be released.
im sure some of you have been wondering when i was going to
post a new better version, well today is that day.
that my test file, and that how it was output.Code:#include <iostream> #include<iostream> #define #define other stuff #define masturabation("woot") // multi-line single-line comment \ this is a /* a midline comment */ continuation of the comment /* a mutli lined comment which doesnt end till here */ char ch = '\\'; const char *str = "\" \ blah"; const char *str2 = "\"", str3 = "\""; // and this is bool another comment /*/ there is stuff in between here /*/ /*/stuff inbetween here as well/*/ /*//*/ /*/ /*/ /* "a comment within a quote" */ /* another bool comment */ bool aaa = true; char c = '\''; char c1 = '\'\'\'\'\'\'\\\\'; char c1 = '\'\'\'\'\'\'\\'; int num; double dnum; while() { } for(int i = 6, int x = 7; i != x; i++) { }
my source at this time is : 193 lines (uncommented)
it can be reduced to about 180 with a few changes,
but ill work on that later. if you choose to check this
out and have any question on what does what
i will happily answer just post the section
you are referring to and your questions.
the following will be a rar file of just the source,
and then a rar of everything, thanks!
[EDIT]
i found ONE bug, ill work on it later, when im shorting the code.
also for the one post earlier, in the C code with unicode string,
i didnt supply support for it because, it C, and I guess now
would be a good time to point out i was designing this for C++
code. thanks for your input though. if you know of something
similar to this in c++ let me know.
[/EDIT]
Last edited by ILoveVectors; 08-27-2005 at 06:06 PM.
last update i will just be posting the main code,
i could not find any bug with my test file with
this version if you come across one please let me know!
i went ahead and included the header fiel just incase
you guys didnt want to dl the rar files. but no changes
have been made to the header file since last release.
I've tried running your code here, and all I get is a hanging program...seems I'm getting stuck in an infinite loop...I stepped through and I can't explain it...
The cursor hits the Blue bracket...executes the red section, but then once it hits the YellowGreen bracket, it jumps back up to the Blue bracket...Code:... while(getline(syntax, keyword, '='), getline(syntax, keyreplace, '\n')) { key.push_back(keyword); replace.push_back(keyreplace); } syntax.close(); ifstream in("source.txt"); while( getline(in , sourcespace , '\n' ) ) { source += sourcespace + "\n"; } ...
Any thoughts?
Pentium 4 - 2.0GHz, 512MB RAM
NVIDIA GeForce4 MX 440
WinXP
Visual Studio .Net 2003
DX9 October 2004 Update (R.I.P. VC++ 6.0 Compatability)
not at the momment have you had any other problems, with any
other code? also what makes you conclude this is what is
happening?
[EDIT]
i have found the where the problem is being generated
it has to do with this section of code
err by that i mean this section of code is causing the colorizeCode:while( (definefind = source.find("#", definefind+1)) != string::npos )
to f* up, but understanding the section of code has made me
realize where my error is.
i will have a update posted sometime tommorrow
[/EDIT]
Last edited by ILoveVectors; 08-28-2005 at 11:40 PM.
Okie dokes, can't wait :-) Until the boards implement something like this directly into the CODE tags, I look forward to using this whenever possible. From what I've seen so far though, nice work.
(And I stepped through the code in debug mode, line by line, and that's the sequence my code kept on running in. I just have no idea how to explain it though, it's the weirdest loop that isn't a loop that I've ever seen) :-)
Pentium 4 - 2.0GHz, 512MB RAM
NVIDIA GeForce4 MX 440
WinXP
Visual Studio .Net 2003
DX9 October 2004 Update (R.I.P. VC++ 6.0 Compatability)
lol unfourtantly, ive come across a mor emajor problem when trying to modify this and i located a even bugger bug.
i may once again end up rewritting this a different way
i had an idea for a way that would take even less code,
and alot less memory, not that it uses that much anyways.
also im fixing to be posting a contest in the contest section,
go try it out guys.
My code is ~700 lines long. JoshR, I read all my data in from a file. So then I can have a syntax file for the board, HTML, etc.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Why are you telling me? O does mine not do a file? well that was just a debug, I actually rewrote it and its only 400 lines and decided not to add the tags untill all zones are calculated and I wrote a function to combine close zones so when you have two #define lines, youll get one color tag for both. Another thing, my code highlights numbers which i suggest you incorporate (ilovevectors) its a nice addition. Also I implemented multiline preprocessor, multiline strings, multiline comments, and multiline characters (yes all those compile under my IDE's).
All I have to do is write a function to insert the tags and im done, then I will be doing exception handling. When I created the structure for the newest version i made sure to include the SYNTAXERROR enum, instead I will be throwing an exception that tells what line and position the quote or comment is that has a missing end etc...
Soooo all in all its going to be a powerfull program with added command line options like quickly adding keywords and output to screen or file etc...
Last edited by JoshR; 08-30-2005 at 12:15 AM.