[#7653] parse.y: literal strings for tokens — Robin Stocker <robin@...>
Hi,
Hi,
Yukihiro Matsumoto wrote:
[#7674] Re: [PATCH] parse.y: literal strings for tokens — ville.mattila@...
ville.mattila@stonesoft.com wrote:
Hi again,
Hi,
[#7692] Socket Documentation commit ? — zdennis <zdennis@...>
-----BEGIN PGP SIGNED MESSAGE-----
[#7708] Bug in libsnmp-ruby1.8 — Hadmut Danisch <hadmut@...>
Hi,
On Apr 11, 2006, at 6:23 AM, Hadmut Danisch wrote:
On 2006-04-12 02:04:32 +0900, Eric Hodel wrote:
On Apr 11, 2006, at 10:20 AM, Marcus Rueckert wrote:
[#7721] Ruby mentor in Googe's Summer of Code — "Evan Phoenix" <evan@...>
We missed out on it last year, so lets this year try to get ruby
[#7725] readpartial not working on ARM — Joel VanderWerf <vjoel@...>
[#7727] Stack trace doesn't include class — noreply@...
Bugs item #4151, was opened at 2006-04-17 23:10
On Apr 17, 2006, at 1:11 PM, noreply@rubyforge.org wrote:
On Wed, 19 Apr 2006, Eric Hodel wrote:
Hi --
[#7729] xmlrpc and charset=utf-8 — "Phil Tomson" <rubyfan@...>
I'm needed to interact with an XMLRPC server written using the
>>>>> On Sun, 18 Jun 2006 12:00:19 +0900
I first sent this from the wrong email account, so if that post somehow makes
On 6/19/06, Sean Russell <ser@germane-software.com> wrote:
[#7738] RDoc patches for GetoptLong — mathew <meta@...>
I added RDoc documentation to GetoptLong. The patches are attached. As
[#7744] Coverity Scan — "Pat Eyler" <rubypate@...>
I don't know if anyone else has signed up for access to the coverity
[#7765] possible defect in array.c — "Pat Eyler" <rubypate@...>
This one may be a false positive, I'm not sure. If it is, I'll happily mark
On 4/25/06, Pat Eyler <rubypate@gmail.com> wrote:
[#7770] Re: possible defect in array.c — "Brown, Warren" <warrenbrown@...>
> rb_range_beg_len (in range.c) does set beg and len.
On 4/26/06, Brown, Warren <warrenbrown@aquire.com> wrote:
On 4/26/06, Pat Eyler <rubypate@gmail.com> wrote:
On 4/26/06, Jacob Fugal <lukfugl@gmail.com> wrote:
On Thu, Apr 27, 2006 at 01:15:24AM +0900, Pat Eyler wrote:
Hi,
On Thu, Apr 27, 2006 at 09:41:00AM +0900, Nobuyoshi Nakada wrote:
[#7799] Patch: code-cleanup (k&r style) — Stefan Huehner <stefan@...>
Hi,
Hi,
[PATCH] parse.y: literal strings for tokens
Hi, The attached patch adds literal strings for tokens in parse.y so that parse error messages are more user-friendly. See [ruby-talk:179793] and [ruby-talk:187099] for descriptions of the problem. For example, instead of: -e:1: syntax error, unexpected tIDENTIFIER, expecting $end the output is: -e:1: syntax error, unexpected identifier, expecting $end or: -e:1: syntax error, unexpected kEND -e:1: syntax error, unexpected end I created and tested the patch with the latest Ruby CVS. I hope the formatting and indenting is ok and that I translated all tokens right. Regards, Robin Stocker
Attachments (1)
Index: parse.y
===================================================================
RCS file: /src/ruby/parse.y,v
retrieving revision 1.434
diff -u -r1.434 parse.y
--- parse.y 26 Mar 2006 13:04:13 -0000 1.434
+++ parse.y 1 Apr 2006 16:50:21 -0000
@@ -475,59 +475,73 @@
/*%
%token <val>
%*/
- kCLASS
- kMODULE
- kDEF
- kUNDEF
- kBEGIN
- kRESCUE
- kENSURE
- kEND
- kIF
- kUNLESS
- kTHEN
- kELSIF
- kELSE
- kCASE
- kWHEN
- kWHILE
- kUNTIL
- kFOR
- kBREAK
- kNEXT
- kREDO
- kRETRY
- kIN
- kDO
- kDO_COND
- kDO_BLOCK
- kDO_LAMBDA
- kRETURN
- kYIELD
- kSUPER
- kSELF
- kNIL
- kTRUE
- kFALSE
- kAND
- kOR
- kNOT
- kIF_MOD
- kUNLESS_MOD
- kWHILE_MOD
- kUNTIL_MOD
- kRESCUE_MOD
- kALIAS
- kDEFINED
- klBEGIN
- klEND
- k__LINE__
- k__FILE__
+ kCLASS "class"
+ kMODULE "module"
+ kDEF "def"
+ kUNDEF "undef"
+ kBEGIN "begin"
+ kRESCUE "rescue"
+ kENSURE "ensure"
+ kEND "end"
+ kIF "if"
+ kUNLESS "unless"
+ kTHEN "then"
+ kELSIF "elsif"
+ kELSE "else"
+ kCASE "case"
+ kWHEN "when"
+ kWHILE "while"
+ kUNTIL "until"
+ kFOR "for"
+ kBREAK "break"
+ kNEXT "next"
+ kREDO "redo"
+ kRETRY "retry"
+ kIN "in"
+ kDO "do"
+ kDO_COND "do condition"
+ kDO_BLOCK "do block"
+ kDO_LAMBDA "do lambda"
+ kRETURN "return"
+ kYIELD "yield"
+ kSUPER "super"
+ kSELF "self"
+ kNIL "nil"
+ kTRUE "true"
+ kFALSE "false"
+ kAND "and"
+ kOR "or"
+ kNOT "not"
+ kIF_MOD "if modifier"
+ kUNLESS_MOD "unless modifier"
+ kWHILE_MOD "while modifier"
+ kUNTIL_MOD "until modifier"
+ kRESCUE_MOD "rescue modifier"
+ kALIAS "alias"
+ kDEFINED "defined"
+ klBEGIN "BEGIN"
+ klEND "END"
+ k__LINE__ "__LINE__"
+ k__FILE__ "__FILE__"
+
+%token <id>
+ tIDENTIFIER "identifier"
+ tFID
+ tGVAR "global variable"
+ tIVAR "instance variable"
+ tCONSTANT "constant"
+ tCVAR "class variable"
+ tLABEL "label"
+
+%token <node>
+ tINTEGER "integer"
+ tFLOAT "float"
+ tSTRING_CONTENT "string content"
-%token <id> tIDENTIFIER tFID tGVAR tIVAR tCONSTANT tCVAR tLABEL
-%token <node> tINTEGER tFLOAT tSTRING_CONTENT
%token <node> tNTH_REF tBACK_REF
-%token <num> tREGEXP_END
+
+%token <num>
+ tREGEXP_END "regexp end"
%type <node> singleton strings string string1 xstring regexp
%type <node> string_contents xstring_contents string_content
@@ -552,36 +566,51 @@
/*%
%type <val> program reswords then do dot_or_colon
%*/
-%token tUPLUS /* unary+ */
-%token tUMINUS /* unary- */
-%token tPOW /* ** */
-%token tCMP /* <=> */
-%token tEQ /* == */
-%token tEQQ /* === */
-%token tNEQ /* != */
-%token tGEQ /* >= */
-%token tLEQ /* <= */
-%token tANDOP tOROP /* && and || */
-%token tMATCH tNMATCH /* =~ and !~ */
-%token tDOT2 tDOT3 /* .. and ... */
-%token tAREF tASET /* [] and []= */
-%token tLSHFT tRSHFT /* << and >> */
-%token tCOLON2 /* :: */
-%token tCOLON3 /* :: at EXPR_BEG */
-%token <id> tOP_ASGN /* +=, -= etc. */
-%token tASSOC /* => */
-%token tLPAREN /* ( */
-%token tLPAREN_ARG /* ( */
-%token tRPAREN /* ) */
-%token tLBRACK /* [ */
-%token tLBRACE /* { */
-%token tLBRACE_ARG /* { */
-%token tSTAR /* * */
-%token tAMPER /* & */
-%token tLAMBDA /* -> */
-%token tLAMBDA_ARG /* -> */
-%token tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG tWORDS_BEG tQWORDS_BEG
-%token tSTRING_DBEG tSTRING_DVAR tSTRING_END tLAMBEG
+
+%token
+ tUPLUS "unary +"
+ tUMINUS "unary -"
+ tPOW "**"
+ tCMP "<=>"
+ tEQ "=="
+ tEQQ "==="
+ tNEQ "!="
+ tGEQ ">="
+ tLEQ "<="
+ tANDOP "&&"
+ tOROP "||"
+ tMATCH "=~"
+ tNMATCH "!~"
+ tDOT2 ".."
+ tDOT3 "..."
+ tAREF "[]"
+ tASET "[]="
+ tLSHFT "<<"
+ tRSHFT ">>"
+ tCOLON2 "::"
+ tCOLON3 "::" /* at EXPR_BEG */
+ <id> tOP_ASGN "assignment operator" /* +=, -= etc. */
+ tASSOC "=>"
+ tLPAREN "("
+ tLPAREN_ARG "("
+ tRPAREN ")"
+ tLBRACK "["
+ tLBRACE "{"
+ tLBRACE_ARG "{"
+ tSTAR "*"
+ tAMPER "&"
+ tLAMBDA "->"
+ tLAMBDA_ARG "->"
+ tSYMBEG "beginning of symbol"
+ tSTRING_BEG "beginning of string"
+ tXSTRING_BEG "beginning of execution string"
+ tREGEXP_BEG "beginning of regexp"
+ tWORDS_BEG "%w"
+ tQWORDS_BEG "%W"
+ tSTRING_DBEG "string interpolation"
+ tSTRING_DVAR "string interpolation"
+ tSTRING_END "end of string"
+ tLAMBEG "beginning of lambda"
/*
* precedence table