idaholab / MontePy

MontePy is the most user friendly Python library (API) to read, edit, and write MCNP input files.
https://www.montepy.org/
MIT License
32 stars 7 forks source link

Fixed SyntaxNode AttributeError. #582

Closed MicahGale closed 3 weeks ago

MicahGale commented 1 month ago

Description

This is a fix for an AttributeError when adding a leading comment to an Importance that invokes SyntaxNode._grab_beginning_comment which previously was only implemented for PaddingNode. This implements it for SyntaxNodeBase and SyntaxNode which should cover all other use cases.

This also adds a final check to ensure no extra blank lines are being added.

Fixes #580

Checklist

MicahGale commented 3 weeks ago

@tjlaboss you are suddenly very motivated to get this merged :).