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

Refactor the parser #843

Closed
xcoulon opened this issue Mar 21, 2021 · 0 comments · Fixed by #855
Closed

Refactor the parser #843

xcoulon opened this issue Mar 21, 2021 · 0 comments · Fixed by #855

Comments

@xcoulon
Copy link
Member

xcoulon commented Mar 21, 2021

See if a line-based approach instead of a block-based approach can be more effective.

@xcoulon xcoulon added this to the v0.7.0 milestone Mar 21, 2021
@xcoulon xcoulon self-assigned this Mar 21, 2021
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue Nov 14, 2021
Fragments are blocks of contiguous lines separated by blank lines.
Blank lines within delimited blocks are preserved (hence they do not
split the fragments)
Once a fragment is read, it is sent on a channel to be processed
by the next stages of the pipeline until the aggregator which combines
all the fragments into the resulting `types.Document`, which
can thn be rendered

Also:
- removed tests in "raw documents" for quoted text, since it has little
 to no value.

BREAKING CHANGE:
- using pointers on all structs in `pkg/types`
- removing `types.Document.Attributes`, holding attributes in context
  as parsing/rendering progresses.
- `types.Paragraph.Lines` (`[][]interface{}`) is replaced by
  `types.Paragraph.Elements` (`[]interface{}`)
- all delimited blocks types are merged into `types.DelimitedBlock`
- all lists are merged into `types.List`
- removed the `Level` field in `types.ListElement` struct
- refactor document structure with header (level 0) and
  sections (level 1 to 5)

Fixes bytesparadise#843

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue Nov 14, 2021
Fragments are blocks of contiguous lines separated by blank lines.
Blank lines within delimited blocks are preserved (hence they do not
split the fragments)
Once a fragment is read, it is sent on a channel to be processed
by the next stages of the pipeline until the aggregator which combines
all the fragments into the resulting `types.Document`, which
can thn be rendered

Also:
- removed tests in "raw documents" for quoted text, since it has little
 to no value.

BREAKING CHANGE:
- using pointers on all structs in `pkg/types`
- removing `types.Document.Attributes`, holding attributes in context
  as parsing/rendering progresses.
- `types.Paragraph.Lines` (`[][]interface{}`) is replaced by
  `types.Paragraph.Elements` (`[]interface{}`)
- all delimited blocks types are merged into `types.DelimitedBlock`
- all lists are merged into `types.List`
- removed the `Level` field in `types.ListElement` struct
- refactor document structure with header (level 0) and
  sections (level 1 to 5)

Fixes bytesparadise#843

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit that referenced this issue Nov 20, 2021
Fragments are blocks of contiguous lines separated by blank lines.
Blank lines within delimited blocks are preserved (hence they do not
split the fragments)
Once a fragment is read, it is sent on a channel to be processed
by the next stages of the pipeline until it reaches the "aggregator" 
which combines all the fragments into the resulting `*types.Document`, 
which can then be rendered (as before)

Also:
- removed tests in "raw documents" for quoted text, since it has little
 to no value.

BREAKING CHANGE:
- using pointers on (most of) all structs in `pkg/types`
- removing `types.Document.Attributes`, holding attributes in context
  as parsing/rendering progresses.
- `types.Paragraph.Lines` (`[][]interface{}`) is replaced by
  `types.Paragraph.Elements` (`[]interface{}`)
- all delimited blocks types are merged into the single `types.DelimitedBlock` type
- all lists are merged into the single `types.List` type
- removed the `Level` field in `types.ListElement` struct
- refactor document structure with header (level 0) and
  sections (level 1 to 5)

Fixes #843

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue Nov 20, 2021
Add tests to verify that it now works, but was already fixed by bytesparadise#843

Closes bytesparadise#849

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit that referenced this issue Nov 20, 2021
Add tests to verify that it now works, but was already fixed by #843

Closes #849

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue Nov 20, 2021
adding tests to verify that it works, since it was most
certainly fixed in bytesparadise#843

clises bytesparadise#852

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit that referenced this issue Nov 20, 2021
adding tests to verify that it works, since it was most
certainly fixed in #843

clises #852

Signed-off-by: Xavier Coulon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant