Created
May 3, 2012 13:54
-
-
Save Zoxc/2585797 to your computer and use it in GitHub Desktop.
Parsing error comparison
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> ::hi() | |
mirb: | |
Parsing Error: Can only reference constants when leaving out the lookup expression (Use ::Object to access non-constants) | |
Input[1]: ::hi() | |
~~~~~~ | |
mri: | |
SyntaxError: (irb):6: syntax error, unexpected tIDENTIFIER, expecting tCONSTANT | |
::hi() | |
^ | |
> def ().hi; end | |
mirb: | |
Parsing Error: Expected expression | |
Input[1]: def ().hi; end | |
^ | |
mri: | |
SyntaxError: (irb):3: syntax error, unexpected ')' | |
def ().hi; end | |
^ | |
(irb):3: syntax error, unexpected keyword_end, expecting $end | |
>def test a=3, &b, b; end | |
mirb: | |
Parsing Error: Parameters with default values must come after regular parameters | |
Input[1]: def test a=3, &b, b; end | |
^ | |
Parsing Error: Block parameters must be last in the parameter list | |
Input[1]: def test a=3, &b, b; end | |
~~ | |
Parsing Error: Variable b already defined | |
Input[1]: def test a=3, &b, b; end | |
^ | |
mri: | |
SyntaxError: (irb):32: syntax error, unexpected ',', expecting ';' or '\n' | |
def test a=3, &b, b; end | |
^ | |
(irb):32: syntax error, unexpected keyword_end, expecting $end | |
>a, b + 2 = 1 | |
mirb: | |
Parsing Error: Not an assignable expression | |
Input[1]: a, b + 2 = 1 | |
~~~~~ | |
mri: | |
SyntaxError: (irb):11: syntax error, unexpected '+', expecting '=' | |
a, b + 2 = 1 | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment