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

Undocumented <& sequence #412

Closed
joelspadin opened this issue Oct 20, 2024 · 8 comments
Closed

Undocumented <& sequence #412

joelspadin opened this issue Oct 20, 2024 · 8 comments
Labels
bug Something isn't working lexer

Comments

@joelspadin
Copy link

I am using Mako to generate some Devicetree code, and I was surprised to find that

property = <&node>;

gets turned into

property = &node>;

when run through Mako.

I cannot find anything on https://docs.makotemplates.org/en/latest/ that documents <& (less than, ampersand) as a special sequence, but I do see it in a couple example files in this repo. Is this a feature that should be documented?

@sqla-tester
Copy link
Collaborator

Mike Bayer has proposed a fix for this issue in the main branch:

dont consume ampersands https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/5561

@zzzeek zzzeek added bug Something isn't working lexer labels Oct 21, 2024
@zzzeek
Copy link
Member

zzzeek commented Oct 21, 2024

from all indications this appears to be an erroneous character that was committed to mako 17 years ago as part of its original construction. I can find no use for this ampersand character. seems a little strange

@joelspadin
Copy link
Author

Weird. Thanks for looking into it!

@zzzeek
Copy link
Member

zzzeek commented Oct 21, 2024

looks like it's from myghty since as you mention it's in the example files, it's in the myt files

@zzzeek
Copy link
Member

zzzeek commented Oct 21, 2024

ive released 1.3.6, however if this causes any regressions we might have to revert it, as that's been a thing lately

@joelspadin
Copy link
Author

Thanks!

shithub-mirror pushed a commit to kiss-community/repo that referenced this issue Dec 8, 2024
@git-bruh
Copy link

git-bruh commented Dec 8, 2024

Hey, this seems to break firefox builds as a lot of their autogenerated code seems to rely on this quirk: https://github.com/mozilla/gecko-dev/blob/3b1f061102e8137e49c76382170045d9451e4406/servo/components/style/properties/properties.mako.rs#L8

This isn't a problem for now as firefox's build system use an older, bundled mako version. I faced this as I was forcing it to use my system's mako package which is newer than the bundled version.

shithub-mirror pushed a commit to kiss-community/grepo that referenced this issue Dec 8, 2024
(cherry picked from commit c2913102739fd2b295e1e1b33ba26bab0fb68454)
@zzzeek
Copy link
Member

zzzeek commented Dec 8, 2024

firefox browser uses mako in their build system? unbelievable

anyway firefox should fix their templates when they upgrade, this was a real bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lexer
Projects
None yet
Development

No branches or pull requests

4 participants