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-1403

If a YAML file has symbol literal ``:100%'', it throws syntax error.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.0.1
  • Fix Version/s: JRuby 1.1b1
  • Component/s: None
  • Labels:
    None

Description

I get the following problem.

% jruby ryaml -e 'p YAML.load("-- \n:100%\n")'
:1: <script>:0: syntax error, expecting kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kTHEN kELSIF kELSE kCASE kWHEN kFOR kBREAK kNEXT kREDO kRETRY kIN kDO 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_ tIDENTIFIER tFID tGVAR tIVAR tCONSTANT tCVAR tSTRING_CONTENT tUPLUS tUMINUS tPOW tCMP tEQ tEQQ tGEQ tLEQ tMATCH tAREF tASET tLSHFT tRSHFT tSTAR tSTAR2 tAMPER2 tTILDE tPERCENT tDIVIDE tPLUS tMINUS tLT tGT tPIPE tCARET tBACK_REF2 tSTRING_DBEG tSTRING_DVAR tSTRING_END but found tINTEGER instead (SyntaxError)

This is fine, I suppose, but it is inconsistent with native Ruby, which seems to handle it just fine.

% ruby ryaml -e 'p YAML.load("-- \n:100%\n")'
:"100%"

My best regards.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Tooru Takahashi added a comment - 04/Oct/07 10:14 AM

It is generated only to do to the following in this.

% jruby ryaml e 'p YAML.load("- \n:1\n")'
=> syntax error

% ruby ryaml e 'p YAML.load("- \n:1\n")'
=> :1

Show
Tooru Takahashi added a comment - 04/Oct/07 10:14 AM It is generated only to do to the following in this. % jruby ryaml e 'p YAML.load("- \n:1\n")' => syntax error % ruby ryaml e 'p YAML.load("- \n:1\n")' => :1
Hide
Permalink
Thomas E Enebo added a comment - 04/Oct/07 12:23 PM

Just a comment that this may be purely a YAML issue versus what would appear to be a parser issue:

:1

by itself is an error in both JRuby and MRI. Also :"1" works no problem in both JRuby and MRI. So I suspect some YAML magic possibly does something special for syntactically odd symbols?

Show
Thomas E Enebo added a comment - 04/Oct/07 12:23 PM Just a comment that this may be purely a YAML issue versus what would appear to be a parser issue:
:1
by itself is an error in both JRuby and MRI. Also :"1" works no problem in both JRuby and MRI. So I suspect some YAML magic possibly does something special for syntactically odd symbols?
Hide
Permalink
Tooru Takahashi added a comment - 05/Oct/07 10:36 AM

I examined and understood that YAML doesn't support the symbol.
As you indicated, It seems that ":symbol" in YAML file can be treated as a Symbol because YAML Parser of (J)Ruby can specially treat Symbol.

Is compatible of syntactically odd symbols with MRI scheduled to be made?

The version of my MRI was not being written. It is as follows.
% ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-freebsd5]

best regards.

Show
Tooru Takahashi added a comment - 05/Oct/07 10:36 AM I examined and understood that YAML doesn't support the symbol. As you indicated, It seems that ":symbol" in YAML file can be treated as a Symbol because YAML Parser of (J)Ruby can specially treat Symbol. Is compatible of syntactically odd symbols with MRI scheduled to be made? The version of my MRI was not being written. It is as follows. % ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-freebsd5] best regards.
Hide
Permalink
Ola Bini added a comment - 08/Oct/07 3:54 AM

This was a YAML issue. Fixed in trunk.

Show
Ola Bini added a comment - 08/Oct/07 3:54 AM This was a YAML issue. Fixed in trunk.

People

  • Assignee:
    Ola Bini
    Reporter:
    Tooru Takahashi
Vote (0)
Watch (0)

Dates

  • Created:
    04/Oct/07 10:07 AM
    Updated:
    23/Apr/08 10:04 AM
    Resolved:
    08/Oct/07 3:54 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.