Skip to content

Conversation

spookylukey
Copy link
Collaborator

This looks like a regression @Pike (I have another one coming too, sorry to do that to you on a Friday afternoon...!). Numbers and FluentNone are not getting turned into strings as they should.

I realized I didn't understand your new implementation as well as I need to, especially in terms of at what point things get resolved, so I was trying to add some specific tests and came across some issues.

Only 3 of these tests fail (those with use_isolating=True), the others are there for good measure.

I think you probably have a better idea how to fix these at this point in time, shall I leave them with you?

@Pike
Copy link
Contributor

Pike commented Mar 8, 2019

So, the use-isolation one I was expecting in a different scenario, actually. When we make the transform work on the Transformer api, it will modify the AST in place, and that would be bundle-dependent.

I guess that adding and discarding self to a set on the context would fix this?

@spookylukey
Copy link
Collaborator Author

spookylukey commented Mar 11, 2019

I guess that adding and discarding self to a set on the context would fix this?

I think that should do it for the other issue - #109 - did this comment get mixed up?

Pike added a commit to Pike/python-fluent that referenced this pull request Apr 3, 2019
This patch removes state from the compiled tree.
For one, the recursion detection on patterns keeps its state in
the `ResolverEnvironment` now, instead of in the compiled tree.
Also, the question of bidi isolation is now kept in the resolver
context, instead of in the compiled tree.
For single placeables, which don't get bidi-isolated ever, there's
now a distinct NeverIsolatingPlaceable, which also takes care of
resolving fluent values to strings.

This should fix the test cases in projectfluent#108 and projectfluent#109
@Pike
Copy link
Contributor

Pike commented Apr 4, 2019

Thanks for the test cases. I've included them in #115, as well as the fix.

@Pike Pike closed this Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants