[jira] [Commented] (TAP5-1605) Template parsing of expansions can't handle map expressions
[ https://issues.apache.org/jira/browse/TAP5-1605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13083985#comment-13083985 ] Hudson commented on TAP5-1605: -- Integrated in tapestry-trunk-freestyle #471 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/471/]) TAP5-1605: Template parsing of expansions can't handle map expressions robertdzeigler : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1156971 Files : * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java * /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java * /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MapExpressionInExpansions.tml * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MapExpressionInExpansions.java * /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/expansions_with_maps.tml * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/TemplateParserImplTest.java * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java * /tapestry/tapestry5/trunk/build.gradle Template parsing of expansions can't handle map expressions --- Key: TAP5-1605 URL: https://issues.apache.org/jira/browse/TAP5-1605 Project: Tapestry 5 Issue Type: Bug Components: tapestry-core Affects Versions: 5.3 Reporter: Robert Zeigler Assignee: Robert Zeigler 5.3 introduced map support into the property expression language in the form: {'foo': 'bar'}. Expansion parsing chokes on the syntax, however. It uses a reluctant regular expression to find the closing brace: private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\s*(.*?)\\s*}); Which means that the use of a map inside an expansion prematurely terminates the exansion: ${echoMap({foo: bar})} The regex finds the first } and the expression evaluates as: echoMap({foo: bar Which is clearly incorrect. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1605) Template parsing of expansions can't handle map expressions
[ https://issues.apache.org/jira/browse/TAP5-1605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13083188#comment-13083188 ] Robert Zeigler commented on TAP5-1605: -- I'm considering replacing the existing regex with one like: \$\{\s*(((?!\$\{).)*)\s*} (\\ omitted above for clarity). Basically, I've replaced the reluctant .*? with a greedy .* that only matches if the substrings that don't contain ${. So that introduces a new limitation to expansions: you can't do something like ${'${'}. I'm not sure why you would do that in the first place, but here's your chance to air your use case. If there are no complaints about introducing this (rather obscure) limitation to expansions, I'll go with the above solution. Template parsing of expansions can't handle map expressions --- Key: TAP5-1605 URL: https://issues.apache.org/jira/browse/TAP5-1605 Project: Tapestry 5 Issue Type: Bug Components: tapestry-core Affects Versions: 5.3 Reporter: Robert Zeigler Assignee: Robert Zeigler 5.3 introduced map support into the property expression language in the form: {'foo': 'bar'}. Expansion parsing chokes on the syntax, however. It uses a reluctant regular expression to find the closing brace: private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\s*(.*?)\\s*}); Which means that the use of a map inside an expansion prematurely terminates the exansion: ${echoMap({foo: bar})} The regex finds the first } and the expression evaluates as: echoMap({foo: bar Which is clearly incorrect. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1605) Template parsing of expansions can't handle map expressions
[ https://issues.apache.org/jira/browse/TAP5-1605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13083263#comment-13083263 ] Robert Zeigler commented on TAP5-1605: -- Thinking about this some more... really just trading one limitation (can't have a } anywhere inside the expansion) for a different one (can't have ${) and the latter is less likely than the former. Template parsing of expansions can't handle map expressions --- Key: TAP5-1605 URL: https://issues.apache.org/jira/browse/TAP5-1605 Project: Tapestry 5 Issue Type: Bug Components: tapestry-core Affects Versions: 5.3 Reporter: Robert Zeigler Assignee: Robert Zeigler 5.3 introduced map support into the property expression language in the form: {'foo': 'bar'}. Expansion parsing chokes on the syntax, however. It uses a reluctant regular expression to find the closing brace: private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\s*(.*?)\\s*}); Which means that the use of a map inside an expansion prematurely terminates the exansion: ${echoMap({foo: bar})} The regex finds the first } and the expression evaluates as: echoMap({foo: bar Which is clearly incorrect. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira