ruby / ruby/psych

YAML string in exponential format cannot be loaded by YAML 1.2 parser

Open
#627 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
597
Forks
223
Avg merge
11h 23m
Merged PRs (30d)
3

Description

Example: a string in the form of 344455e6 will not be quoted by the Psych YAML parser as it is not matching the regex used by the YAML1.1 spec for floats, however a YAML 1.2 compliant parser will interpret the value as a float since the decimal point and sign is considered optional in YAML 1.2.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Psych's YAML scalar and numeric-resolution handling, then trace how the example 344455e6 is classified under the YAML 1.2 behavior described here. Add a regression test for this form and verify that the parser's result matches the intended string handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, yaml
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.