Menu

#407 typo in constructor ?

resolved
nobody
None
minor
bug
2021-12-25
2021-11-10
No

in RoundTripConstructor class, method construct_scalar, under if node.style == '>' you will find the following lines:

            fss = FoldedScalarString(node.value.replace('\a', ''), anchor=node.anchor)
            if self.loader and self.loader.comment_handling is None:
                if node.comment and node.comment[1]:
                    fss.comment = node.comment[1][0]  # type: ignore
            else:
                # NEWCMNT
                if node.comment is not None and node.comment[1]:
                    # nprintf('>>>>nc2', node.comment)
                    # EOL comment after >
                    lss.comment = self.comment(node.comment[1][0])  # type: ignore

The last line is maybe incorrect ? lss => fss

Discussion

  • Anthon van der Neut

    Yes that looks like a copy-paste not updated. Should add some more tests as this is probably not covered yet. Thanks for reporting.

     
  • Anthon van der Neut

    • status: open --> resolved
     
  • Anthon van der Neut

    Should be fixed in 0.17.18

     

Log in to post a comment.

Monday.com Logo