[#4834] Fwd: Re: Whats so different about a Hash? — Andrew Walrond <andrew@...>
>>>>> "A" == Andrew Walrond <andrew@walrond.org> writes:
On Thursday 05 May 2005 13:48, ts wrote:
>>>>> "A" == Andrew Walrond <andrew@walrond.org> writes:
On Thursday 05 May 2005 13:57, ts wrote:
[#4844] Getting rid of Object#equal?()? — =?ISO-8859-15?Q?Florian_Gro=DF?= <florgro@...>
Moin.
[#4848] No way to change socket timeout on opened URI — noreply@...
Bugs item #1878, was opened at 2005-05-05 17:55
[#4855] Method hooks in singleton classes — Pit Capitain <pit@...>
Hello Ruby-maintainers,
[#4858] Build fails on OSX Tiger 10.4 — noreply@...
Bugs item #1883, was opened at 2005-05-06 14:55
Hi,
Hi,
Hi,
On 5/19/05, Shugo Maeda <shugo@ruby-lang.org> wrote:
Hi,
Hi,
[#4869] Infinite loop on YAML.dump (Re: ruby-list:40801) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Hello.
[#4874] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...>
Hello all,
Ilias Lazaridis schrieb:
Pit Capitain wrote:
Ryan Davis wrote:
ES wrote:
On May 12, 2005, at 3:13 PM, Ilias Lazaridis wrote:
Mathieu Bouchard wrote:
On Thursday 12 May 2005 22:09, Ilias Lazaridis wrote:
Francois GORET wrote:
Hi,
nobu.nokada@softhome.net wrote:
Hi,
nobu.nokada@softhome.net wrote:
[#4881] Encoding Pragma — Bertram Scharpf <lists@...>
Hi,
[#4886] ruby 1.8.3 preview1 — Yukihiro Matsumoto <matz@...>
Hi,
Yukihiro Matsumoto <matz@ruby-lang.org> [2005-05-12 17:49]:
>What about [ruby-core:4296]?
[#4911] Pointless argc check in Array#select — noreply@...
Patches item #1900, was opened at 2005-05-12 09:33
noreply@rubyforge.org wrote:
>>>>> "D" == Daniel Berger <djberge@qwest.com> writes:
ts wrote:
>>>>> "D" == Daniel Berger <djberge@qwest.com> writes:
On 5/12/05, ts <decoux@moulon.inra.fr> wrote:
Austin Ziegler wrote:
[#4919] - Hierarchical/Modular Directory Structure — Ilias Lazaridis <ilias@...>
The source-code structure should be simplified, lowering barriers for
Hi,
Nakada, Nobuyoshi wrote:
Ilias Lazaridis wrote:
On 5/14/05, Ilias Lazaridis <ilias@lazaridis.com> wrote:
Austin Ziegler wrote:
Hi,
nobu.nokada@softhome.net wrote:
[#4932] ruby-1.8.3 preview1 - failure: cygwin. — Hugh Sasse <hgs@...>
I've just tried to build the preview and got:
[#4992] Pathname#unlink fails on a symlink which points to a directory. — noreply@...
Bugs item #1917, was opened at 2005-05-14 21:33
In article <200505142133.j4ELXEaM011256@rubyforge.org>,
Hello.
In article <20050515153530.0D9F30E0.ocean@m2.ccsnet.ne.jp>,
[#5006] Suggestion for avoiding incivilities — Gavin Sinclair <gsinclair@...>
Hi all,
[#5010] - Function Argument Conventions — Ilias Lazaridis <ilias@...>
As a general rule, the first argument to a function should be the
[#5020] Problems with the "outer scope" operator — Lothar Scholz <mailinglists@...>
Hello,
[#5039] CGI::escapeHTML escapes the ampersand in an existing escape command — noreply@...
Bugs item #1930, was opened at 2005-05-19 11:45
Hi,
Thu, 19 May 2005 13:09:45 +0900, nobuyoshi nakada
Hi,
[#5040] Suggestion to add alias for underscore style method names to camel case named class methods in CGI — noreply@...
Bugs item #1931, was opened at 2005-05-19 11:46
On Thu, 19 May 2005 noreply@rubyforge.org wrote:
On Thu, 19 May 2005 21:22:46 +0900, David A. Black <dblack@wobblini.net>
[#5068] Re: [ ruby-Patches-1939 ] Pathname, totally revamped — Daniel Berger <djberg96@...>
--- nobu.nokada@softhome.net wrote:
Hi,
On 5/22/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net>
Hi,
[#5070] Re: [ ruby-Patches-1939 ] Pathname, totally revamped — Daniel Berger <djberg96@...>
--- daz <dooby@d10.karoo.co.uk> wrote:
[#5075] Re: [ ruby-Patches-1939 ] Pathname, totally revamped — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
Quoting Daniel.Berger@qwest.com, on Mon, May 23, 2005 at 11:06:58PM +0900:
[#5107] Re: will callable objects be more general in Ruby 1.9? — Eric Mahurin <eric_mahurin@...>
Re: Encoding Pragma
Hi,
At Thu, 12 May 2005 08:03:48 +0900,
Bertram Scharpf wrote in [ruby-core:04881]:
> Why don't I retrieve the UTF-8 answer in the first case?
Although ruby doesn't have pragma right now, I'm using this
patch.
Index: intern.h
===================================================================
RCS file: /cvs/ruby/src/ruby/intern.h,v
retrieving revision 1.166
diff -U2 -p -r1.166 intern.h
--- intern.h 19 Apr 2005 14:02:48 -0000 1.166
+++ intern.h 19 Apr 2005 15:42:23 -0000
@@ -395,4 +395,5 @@ void ruby_load_script _((void));
void ruby_init_loadpath _((void));
void ruby_incpush _((const char*));
+void ruby_modeset _((const char*, int));
/* signal.c */
VALUE rb_f_kill _((int, VALUE*));
Index: parse.y
===================================================================
RCS file: /cvs/ruby/src/ruby/parse.y,v
retrieving revision 1.378
diff -U2 -p -r1.378 parse.y
--- parse.y 1 May 2005 00:15:25 -0000 1.378
+++ parse.y 1 May 2005 00:59:20 -0000
@@ -4445,4 +4445,5 @@ yycompile(parser, f, line)
NODE *node = 0;
struct RVarmap *vp, *vars = ruby_dyna_vars;
+ const char *kcode_save;
if (!compile_for_eval && rb_safe_level() == 0 &&
@@ -4468,4 +4469,5 @@ yycompile(parser, f, line)
}
+ kcode_save = rb_get_kcode();
ruby_current_node = 0;
ruby_sourcefile = rb_source_filename(f);
@@ -4474,4 +4476,5 @@ yycompile(parser, f, line)
ruby_debug_lines = 0;
compile_for_eval = 0;
+ rb_set_kcode(kcode_save);
vp = ruby_dyna_vars;
@@ -5404,14 +5407,11 @@ parser_yylex(parser)
case '#': /* it's a comment */
- while ((c = nextc()) != '\n') {
- if (c == -1) {
-#ifdef RIPPER
- ripper_dispatch_scan_event(parser, tCOMMENT);
-#endif
- return 0;
- }
+ if (lex_p < lex_pend) {
+ ruby_modeset(lex_p, lex_pend - lex_p);
+ lex_p = lex_pend;
}
#ifdef RIPPER
ripper_dispatch_scan_event(parser, tCOMMENT);
+ if (lex_p[-1] != '\n') return 0;
fallthru = Qtrue;
#endif
Index: ruby.c
===================================================================
RCS file: /cvs/ruby/src/ruby/ruby.c,v
retrieving revision 1.100
diff -U2 -p -r1.100 ruby.c
--- ruby.c 1 May 2005 00:13:34 -0000 1.100
+++ ruby.c 1 May 2005 00:59:20 -0000
@@ -401,4 +401,127 @@ require_libraries()
}
+/* emacsen -*- hack */
+typedef void (*rb_modeset_setter_t) _((const char *val, const char *name));
+
+struct modeset {
+ const char *name;
+ rb_modeset_setter_t func;
+};
+
+static const struct modeset modesets[] = {
+ {"coding", (rb_modeset_setter_t)rb_set_kcode},
+};
+
+static const char *
+modeset_marker(str, len)
+ const char *str;
+ int len;
+{
+ int i = 2;
+
+ while (i < len) {
+ switch (str[i]) {
+ case '-':
+ if (str[i-1] == '*' && str[i-2] == '-') {
+ return str + i + 1;
+ }
+ i += 2;
+ break;
+ case '*':
+ if (i + 1 >= len) return 0;
+ if (str[i+1] != '-') {
+ i += 4;
+ }
+ else if (str[i-1] != '-') {
+ i += 2;
+ }
+ else {
+ return str + i + 2;
+ }
+ break;
+ default:
+ i += 3;
+ break;
+ }
+ }
+ return 0;
+}
+
+void
+ruby_modeset(str, len)
+ const char *str;
+ int len;
+{
+ VALUE name = 0, val = 0;
+ const char *beg, *end, *vbeg, *vend;
+#define str_copy(_s, _p, _n) ((_s) \
+ ? (rb_str_resize((_s), (_n)), \
+ MEMCPY(RSTRING(_s)->ptr, (_p), char, (_n)), (_s)) \
+ : ((_s) = rb_str_new((_p), (_n))))
+
+ if (!(beg = modeset_marker(str, len))) return;
+ if (!(end = modeset_marker(beg, str + len - beg))) return;
+ str = beg;
+ len = end - beg - 3;
+
+ /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
+ while (len > 0) {
+ const struct modeset *p = modesets;
+ int n = 0;
+
+ for (; len > 0 && *str; str++, --len) {
+ switch (*str) {
+ case '\'': case '"': case ':': case ';':
+ continue;
+ }
+ if (!ISSPACE(*str)) break;
+ }
+ for (beg = str; len > 0; str++, --len) {
+ switch (*str) {
+ case '\'': case '"': case ':': case ';':
+ break;
+ default:
+ if (ISSPACE(*str)) break;
+ continue;
+ }
+ break;
+ }
+ for (end = str; len > 0 && ISSPACE(*str); str++, --len);
+ if (!len) break;
+ if (*str != ':') continue;
+
+ do str++; while (--len > 0 && ISSPACE(*str));
+ if (!len) break;
+ if (*str == '"') {
+ for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
+ if (*str == '\\') {
+ --len;
+ ++str;
+ }
+ }
+ vend = str;
+ if (len) {
+ --len;
+ ++str;
+ }
+ }
+ else {
+ for (vbeg = str; len > 0 && *str != '"' && !ISSPACE(*str); --len, str++);
+ vend = str;
+ }
+ while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
+
+ str_copy(name, beg, end - beg);
+ rb_funcall(name, rb_intern("downcase!"), 0);
+ do {
+ if (strncmp(p->name, RSTRING(name)->ptr, n) == 0) {
+ str_copy(val, vbeg, vend - vbeg);
+ (*p->func)(RSTRING(val)->ptr, RSTRING(name)->ptr);
+ break;
+ }
+ } while (++p < modesets + sizeof(modesets) / sizeof(*p));
+ }
+}
+
static void
process_sflag()
@@ -967,4 +1090,7 @@ load_file(fname, script)
}
}
+ else if (RSTRING(line)->len > 7) {
+ ruby_modeset(RSTRING(line)->ptr, RSTRING(line)->len);
+ }
}
else if (!NIL_P(c)) {
--
Nobu Nakada