需要缩进测试员(Prothon) [英] Indent testers needed (Prothon)

查看:88
本文介绍了需要缩进测试员(Prothon)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们很自豪地说,Prothon已经从缩进的空间/标签火焰中成长为
战争阶段,并且已经进行了更为认真的讨论。


我们已决定允许基于空格的缩进和基于制表符的缩进,但不允许在同一个文件中使用

。我们还在行中添加了一些改进

continuation(请参阅消息末尾的算法)。


因为有数以万计的消息这里关于空格与标签的clpy

和Guido已经表示他想删除标签支持,我想也许有些

你可能会帮助我们测试我们的实现缩进算法。


我可以让一些太空爱好者和标签爱好者下载这个窗口

可执行文件并告诉我们这是否让他们感到高兴?如果你保持你的Python

代码简单且没有类语句,你就不必学习Prothon来试试它。您不能使用交互式控制台来评估算法,

您需要编写* .pr代码文件并运行它们。注意:这不是真正的Prothon版本。它还没有通过正常的测试。仅使用

进行缩进测试。


zip文件(350K)位于:

http://prothon.org/pub/prothon/Proth...b255- win32.zip


解压缩将创建名为win32的文件夹的文件。将.pr文件

放入该文件夹。打开dos命令窗口。 CD到win32文件夹并以.pr文件名运行

prothon.exe文件:

prothon.exe code.pr


功能:


1)您必须在任何一个文件中仅使用制表符或仅使用空格来缩进。你好b / b
不能混用它们。


2)每个缩进级别的字符数可以超过

之前的级别,您是否使用制表符或空格。如果你回到

左边的dedent,你的列位置与上面的任何级别不匹配,

你将得到一个词法分析器错误。


3)如果你将缩进级别增加到上一行甚至

一个空格,并且前一行不以冒号结尾,那么新行

将被视为前一行的延续。


4)如果一行包含有效(未引用或注释)(,{,或[

没有匹配的结束字符,那么下面的行总是一个

延续,无论下面的行包含什么。


5)那里仍然支持使用尾部反斜杠(\)来表示下一行是延续的

。如果

每个人都同意这样做,这可能会在将来删除。

We''re proud to say that Prothon has grown out of the indent space/tab flame
war stage and has moved on to more serious discussions.

We''ve decided to allow space-based indents and tab-based indents but not in
the same file. We are also adding some improvements in the area of line
continuations (see the algorithm at the end of the message).

Since there were zillions of messages here on c.l.py about spaces vs. tabs
and Guido has said he wants to remove tab support, I thought maybe some of
you might help us test our implementation of this indentation algorithm.

Can I get a few space lovers and tab lovers to download this windows
executable and tell us if this makes them happy? If you keep your Python
code simple and free of class statements, you don''t have to learn Prothon to
try it. You can''t use the interactive console to evaluate the algorithm,
you will need to write *.pr code files and run them. Note: This is not a
real Prothon release. It has not been through normal testing. Use it only
for indent testing.

The zip file (350K) is at:

http://prothon.org/pub/prothon/Proth...b255-win32.zip

Unzip the file which will make a folder called win32. Drop your .pr file
into the folder. Open a dos command window. CD to the win32 folder and run
the prothon.exe file with the .pr file name:

prothon.exe code.pr

Features:

1) You must use only tabs or only spaces for indents in any one file. You
cannot mix them.

2) Each indent level can have any number of characters more than the
previous level, whether you are using tabs or spaces. If you drop back to
the left to dedent, and your column position does not match any level above,
you will get a lexer error.

3) If you increase the indentation level above the previous line by even
one space, and that previous line does not end in a colon, then the new line
will be considered a continuation of the previous line.

4) If a line contains an active (not quoted or commented) (, {, or [
without a matching end character, then the following line is always a
continuation, no matter what that following line contains.

5) There is still support for using the trailing backslash ( \ ) to indicate
that the next line is a continuation. This may be removed in the future if
everyone agrees to do so.

推荐答案

Mark Hahn写道:
Mark Hahn wrote:
我们很自豪地说,Prothon已经从缩进的空间/标签火焰战争阶段发展而来,并且已经进行了更为认真的讨论。

我们已决定允许基于空格的缩进和基于标签的缩进,但不允许在同一个文件中。
We''re proud to say that Prothon has grown out of the indent space/tab flame
war stage and has moved on to more serious discussions.

We''ve decided to allow space-based indents and tab-based indents but not in
the same file.




我' (谢天谢地)错过了与Prothon有关的关于缩进的所有相关战争,

清楚,但我不得不问,这不是解决方案。相当错误的

还在吗?


如何从一个文件中复制粘贴(用空格完成)

到另一个使用标签?有点压缩一个人的风格

那里,我想......


只是一个想法。

我听说谣言Python正在走向没有标签,期间。为什么不只是

简化每个人的生活,并为Prothon做同样的事情,并在过去留下

整个问题。在一年之内,无论如何都没有人会抱怨他们心爱的标签。


(哦......不会再发生另一场火焰战争了开始?:-)我想我会

跳过它...我只是想提出第一点。并且应该

已经停在那里。)


-Peter



I''ve (thankfully) missed all the Prothon-related wars about indentation,
clearly, but I have to ask, isn''t this "solution" rather ill-conceived
still?

What about copy-and-paste from one file (which was done with spaces)
to another which is using tabs? Kind of puts a crimp in one''s style
there, I would think...

Just a thought.

I heard a rumour Python is heading for "no tabs", period. Why not just
simplify everyone''s life and do the same for Prothon, and leave the
whole darned issue in the past. In a year no one will be complaining
about their beloved tabs anyway...

(Oooh... won''t that get another flame war started? :-) I think I''ll
skip it... I just wanted to make the first point. And should probably
have stopped there.)

-Peter


这有点过早了。我们的一些测试用例会出现缩进错误。

我会在准备好测试时发布另一个文件。


同时评论我们的预期解决方案非常感谢。
This was a bit premature. Some of our test cases give indentation errors.
I''ll post another file when it is really ready for testing.

Meanwhile comments on our intended solution would be greatly appreciated.


" Peter Hansen" < PE *** @ engcorp.com>写了...
"Peter Hansen" <pe***@engcorp.com> wrote ...
我听说谣言Python正朝着没有标签的方向前进。为什么不简单地简化每个人的生活,为Prothon做同样的事情,并在过去留下完整的问题。


我第一次说标签只是因为我是一个标签爱好者而且标签仇恨出来了

并且钉在十字架上。正因为如此,我发现Guido

想要从Python中获取标签这一事实,我说我们只会进行空间分析然后

太空仇恨做了同样的事。我不认为Guido有机会从Python获得标签支持。

一年内没有人会抱怨他们的无论如何,心爱的标签...
I heard a rumour Python is heading for "no tabs", period. Why not just
simplify everyone''s life and do the same for Prothon, and leave the
whole darned issue in the past.
I first said tabs-only since I''m a tabs lover and the tabs-haters came out
and crucified me. Because of that and the fact that I found out that Guido
wants to pull tabs from Python, I said we were going to spaces-only and then
the space-haters did the same. I don''t think Guido has a chance in hell of
ever pulling tab support from Python.
In a year no one will be complaining
about their beloved tabs anyway...




是的(巨大的笑声)。



Yeah right (giant laugh).


这篇关于需要缩进测试员(Prothon)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆