[前][次][番号順一覧][スレッド一覧]

ruby-changes:18763

From: nobu <ko1@a...>
Date: Sat, 5 Feb 2011 10:13:47 +0900 (JST)
Subject: [ruby-changes:18763] Ruby:r30790 (trunk): * ext/json/parser/parser.rl: add local variables for emacs.

nobu	2011-02-05 10:13:41 +0900 (Sat, 05 Feb 2011)

  New Revision: 30790

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30790

  Log:
    * ext/json/parser/parser.rl: add local variables for emacs.

  Modified files:
    trunk/ext/json/parser/parser.c
    trunk/ext/json/parser/parser.rl

Index: ext/json/parser/parser.rl
===================================================================
--- ext/json/parser/parser.rl	(revision 30789)
+++ ext/json/parser/parser.rl	(revision 30790)
@@ -2,7 +2,7 @@
 
 /* unicode */
 
-static const char digit_values[256] = { 
+static const char digit_values[256] = {
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
@@ -38,7 +38,7 @@
     return result;
 }
 
-static int convert_UTF32_to_UTF8(char *buf, UTF32 ch) 
+static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
 {
     int len = 1;
     if (ch <= 0x7F) {
@@ -97,7 +97,7 @@
     VNaN                = 'NaN';
     VInfinity           = 'Infinity';
     VMinusInfinity      = '-Infinity';
-    begin_value         = [nft"\-[{NI] | digit;
+    begin_value         = [nft\"\-\[\{NI] | digit;
     begin_object        = '{';
     end_object          = '}';
     begin_array         = '[';
@@ -115,7 +115,7 @@
 
     action parse_value {
         VALUE v = Qnil;
-        char *np = JSON_parse_value(json, fpc, pe, &v); 
+        char *np = JSON_parse_value(json, fpc, pe, &v);
         if (np == NULL) {
             fhold; fbreak;
         } else {
@@ -226,7 +226,7 @@
         fhold; fbreak;
     }
 
-    action parse_array { 
+    action parse_array {
         char *np;
         json->current_nesting++;
         np = JSON_parse_array(json, fpc, pe, result);
@@ -234,7 +234,7 @@
         if (np == NULL) { fhold; fbreak; } else fexec np;
     }
 
-    action parse_object { 
+    action parse_object {
         char *np;
         json->current_nesting++;
         np =  JSON_parse_object(json, fpc, pe, result);
@@ -338,7 +338,7 @@
 
     action parse_value {
         VALUE v = Qnil;
-        char *np = JSON_parse_value(json, fpc, pe, &v); 
+        char *np = JSON_parse_value(json, fpc, pe, &v);
         if (np == NULL) {
             fhold; fbreak;
         } else {
@@ -411,7 +411,7 @@
                     unescape = (char *) "\f";
                     break;
                 case 'u':
-                    if (pe > stringEnd - 4) { 
+                    if (pe > stringEnd - 4) {
                         return Qnil;
                     } else {
                         char buf[4];
@@ -467,7 +467,7 @@
 
     action exit { fhold; fbreak; }
 
-    main := '"' ((^(["\\] | 0..0x1f) | '\\'["\\/bfnrt] | '\\u'[0-9a-fA-F]{4} | '\\'^(["\\/bfnrtu]|0..0x1f))* %parse_string) '"' @exit;
+    main := '"' ((^([\"\\] | 0..0x1f) | '\\'[\"\\/bfnrt] | '\\u'[0-9a-fA-F]{4} | '\\'^([\"\\/bfnrtu]|0..0x1f))* %parse_string) '"' @exit;
 }%%
 
 static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -517,7 +517,7 @@
             ) ignore*;
 }%%
 
-/* 
+/*
  * Document-class: JSON::Ext::Parser
  *
  * This is the JSON parser implemented as a C extension. It can be configured
@@ -790,3 +790,10 @@
     i_iconv = rb_intern("iconv");
 #endif
 }
+
+/*
+ * Local variables:
+ * mode: c
+ * c-file-style: ruby
+ * End:
+ */
Index: ext/json/parser/parser.c
===================================================================
--- ext/json/parser/parser.c	(revision 30789)
+++ ext/json/parser/parser.c	(revision 30790)
@@ -4,7 +4,7 @@
 
 /* unicode */
 
-static const char digit_values[256] = { 
+static const char digit_values[256] = {
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
@@ -40,7 +40,7 @@
     return result;
 }
 
-static int convert_UTF32_to_UTF8(char *buf, UTF32 ch) 
+static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
 {
     int len = 1;
     if (ch <= 0x7F) {
@@ -228,7 +228,7 @@
 #line 116 "parser.rl"
 	{
         VALUE v = Qnil;
-        char *np = JSON_parse_value(json, p, pe, &v); 
+        char *np = JSON_parse_value(json, p, pe, &v);
         if (np == NULL) {
             p--; {p++; cs = 9; goto _out;}
         } else {
@@ -530,7 +530,7 @@
 	goto st21;
 tr5:
 #line 229 "parser.rl"
-	{ 
+	{
         char *np;
         json->current_nesting++;
         np = JSON_parse_array(json, p, pe, result);
@@ -540,7 +540,7 @@
 	goto st21;
 tr9:
 #line 237 "parser.rl"
-	{ 
+	{
         char *np;
         json->current_nesting++;
         np =  JSON_parse_object(json, p, pe, result);
@@ -1093,7 +1093,7 @@
 #line 339 "parser.rl"
 	{
         VALUE v = Qnil;
-        char *np = JSON_parse_value(json, p, pe, &v); 
+        char *np = JSON_parse_value(json, p, pe, &v);
         if (np == NULL) {
             p--; {p++; cs = 3; goto _out;}
         } else {
@@ -1312,7 +1312,7 @@
                     unescape = (char *) "\f";
                     break;
                 case 'u':
-                    if (pe > stringEnd - 4) { 
+                    if (pe > stringEnd - 4) {
                         return Qnil;
                     } else {
                         char buf[4];
@@ -1519,7 +1519,7 @@
 #line 518 "parser.rl"
 
 
-/* 
+/*
  * Document-class: JSON::Ext::Parser
  *
  * This is the JSON parser implemented as a C extension. It can be configured
@@ -1933,3 +1933,10 @@
     i_iconv = rb_intern("iconv");
 #endif
 }
+
+/*
+ * Local variables:
+ * mode: c
+ * c-file-style: ruby
+ * End:
+ */

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]