做一个缓慢的错误奎因制造商!


38

作为他对“犯错误的原因” 的回答的一部分,@ Falko提出了以下算法:

如何在2分钟内创建自己的解决方案?

  1. 在您选择的IDE中打开一个新文件。
  2. 将头撞到前方的键盘上。
  3. 编译。
  4. 将代码替换为编译器错误消息。
  5. 重复步骤3和4,直到代码收敛。

我敢打赌,这样的程序在大多数情况下会很快终止!

任务

您的任务是证明他错了。

编写一个满足以下条件的完整程序:

  1. 在编译或解释时,它会生成一条错误消息,而在依次编​​译或解释时,它也会导致一条错误消息。

  2. 一遍又一遍地重复步骤1,最终将遇到一个固定点,即一个错误提示。

附加规则

  • 最终错误消息的长度必须为正。但是,以前的错误消息和原始的源代码可能为空。

  • 原始源代码的长度不得超过1024个字节。

  • 原始代码或任何步骤中生成的代码均不会产生非错误输出。

    输出必须清楚地标识为错误消息,由于语法错误,运行时错误,未定义引用等原因,必须由编译器/解释器生成输出。

  • 您的程序可能未收到任何输入或需要任何标志来产生循环。

  • 您的程序可能依赖于其语言或版本的特定实现。

计分

您的分数是您的源代码在生成错误提示之前需要执行的有限步骤。得分最高的提交者获胜。

原始源代码的长度将用作平局决胜局。越短越好。

Chicken中,该程序



生成以下错误消息:

TypeError: Cannot read property 'NaN' of undefined

如果反过来解释此错误消息,则会生成错误消息

Error on line 1: expected 'chicken'

如果反过来解释,它就会产生自己。

因此,空Chicken程序的得分为2。

反例

PHP代码

ab<?=c

生成错误消息

PHP Parse error:  syntax error, unexpected '?' in Command line code on line 1

在解释时会产生自身。

但是,第二个源代码将消息打印到STDOUT,从而使此序列无效。


11
此过程永远不会在Pyth中产生错误信息。它以重复周期结束,其每三个错误输出为Segmentation fault (core dumped)
2015年

4
@isaacg:实际上,它是循环的,很漂亮。
Alex A.

5
我相信这是第3000个问题,不包括已关闭或已锁定的问题。恭喜!:)
马丁·恩德

太糟糕了,C#无法做到这一点,因为编译器生成的错误行越来越长。
LegionMammal978

1
@IsmaelMiguel:我添加了最后两个迭代,以使其简短。
丹尼斯

Answers:


36

巴什,9223372036854775810

受Doorknob答案的启发。

a='"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #"'
i=2**63
eval $a

它应与一起运行bash < file.sh,或对每个程序使用相同的文件名,以消除错误消息中的不同文件名。

前几个错误是(带有LANG=C):

bash: line 3: 2>/dev/null;if(((i=9223372036854775807)>0));then declare -- a="\"2>/dev/null;if(((i=\$((i-1)))>0));then \$(declare -p a);\$a;else 1;fi #\"";"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory
bash: line 1: 2>/dev/null;if(((i=9223372036854775806)>0));then declare -- a="\"2>/dev/null;if(((i=\$((i-1)))>0));then \$(declare -p a);\$a;else 1;fi #\"";"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory
bash: line 1: 2>/dev/null;if(((i=9223372036854775805)>0));then declare -- a="\"2>/dev/null;if(((i=\$((i-1)))>0));then \$(declare -p a);\$a;else 1;fi #\"";"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory

最后:

bash: line 1: 2>/dev/null;if(((i=0)>0));then declare -- a="\"2>/dev/null;if(((i=\$((i-1)))>0));then \$(declare -p a);\$a;else 1;fi #\"";"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory
bash: line 1: 1: command not found
bash: line 1: bash:: command not found

这是一个错误提示。


7
这可能与我们在64位计算机上获得的数据一样高。打的好。
丹尼斯

@Dennis如果我使用bc或编写自己的递减代码可能会更高。
jimmy23013 2015年

3
@Dennis已编辑,以使错误适合64位计算机的最大文件大小。
jimmy23013 2015年

2
与其他答案相比,这是非常荒谬的高分。公平地说,Falko确实说了“大多数情况”(尽管确实提供了至少9223372036854775000,且得分超过800。)
PyRulez 2015年

也许还要添加最后几个(就在成为奎因之前)?
圣保罗Ebermann

15

点0.15.05.29,超过10 100,000

从技术上讲无效,因为它需要-w警告输出标志。话虽这么说,Pip在设计上不会显示任何运行时错误,除非它们实际上使程序崩溃(例如,无限递归);这段代码的问题是其他语言肯定会抱怨的事情。

i:5**6**7d:"i:1d: Ssi?dRo--iRsRPda"Ssi?dRo--iRsRPda

确切的步骤数仅取决于分配给的值i,因此它可以任意大(直到Python解释器用尽内存)。而且,完成上述序列所需的时间将比宇宙的时间长。(该问题确实指定了“慢”!)

说明:

在发现错误之前,我先对解释器进行了一些梳理,该错误使我可以将任意代码放入警告消息中。在那之后,它实际上是在修改标准的奎因技术。此处的示例使用- i5进行解释。

i:5d:"i:1d: Ssi?dRo--iRsRPda"Ssi?dRo--iRsRPda

设置之后i,将一个字符串存储在其中d,然后尝试执行Swap语句。交换期望两个变量(更准确地说是左值)。s很好,但是第二个表达式是i?dRo--iRsRPda。如果i为true(出于我们的目的,为非零),则三进制求值为dRo--iRsRPdd从更早的时候开始使用,以形成一个近似奎因-仅i递减。此表达式不是左值,因此Pip抱怨:

Attempting to swap non-lvalue i:4d:"i:1d: Ssi?dRo--iRsRPda"Ssi?dRo--iRsRPda

...然后重新开始整个事情。(Attempting to swap non-lvalue是一堆no-ops:At计算的ASCII值t = 10n-l减去换行符减去空列表的每个值,所有小写字母都只是变量。)

该过程一直以类似的方式一直持续到:

Attempting to swap non-lvalue i:0d:"i:1d: Ssi?dRo--iRsRPda"Ssi?dRo--iRsRPda

运行该命令时,i现在为false。三元表达式的计算结果为else分支-这a是一个左值。因此,交换不再抱怨了。相反,我们得到:

Referencing uninitialized variable a

最后,运行此命令时,我们会遇到一个实际的语法错误:

R is not a unary operator
Fatal error while parsing, execution aborted.

...此时,由于“程序”以开头R,因此Pip将继续抱怨R永远不是一元运算符。


最好的不使用的解决方案-w是长度3:

$~

While scanning, ignored unrecognized character: '~'
Missing operator for $ meta-operator? Got None instead
Fatal error while parsing, execution aborted.

Missing operator for $ meta-operator? Got m instead
Fatal error while parsing, execution aborted.

M is not a unary operator
Fatal error while parsing, execution aborted.

皮普-w根据荟萃共识算作一种编程语言
MilkyWay90

@ MilkyWay90好点,尽管我认为此问题的措辞会覆盖默认值(“您的程序可能不需要...需要任何标志来产生循环”)。无论哪种方式对我来说都没关系-在任何情况下我的解决方案都广为接受。:)
DLosc

好的,我现在看到了
MilkyWay90

13

朱莉娅3岁

一个简单的方法只是使球滚动...

初始程序:

inquisition

错误1:

inquisition not defined

它可能没有定义,但是如果是西班牙文,这也是意外的。没有人期待西班牙宗教裁判所。

错误2:

syntax: extra token "not" after end of expression

错误3:

syntax: extra token "token" after end of expression

当作为程序提交时,第三条错误消息会产生相同的错误,因此得分为3。

工作正在进行中!当然我可以做得比3好。


2
无关,但值得一看(西班牙语字幕):youtube.com/watch?v = 8mzfyVluiIU或(英语字幕,质量更好):youtube.com/watch?
v

2
@IsmaelMiguel最肯定是相关的。:)
Alex A.

8

R,5

初始程序:

1i*"5"

错误1:

Error in (0+1i) * "5" : non-numeric argument to binary operator

错误2:

Error: unexpected 'in' in "Error in"

错误3:

Error: unexpected string constant in "Error 'in'"

错误4:

Error: unexpected symbol in "Error: unexpected string"

错误5(Quine):

Error: unexpected symbol in "Error: unexpected symbol"

6

重击3

cp

非常基本的shell脚本对其进行测试:

llama@llama:~$ s=$(bash -c 'cp' 2>&1); olds=asdf; while [ "$s" != "$olds" ]; do echo $s; echo '-----'; olds=$s; s=$(bash -c $s 2>&1); done 
cp: missing file operand
Try 'cp --help' for more information.
-----
bash: cp:: command not found
bash: line 1: Try: command not found
-----
bash: bash:: command not found
bash: line 1: bash:: command not found
-----

您的测试脚本不会忽略stdout。如果有stdoutstderr,则无法正常工作。
wizzwizz4 '02

@ wizzwizz4挑战禁止无错误输出。
丹尼斯

@丹尼斯好点。但是...用户并不总是像程序员一样好。(即使用户程序员,他们也可能不是一个有经验的人。)
wizzwizz4

5

红宝石,5岁

初始程序

q

1个

undefined local variable or method `q' for #<Context:0x00000001045d70>
(repl):1:in `initialize'

2

(repl):2: syntax error, unexpected tIDENTIFIER, expecting end-of-input
(repl):1:in `initialize'
                       ^

3

(repl):1: syntax error, unexpected ':', expecting end-of-input
(repl):2: syntax error, unexpected t...
       ^

4

(repl):1: syntax error, unexpected ':', expecting end-of-input
(repl):1: syntax error, unexpected ':', expecting end-of-input
       ^

5(Quine)

(repl):1: syntax error, unexpected ':', expecting end-of-input
(repl):1: syntax error, unexpected ':', expecting end-of-input
       ^

4

Java,5岁

这些很长...因此我使用Python脚本验证了字符串是否相等,并且生成了此格式化的帖子,因此我不必手动在400行上插入制表符。

初始程序

class Main {
  public static void main(String[] args) {
    System.out.println("hello world");
  }}
}

1个

Main.java:5: error: class, interface, or enum expected
}
^
1 error

exit status 1

2

Main.java:1: error: class, interface, or enum expected
Main.java:5: error: class, interface, or enum expected
^
Main.java:1: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:1: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:1: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:3: error: illegal start of type
^
^
Main.java:3: error: ';' expected
^
 ^
Main.java:6: error: ';' expected
exit status 1
    ^
Main.java:6: error: <identifier> expected
exit status 1
           ^
Main.java:6: error: reached end of file while parsing
exit status 1
             ^
10 errors

exit status 1

3

Main.java:1: error: class, interface, or enum expected
Main.java:1: error: class, interface, or enum expected
^
Main.java:1: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:1: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:1: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:2: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:2: error: ';' expected
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:2: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:2: error: = expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:2: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:2: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:2: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:2: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:3: error: illegal start of type
^
^
Main.java:4: error: = expected
Main.java:1: error: <identifier> expected
    ^
Main.java:4: error: <identifier> expected
Main.java:1: error: <identifier> expected
         ^
Main.java:4: error: ';' expected
Main.java:1: error: <identifier> expected
          ^
Main.java:4: error: illegal start of type
Main.java:1: error: <identifier> expected
           ^
Main.java:4: error: = expected
Main.java:1: error: <identifier> expected
                  ^
Main.java:5: error: '(' expected
Main.java:5: error: class, interface, or enum expected
    ^
Main.java:5: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:5: error: ';' expected
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:5: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:5: error: = expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:5: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:5: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:5: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:5: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:6: error: illegal start of type
                         ^
                         ^
Main.java:7: error: = expected
Main.java:1: error: <identifier> expected
    ^
Main.java:7: error: <identifier> expected
Main.java:1: error: <identifier> expected
         ^
Main.java:7: error: ';' expected
Main.java:1: error: <identifier> expected
          ^
Main.java:7: error: illegal start of type
Main.java:1: error: <identifier> expected
           ^
Main.java:7: error: = expected
Main.java:1: error: <identifier> expected
                  ^
Main.java:8: error: '(' expected
Main.java:5: error: class, interface, or enum expected
    ^
Main.java:8: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:8: error: ';' expected
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:8: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:8: error: = expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:8: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:8: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:8: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:8: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:9: error: illegal start of type
                                    ^
                                    ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
    ^
Main.java:10: error: <identifier> expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
         ^
Main.java:10: error: ';' expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
          ^
Main.java:10: error: illegal start of type
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
           ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                  ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                          ^
Main.java:10: error: illegal start of type
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                  ^
Main.java:10: error: <identifier> expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                   ^
Main.java:10: error: unclosed character literal
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                     ^
Main.java:10: error: ';' expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                       ^
Main.java:10: error: unclosed character literal
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                          ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                        ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                              ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                         ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                                    ^
Main.java:11: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:11: error: ';' expected
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:11: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:11: error: = expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:11: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:11: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:11: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:11: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:12: error: illegal start of type
                                         ^
                                         ^
Main.java:12: error: <identifier> expected
                                         ^
                                          ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
   ^
Main.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
      ^
Main.java:13: error: <identifier> expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
              ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
               ^
Main.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                  ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                               ^
Main.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                   ^
Main.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                        ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                                          ^
Main.java:14: error: <identifier> expected
Main.java:1: error: = expected
         ^
Main.java:14: error: ';' expected
Main.java:1: error: = expected
          ^
Main.java:14: error: illegal start of type
Main.java:1: error: = expected
           ^
Main.java:14: error: = expected
Main.java:1: error: = expected
                  ^
Main.java:14: error: illegal start of type
Main.java:1: error: = expected
                    ^
Main.java:15: error: = expected
Main.java:5: error: class, interface, or enum expected
^
Main.java:15: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
    ^
Main.java:15: error: = expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:15: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:15: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:15: error: = expected
Main.java:5: error: class, interface, or enum expected
             ^
Main.java:15: error: ';' expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:15: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:15: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:15: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:15: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:16: error: illegal start of type
                                              ^
                                              ^
Main.java:17: error: = expected
Main.java:3: error: illegal start of type
    ^
Main.java:17: error: <identifier> expected
Main.java:3: error: illegal start of type
         ^
Main.java:17: error: ';' expected
Main.java:3: error: illegal start of type
          ^
Main.java:17: error: illegal start of type
Main.java:3: error: illegal start of type
           ^
Main.java:17: error: = expected
Main.java:3: error: illegal start of type
                  ^
100 errors

exit status 1

4

Main.java:1: error: class, interface, or enum expected
Main.java:1: error: class, interface, or enum expected
^
Main.java:1: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:1: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:1: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:2: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:2: error: ';' expected
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:2: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:2: error: = expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:2: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:2: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:2: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:2: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:3: error: illegal start of type
^
^
Main.java:4: error: = expected
Main.java:1: error: <identifier> expected
    ^
Main.java:4: error: <identifier> expected
Main.java:1: error: <identifier> expected
         ^
Main.java:4: error: ';' expected
Main.java:1: error: <identifier> expected
          ^
Main.java:4: error: illegal start of type
Main.java:1: error: <identifier> expected
           ^
Main.java:4: error: = expected
Main.java:1: error: <identifier> expected
                  ^
Main.java:5: error: '(' expected
Main.java:1: error: class, interface, or enum expected
    ^
Main.java:5: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:5: error: ';' expected
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:5: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:5: error: = expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:5: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:5: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:5: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:5: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:6: error: illegal start of type
                         ^
                         ^
Main.java:7: error: = expected
Main.java:1: error: <identifier> expected
    ^
Main.java:7: error: <identifier> expected
Main.java:1: error: <identifier> expected
         ^
Main.java:7: error: ';' expected
Main.java:1: error: <identifier> expected
          ^
Main.java:7: error: illegal start of type
Main.java:1: error: <identifier> expected
           ^
Main.java:7: error: = expected
Main.java:1: error: <identifier> expected
                  ^
Main.java:8: error: '(' expected
Main.java:1: error: class, interface, or enum expected
    ^
Main.java:8: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:8: error: ';' expected
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:8: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:8: error: = expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:8: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:8: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:8: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:8: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:9: error: illegal start of type
                                    ^
                                    ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
    ^
Main.java:10: error: <identifier> expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
         ^
Main.java:10: error: ';' expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
          ^
Main.java:10: error: illegal start of type
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
           ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                  ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                          ^
Main.java:10: error: illegal start of type
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                  ^
Main.java:10: error: <identifier> expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                   ^
Main.java:10: error: unclosed character literal
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                     ^
Main.java:10: error: ';' expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                       ^
Main.java:10: error: unclosed character literal
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                          ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                        ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                              ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                         ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                                    ^
Main.java:11: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:11: error: ';' expected
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:11: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:11: error: = expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:11: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:11: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:11: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:11: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:12: error: illegal start of type
                                         ^
                                         ^
Main.java:12: error: <identifier> expected
                                         ^
                                          ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
   ^
Main.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
      ^
Main.java:13: error: <identifier> expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
              ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
               ^
Main.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                  ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                               ^
Main.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                   ^
Main.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                        ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                                          ^
Main.java:14: error: <identifier> expected
Main.java:1: error: = expected
         ^
Main.java:14: error: ';' expected
Main.java:1: error: = expected
          ^
Main.java:14: error: illegal start of type
Main.java:1: error: = expected
           ^
Main.java:14: error: = expected
Main.java:1: error: = expected
                  ^
Main.java:14: error: illegal start of type
Main.java:1: error: = expected
                    ^
Main.java:15: error: = expected
Main.java:1: error: class, interface, or enum expected
^
Main.java:15: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
    ^
Main.java:15: error: = expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:15: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:15: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:15: error: = expected
Main.java:1: error: class, interface, or enum expected
             ^
Main.java:15: error: ';' expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:15: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:15: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:15: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:15: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:16: error: illegal start of type
                                              ^
                                              ^
Main.java:17: error: = expected
Main.java:2: error: <identifier> expected
    ^
Main.java:17: error: <identifier> expected
Main.java:2: error: <identifier> expected
         ^
Main.java:17: error: ';' expected
Main.java:2: error: <identifier> expected
          ^
Main.java:17: error: illegal start of type
Main.java:2: error: <identifier> expected
           ^
Main.java:17: error: = expected
Main.java:2: error: <identifier> expected
                  ^
100 errors

exit status 1

5(Quine)-由于帖子长度而被省略。


1
由于错误消息未标准化,您能否添加编译器版本(的输出javac -version)?
圣保罗Ebermann

“ [...]因此,我不必在400行上手动插入制表符!->在记事本++上粘贴,按CTRL + A(选择所有内容),然后按Tab。那是一种更快的方法。另外,您可能已使用text-compare.com来比较文本,或使用Notepad ++中的Compare插件。最好的是,text-compare.com允许通过电子邮件发送结果。
伊斯梅尔·米格尔

我使用脚本而不是网站,所以我将所有输出都放在一个列表中,然后可以输出。
mbomb007

@PaŭloEbermann添加了链接
mbomb007

我使用repl是因为ideone不会显示详细的错误输出。如果您知道更好的在线口译员,请告诉我。尽管有Eclipse和Netbeans,我不喜欢使用它们进行简单的程序,因为这需要创建一个项目,等等
mbomb007

2

Javascript,3个错误等级

这不是那个“砍肉刀”或什么,但是我发现它很奇怪。

错误0(原始):

document.appendChild(HTMLAllCollection)

错误1:

HierarchyRequestError

错误2:

'HierarchyRequestError' is not defined

错误3(奎因):

Excepted character ';'

这些都是在Internet Explorer 11.0.9600.17416上返回的,这些错误已翻译为英文。


打印屏幕:

打印屏幕显示控制台输出

*错误消息以葡萄牙语显示,可以轻松地翻译成英文


@ LegionMammal978在什么确切的版本内部版本号和日期?
Ismael Miguel 2015年

@ LegionMammal978答案非常特定。它仅在IE11上有效,并且仅在以葡萄牙语(pt-PT)作为主要显示语言的Windows上才能产生确切的输出。我保证它将在11.0.9600.17416上运行。我不能也不能保证它会在较新的版本或其他操作系统上产生相同的输出。
伊斯梅尔·米格尔

@ LegionMammal978不用担心。收到此评论后,将其标记为过时。
Ismael Miguel

0

Firefox 66.0中的JS;3个错误等级

输入: 6?4;

错误1 =输入2: missing : in conditional expression

错误2 =输入3: expected expression, got keyword 'in'

错误#3 =输入#4 =错误#4: unexpected token: identifier

这是我得到的最高。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.