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

attribute-name in XSD may contain integers, which is wrong #3569

Closed
yegor256 opened this issue Nov 29, 2024 · 10 comments · Fixed by #3625
Closed

attribute-name in XSD may contain integers, which is wrong #3569

yegor256 opened this issue Nov 29, 2024 · 10 comments · Fixed by #3625
Assignees
Labels

Comments

@yegor256
Copy link
Member

In XMIR.xsd, if I change the attribute-name type by removing the [0-9]+ from its regular expression, UnphiMojoTest fails. Looks like we use this attribute (o/@name) incorrectly, holding their numbers when necessary. Let's get rid of this hack.

@yegor256 yegor256 changed the title attribute-name in XSD may contain integers, which is wrong attribute-name in XSD may contain integers, which is wrong Nov 29, 2024
@yegor256 yegor256 assigned yegor256 and maxonfjvipon and unassigned yegor256 Nov 29, 2024
@yegor256
Copy link
Member Author

@maxonfjvipon need your help here

@yegor256 yegor256 added bug and removed help wanted labels Nov 29, 2024
@maxonfjvipon
Copy link
Member

@yegor256 I believe @volodya-lombrozo won't like it since he uses numbers in attributes in jeo a lot

@yegor256
Copy link
Member Author

@maxonfjvipon we'll ask JEO to use something else, maybe same numbers but with a letter as a prefix

@maxonfjvipon
Copy link
Member

maxonfjvipon commented Dec 6, 2024

@yegor256 one of the problem here is that attribute-name is used as type for @as attribute which may be an integer number.

string
  01-02:0
  03-04:1

I tried to solve the problem by introducing new type attribute-binding specially for @as attribute and remove [0-9]+ from attribute-name. Here I'm facing a new problem while getting from XMIR from phi:

⟦ α65536 ↦ Φ.r ⟧

In phi-calculus, formation may contain attributes which name starts from α. While parsing phi we ignore α and get 65536. When this number goes to @as attribute - it's ok, but when it goes to @name - it's wrong.
What do you think? How would you suggest to resolve this properly?

@yegor256
Copy link
Member Author

yegor256 commented Dec 6, 2024

@maxonfjvipon maybe let's allow α0 in the @as attribute?

@maxonfjvipon
Copy link
Member

@yegor256 then we should catch it when we print XMIR to EO and remove α, or add α when we parse the next EO: string 01-02:0

@maxonfjvipon
Copy link
Member

@yegor256 but how to deal with this: ⟦ α65536 ↦ Φ.r ⟧. Here α65536 goes to @name attribute and there's no way it can be converted to EO properly

@yegor256
Copy link
Member Author

yegor256 commented Dec 7, 2024

@maxonfjvipon indeed, this

⟦ α65536 ↦ Φ.r ⟧

Can't be converted to XMIR/EO anyhow. We must throw an exception in this case, since it's not a valid phi-expression either. All α-prefixed attributes in a formation must start with zero and go one after another without any gaps. Maybe, we should create a lint for this too.

@maxonfjvipon
Copy link
Member

@yegor256 so the result attribute-name pattern would be: α[0-9]+|@|[a-z][^ \n\t\r]*?

@yegor256
Copy link
Member Author

yegor256 commented Dec 8, 2024

@maxonfjvipon correct

maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Dec 9, 2024
yegor256 added a commit that referenced this issue Dec 9, 2024
fix(#3569): prohibit numbers in attribute-name in XSD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants