On Thu, 6 Jun 2013 14:39:58 +0200 (CEST)
Johannes Meixner
Hello,
On Jun 6 11:16 Ladislav Slezak wrote (excerpt and rearranged):
Dne 6.6.2013 10:19, Jiri Srain napsal(a):
the comments are one of the tasks, which is currently being worked on. So you re right, we intend to translate the comments as well.
... Of course, comments are essential part of the code so we switch to ruby only after this is solved. This is a blocker for us.
Then I also appreciate your switch from YCP to Ruby very much!
I look forward to having openSUSE 13.1 (and then also SLE12) without YCP!
Thanks for support. I hope result will satisfy you.
Yes, Josef is working on it, the problem is that the YCP parser does not care about comments and throws them away. The major problem is how to bind the comments properly with the code, you need to know the context around the comment to decide correctly and that's a problem during parsing (you do not know what will be the next node until it's actually parsed...)
I am a total layman regarding such issues nevertheless I dare to make a comment:
What about changing YCP comments into actual YCP code (e.g. change YCP comments into YCP strings using special string variable names) so that it becomes translated into actual Ruby code (e.g. into Ruby strings) and then change the Ruby strings with those special string variable names back to Ruby comments?
Currently we experiment with two different approach. One is based on changed grammar where comments are regular token and the second one is based on enhancing tokens from lexer. Your proposal sound interesting, but there is problem, that you cannot easily change comments into statement like string ___comment = "something"; because comments occur on various places like a && /* comment */ b so replacing such comment into string statement will be quite problematic. We plan to make decision about approach and start with early attempts to translate comments next week.
I assume this might result a quoting hell when YCP comments contain YCP code (e.g. YCP code that is commented out).
Yes, dead code is not nice in comments, but we agreed that we don't investigate semantics of current code and just transform it into ruby comments. Josef
Kind Regards Johannes Meixner
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org