Skip to content

Conversation

@Paalon
Copy link
Contributor

@Paalon Paalon commented Jun 15, 2024

Add a method peekchar(stream::TokenStream, i::Integer=0). This can reduce many peek(stream.input, i) in the source code and improve readability.

Paalon added 6 commits June 15, 2024 22:23
This can reduce many `peek(stream.input, i)` in the source code and
improve readability.
Here we use abstract type & subtyping because it's common traits pattern
in Julia.
We do not need to export these objects because we can use strings for
versions in user-facing functions like:

```julia

function load(str::AbstractString; version::YAMLVersion)
    # ...
end

function load(str::AbstractString; version::AbstractString)
    version == "1.1" ? load(str, version=YAMLV1_1()) :
    version == "1.2" ? load(str, version=YAMLV1_2()) :
    throw(ErrorException())
end

load(str, version="1.1")
```
Copy link
Member

@kescobo kescobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just need to resolve conflicts. Sorry for my haphazard merging causing all of this! I really appreciate the atomic PRs to improve reviewability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants