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

format function for LineComment and BlockComment #356

Closed
olzama opened this issue Nov 24, 2022 · 1 comment
Closed

format function for LineComment and BlockComment #356

olzama opened this issue Nov 24, 2022 · 1 comment

Comments

@olzama
Copy link

olzama commented Nov 24, 2022

If I understand right, the format method is not currently implemented for all Events, in particular it is not implemented for LineComment and BlockComment? This would be useful in scenarios when someone is automatically updating part of a large TDL file and wants to copy large parts of it without modifying them (while modifying other parts).

@goodmami
Copy link
Member

Yes, that's because the LineComment and BlockComment events are paired with simple strings and not delphin.tdl classes, like delphin.tdl.TypeDefinition for TypeDefinition events. I think we could make delphin.tdl.LineComment and delphin.tdl.BlockComment classes as subtypes of str, which would allow tdl.format() to print them appropriately.

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

No branches or pull requests

2 participants