Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Re: todo marker question/problem

Hi,

IMHO multi-line comments should be handled in another class, e.g. AdvancedTodoTaskParser.
TodoTaskSimpleParser was not designed to handle all possible languages - it is just the simplest possible implementation.

Javascript has two types of comments //... and /*...*/
PHP has three //... and #... and /*...*/

Also, in PHP you can detect multi-line string literals without AST - just skip everything between quotes.
Javascript seems to have no multi-line literals, but I could be wrong.

Alex

----- Original Message -----
From: "Roy Ganor" <roy@xxxxxxxx>
To: "DLTK Developer Discussions" <dltk-dev@xxxxxxxxxxx>
Cc: "Eden Klein" <eden@xxxxxxxx>
Sent: Tuesday, September 23, 2008 3:29:31 AM GMT +06:00 Almaty, Novosibirsk
Subject: RE: [Dltk-dev] Re: todo marker question/problem





Hi, 

In addition there are languages that support todo markers in multi-line comments. For example: 

/** 

* TODO example 

*/ 



Eden is going to help on this issue so maybe she can extend the basic functionality to get the comment triggers for single and multi line comments. 



- Roy 






From: dltk-dev-bounces@xxxxxxxxxxx [mailto:dltk-dev-bounces@xxxxxxxxxxx] On Behalf Of Jae Gangemi 
Sent: Monday, September 22, 2008 10:47 PM 
To: DLTK Developer Discussions 
Subject: [Dltk-dev] Re: todo marker question/problem 





i have another question/issue regarding this... 

it seems that the TodoTaskSimpleParser (and the TodoTaskAstParser) is looking to see if the '#' character is the start of the comment string, and the '#' value is hard coded. while this is the comment character of choice for most scripting languages, this does not apply to javascript. 

it's easy enough for me to pull out that value and expose it as a method that could be overridden in the event that a scripting language uses some other character then '#' to indicate a comment, but i am not sure what to do about the javascript case, since comments are defined using '//' 

i'm thinking the best approach be to just have the comment be returned as a string, and then convert that string to a char array and compare the first X characters of the line content w/ the characters that compose the comment indicator. i could also convert the line contents back into a string and just call 'startsWith', passing the comment string, but that is probably no good performance wise. 

for now i am going to go with the first approach so i can get everything working - if someone has a better way to deal w/ this let me know and i'll make the appropriate adjustments. 

it's nice to be working on things again, if only there were more hours in my day... 

-- 
-jae 
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top