Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot treat backquote ` well #142

Open
Paalon opened this issue Jun 3, 2024 · 2 comments
Open

Cannot treat backquote ` well #142

Paalon opened this issue Jun 3, 2024 · 2 comments
Labels

Comments

@Paalon
Copy link
Contributor

Paalon commented Jun 3, 2024

The following gives an error:

using YAML

text = """
a:
  "`b`": c
"""

dict1 = YAML.load(text)

# write YAML
io = IOBuffer()
YAML.write(io, dict1)

# read written YAML
seekstart(io)
dict2 = YAML.load(io)
ERROR: '`'
Stacktrace:
  [1] fetch_more_tokens(stream::YAML.TokenStream)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/scanner.jl:281
  [2] peek(stream::YAML.TokenStream)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/scanner.jl:198
  [3] parse_block_mapping_value(stream::YAML.EventStream)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/parser.jl:461
  [4] peek(stream::YAML.EventStream)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/parser.jl:54
  [5] compose_node(composer::YAML.Composer)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/composer.jl:93
  [6] __compose_mapping_node(event::YAML.ScalarEvent, composer::YAML.Composer, node::YAML.MappingNode)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/composer.jl:154
  [7] _compose_mapping_node(start_event::YAML.MappingStartEvent, composer::YAML.Composer, anchor::Nothing)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/composer.jl:174
  [8] compose_mapping_node(composer::YAML.Composer, anchor::Nothing)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/composer.jl:183
  [9] handle_event(event::YAML.MappingStartEvent, composer::YAML.Composer)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/composer.jl:86
 [10] compose_node(composer::YAML.Composer)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/composer.jl:94
 [11] compose_document(composer::YAML.Composer)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/composer.jl:50
 [12] compose(events::YAML.EventStream)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/composer.jl:38
 [13] load(ts::YAML.TokenStream, constructor::YAML.Constructor)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/YAML.jl:38
 [14] load(ts::YAML.TokenStream, more_constructors::Nothing, multi_constructors::Dict{…}; dicttype::Type{…}, constructorType::typeof(YAML.SafeConstructor))
    @ YAML ~/.julia/packages/YAML/U6OOW/src/YAML.jl:44
 [15] load
    @ ~/.julia/packages/YAML/U6OOW/src/YAML.jl:44 [inlined]
 [16] load (repeats 2 times)
    @ ~/.julia/packages/YAML/U6OOW/src/YAML.jl:47 [inlined]
 [17] load(input::IOBuffer)
    @ YAML ~/.julia/packages/YAML/U6OOW/src/YAML.jl:47
 [18] top-level scope
    @ REPL[7]:1
Some type information was truncated. Use `show(err)` to see complete types.
@Paalon Paalon changed the title Cannot treat backquote ``` well Cannot treat backquote ` `` well Jun 3, 2024
@Paalon Paalon changed the title Cannot treat backquote ` `` well Cannot treat backquote <code>` </code> well Jun 3, 2024
@Paalon Paalon changed the title Cannot treat backquote <code>` </code> well Cannot treat backquote ` well Jun 3, 2024
@kescobo
Copy link
Collaborator

kescobo commented Jun 3, 2024

Heh - apparently github has issues with it too. Can you just confirm it's a bug using another YAML parse (plenty of web-based ones)?

@Paalon
Copy link
Contributor Author

Paalon commented Jun 4, 2024

Parsing is well but there is a bug in writing.
From https://www.bairesdev.com/tools/json2yaml/
スクリーンショット 2024-06-04 11 38 22

@kescobo kescobo removed the parser label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants