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

data rendering in .phi is broken #3534

Open
yegor256 opened this issue Nov 24, 2024 · 5 comments
Open

data rendering in .phi is broken #3534

yegor256 opened this issue Nov 24, 2024 · 5 comments
Assignees
Labels

Comments

@yegor256
Copy link
Member

PhiMojo renders data values incorrectly: with spaces instead of dashes.

@yegor256 yegor256 added the bug label Nov 24, 2024
yegor256 added a commit that referenced this issue Nov 24, 2024
@yegor256
Copy link
Member Author

@maxonfjvipon please, help us fix this (I reproduced the problem in d183103)

@yegor256
Copy link
Member Author

@maxonfjvipon it works fine, if 01-02-03 is used in the XMIR, instead of 01 02 03. However, I believe, we must support both formats and print .phi correctly in either case.

@maxonfjvipon
Copy link
Member

maxonfjvipon commented Nov 24, 2024

@yegor256 after removing @data bytes in XMIR must be without spaces but with dashes, the same as they are in EO: -- for empty or 00- for one or 00-00 for many. We need to cover this in XSD or add new XSL transformation that validates bytes format. It's mandatory because otherwise without @data attribute we can't detect if object has some empty data: empty bytes or empty string. It'll be just regular object without text(): <o base="org.eolang.bytes"/>. And in the end it'll be converted to EO or phi incorrectly

@maxonfjvipon
Copy link
Member

@yegor256 and I think we should not support both, the less - the better

@yegor256
Copy link
Member Author

@maxonfjvipon let's try to add a test for our XSD? The test should be parametrized and have a number of YAML files, each of which should have a wrongly formatted XMIR. We should check that all of them fail when being passed through the XSD. Then, let's implement the check in the XSD, which you are talking about.

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

No branches or pull requests

2 participants