jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-1855

EOF handling in case of reading program from standard input

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1b1
  • Fix Version/s: JRuby 1.2
  • Component/s: Parser
  • Labels:
    None
  • Environment:
    Mac OS X 10.4.11, Java 1.5.0_07, JRuby 1.1-SNAPSHOT
  • Patch Submitted:
    Yes

Description

JRuby does not handle EOF character in case of reading program from its standard input.
I have to hit Ctrl-D twice.

The problem is the EOF character is ignored by the lexer in some case, and next read operation will be blocking.

The posted patch adds a simple FilterInputStream subclass, EOFWrappedInputStream, which remembers previously happened EOF.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    eof_handling.patch
    01/Jan/08 2:43 AM
    2 kB
    Takanori Ishikawa

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Thomas E Enebo added a comment - 03/Jan/08 5:58 PM

When I run jruby:

./bin/jruby
^D

Things end with the first ^D. Could you provide more instructions for how to reproduce this?

Show
Thomas E Enebo added a comment - 03/Jan/08 5:58 PM When I run jruby:
./bin/jruby
^D
Things end with the first ^D. Could you provide more instructions for how to reproduce this?
Hide
Permalink
Takanori Ishikawa added a comment - 03/Jan/08 10:25 PM

Sorry. How to reproduce this is:

% jruby
puts 1
^D

Just after a newline character is entered, the EOF character is ignored by the JRuby lexer.

in org.jruby.lexer.yacc.RubyYaccLexer#yylex (line:732)

case '\n':
  // Replace a string of newlines with a single one
  while((c = src.read()) == '\n');
  src.unread(c);
Show
Takanori Ishikawa added a comment - 03/Jan/08 10:25 PM Sorry. How to reproduce this is:
% jruby
puts 1
^D
Just after a newline character is entered, the EOF character is ignored by the JRuby lexer. in org.jruby.lexer.yacc.RubyYaccLexer#yylex (line:732)
case '\n':
  // Replace a string of newlines with a single one
  while((c = src.read()) == '\n');
  src.unread(c);
Hide
Permalink
Charles Oliver Nutter added a comment - 15/Feb/08 12:58 PM

Punting issues from 1.1 RC2 to 1.1 final.

Show
Charles Oliver Nutter added a comment - 15/Feb/08 12:58 PM Punting issues from 1.1 RC2 to 1.1 final.
Hide
Permalink
Thomas E Enebo added a comment - 16/Mar/08 10:59 PM

Bumping to point release in 1.1 series

Show
Thomas E Enebo added a comment - 16/Mar/08 10:59 PM Bumping to point release in 1.1 series
Hide
Permalink
Charles Oliver Nutter added a comment - 04/Feb/09 1:24 AM

Fixed in r8988.

Show
Charles Oliver Nutter added a comment - 04/Feb/09 1:24 AM Fixed in r8988.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Takanori Ishikawa
Vote (0)
Watch (3)

Dates

  • Created:
    01/Jan/08 2:43 AM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    04/Feb/09 1:24 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.