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

[Performance, No Breaking] Refactoring of scan_line_break. #188

Merged
merged 9 commits into from
Jun 25, 2024

Conversation

Paalon
Copy link
Contributor

@Paalon Paalon commented Jun 15, 2024

Refactoring of scan_line_break of src/scanner.jl.

  • Performance improvement of scan_line_break.
  • Rename scan_line_break to yaml_1_1_scan_line_break because it's written for YAML 1.1.
  • Add yaml_1_2_scan_line_break for YAML 1.2.
  • Add better comments.
  • Add a TODO comment about possible bugs.

Paalon added 2 commits June 15, 2024 19:46
* Performance improvement of `scan_line_break`.
* Rename `scan_line_break` to `yaml_1_1_scan_line_break`.
* Add `yaml_1_2_scan_line_break`.
* Add better comments.
* Add a TODO comment about possible bugs.
@Paalon Paalon changed the title Refactoring of scan_line_break. [Performance, No Breaking] Refactoring of scan_line_break. Jun 17, 2024
@Paalon
Copy link
Contributor Author

Paalon commented Jun 17, 2024

TODO is about the test windows_newlines. We only fails this test in better implementation. I don't know why. I think there is a bug in prefix(::BufferedInput, ::Integer).

@Paalon
Copy link
Contributor Author

Paalon commented Jun 17, 2024

I found prefix(::BufferedInput, ::Integer) has a bug and if I fixed it, the test windows_newlines fails. I think the test windows_newlines is something wrong.

@Paalon
Copy link
Contributor Author

Paalon commented Jun 20, 2024

Now depends on #225.

Paalon added 5 commits June 21, 2024 15:14
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")
```
@Paalon Paalon mentioned this pull request Jun 22, 2024
@kescobo kescobo merged commit 4fd38bb into JuliaData:master Jun 25, 2024
20 checks passed
@Paalon Paalon deleted the scan_line_break branch June 29, 2024 15:52
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.

3 participants