@nosent and multiline comments bug

瀏覽次數:36 次
跳到第一則未讀訊息

vitalije

未讀,
2015年2月15日 下午1:11:002015/2/15
收件者:leo-e...@googlegroups.com
Hello,
I have updated my Leo installation yesterday and bumped in a bug with new @nosent code. Most of my files have been kept in @nosent nodes. Whenever I open leo file with @nosent nodes, Leo reports Recovered nodes. All those nodes are using multiline comments between @ and @c directives. With every opening Leo adds single line comments in front of those lines.

I have attached Leo-file which demonstrates the problem.
HTH
Vitalije
nosent-comment-bug.leo

vitalije

未讀,
2015年2月15日 下午1:14:402015/2/15
收件者:leo-e...@googlegroups.com
about my installation: Ubuntu 14.04

** isPython3: False
Leo 5.0-final, build 20150127110559, Tue, Jan 27, 2015 11:05:59 AM
Git repo info: branch = master, commit = f2ca65ecf8e8
Python 2.7.6, PyQt version 4.8.6
linux2

Vitalije

Edward K. Ream

未讀,
2015年2月15日 下午1:25:352015/2/15
收件者:leo-editor

​Thanks.  I'll look into this immediately.

Edward

Edward K. Ream

未讀,
2015年2月15日 下午1:39:392015/2/15
收件者:leo-editor
On Sun, Feb 15, 2015 at 12:11 PM, vitalije <vita...@gmail.com> wrote:
Hello,
I have updated my Leo installation yesterday and bumped in a bug with new @nosent code. Most of my files have been kept in @nosent nodes. Whenever I open leo file with @nosent nodes, Leo reports Recovered nodes. All those nodes are using multiline comments between @ and @c directives. With every opening Leo adds single line comments in front of those lines.

​This is a nasty problem.  It's been around since day one of the @shadow algorithm, but it's only been reported now. It will requires some kind of special case for @...@c.  I'll have to think about what is the best way to proceed.

Edward

vitalije

未讀,
2015年2月15日 下午1:47:382015/2/15
收件者:leo-e...@googlegroups.com


​This is a nasty problem.  It's been around since day one of the @shadow algorithm, but it's only been reported now. It will requires some kind of special case for @...@c.  I'll have to think about what is the best way to proceed.

Edward

Well, I could live without @ and @c, but it would be useful if Leo delete @ and @c lines and replace all those lines with properly language specific commented block.
Vitalije

Edward K. Ream

未讀,
2015年2月15日 下午1:53:592015/2/15
收件者:leo-e...@googlegroups.com
On Sunday, February 15, 2015 at 12:11:00 PM UTC-6, vitalije wrote:

I have updated my Leo installation yesterday and bumped in a bug with new @nosent code. Most of my files have been kept in @nosent nodes. Whenever I open leo file with @nosent nodes, Leo reports Recovered nodes. All those nodes are using multiline comments between @ and @c directives. With every opening Leo adds single line comments in front of those lines.

I think some kind of special case handling will be required, but it could be ugly and perhaps even dangerous.

I am wondering whether it might not be better simply to prohibit @...@c in @nosent files.  How odious would that be for you?

Edward

Edward K. Ream

未讀,
2015年2月15日 下午2:02:102015/2/15
收件者:leo-editor
On Sun, Feb 15, 2015 at 12:47 PM, vitalije <vita...@gmail.com> wrote:

Well, I could live without @ and @c, but it would be useful if Leo delete @ and @c lines and replace all those lines with properly language specific commented block.

​You answered my question before I asked it.

Alas, prohibiting @...@c is going to cause problems. For example, @rst nodes (not to be confused with @auto-rst nodes) use ​so-called "option doc parts" of the form::

    @ @rst-options
    ...rst3 options...
    @c

@rst nodes are valid in @nosent trees, so some kind of workaround is will be required.  Perhaps a post-pass after the update algorithm completes.  Perhaps some kind of hack to the op_replace handler.

Meh...

Edward

vitalije

未讀,
2015年2月15日 下午2:07:022015/2/15
收件者:leo-e...@googlegroups.com

I am wondering whether it might not be better simply to prohibit @...@c in @nosent files.  How odious would that be for you?

Edward
As I said, I could live with such restriction, but it would help if Leo change such blocks of code without user intervention. I think that no user using @nosent would object this Leo behaviour.

Edward K. Ream

未讀,
2015年2月15日 下午2:14:472015/2/15
收件者:leo-e...@googlegroups.com

On Sunday, February 15, 2015 at 1:07:02 PM UTC-6, vitalije wrote:

As I said, I could live with such restriction, but it would help if Leo change such blocks of code without user intervention. I think that no user using @nosent would object this Leo behaviour.

I agree completely.  It has just become clear to me that a post-pass after the update algorithm is the only good solution.  This will remove leading comment delimiters from @ (or @doc) to the next @c or the end of the node.  This should be easy and fast.

The new code will mean the end of x.check_output, a method that has already caused more harm than it is worth.  Indeed, both unit tests and the recovered nodes logic do better checks than does x.check_output.

I don't have time to fix this now, but I'll do so later today.

Edward

Edward K. Ream

未讀,
2015年2月16日 清晨5:26:562015/2/16
收件者:leo-editor
On Sun, Feb 15, 2015 at 1:14 PM, Edward K. Ream <edre...@gmail.com> wrote:
 
​...​
a post-pass after the update algorithm is the only good solution.

​As I have just written in another thread, Leo's @file read code probably already does such a post pass.  ​There is an Easter Egg convention that determines where newlines in @doc parts should be inserted.  Unless I am mistaken, this code also removes leading comment delims.  I'm not sure why the comment delims aren't being removed for @nosent, but there may be an easy fix. I'm on it.

Edward

Edward K. Ream

未讀,
2015年2月16日 清晨6:46:122015/2/16
收件者:leo-e...@googlegroups.com
On Sunday, February 15, 2015 at 12:11:00 PM UTC-6, vitalije wrote:

Whenever I open leo file with @nosent nodes, Leo reports Recovered nodes. All those nodes are using multiline comments between @ and @c directives. With every opening Leo adds single line comments in front of those lines.

This is an issue involving comment delims, that is, an initialization issue.  No post-pass will be needed.  I hope to have a fix soon.

Edward

Edward K. Ream

未讀,
2015年2月16日 上午8:37:222015/2/16
收件者:leo-e...@googlegroups.com

Fixed at 0fbcfab.  All tests pass, including some hand tests.  Please report further problems.

I should add a new unit test, but that is turning into a project...

Edward
回覆所有人
回覆作者
轉寄
0 則新訊息