Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364272 - [parser] query resolution error
Summary: [parser] query resolution error
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 7
: P3 major
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 365556
  Show dependency tree
 
Reported: 2011-11-21 04:19 EST by Laurent Goubet CLA
Modified: 2015-05-27 08:56 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Goubet CLA 2011-11-21 04:19:13 EST
The following module fails to resolve the recursive calls to the "recurse" query. None of the recursive calls fail if the parameters are passed "within parenthesis" instead of prepending the first argument.

i.e; changing both calls to "recurse" from :
eClass.recurse(i + 1)
to
recurse(eClass, i + 1)

makes the resolution work.

The parser seems to ignore the first argument (variable) when using the first form (though the very first call, "eClass.recurse(0)" is properly resolved?).




[module testModule('http://www.eclipse.org/emf/2002/Ecore')/]

[template public main(eClass : EClass)]
	[comment @main/]
	[file (eClass.name + '.txt', false, 'UTF-8')]
		[eClass.recurse(0)/]
	[/file]
[/template]

[query public recurse(eClass : EClass, i : Integer) : String =
	if (i = 2)
	then 'world'
	else
		if (i = 1)
		then ',' + eClass.recurse(i + 1)
		else 'hello' + eClass.recurse(i + 1)
		endif
	endif/]
Comment 1 Stephane Begaudeau CLA 2012-04-11 05:16:57 EDT
A fix has been contributed on HEAD and R3_2_maintenance. An unit test has also been added to the test suite. It will be available for Acceleo 3.2.1 and 3.3.0.
Comment 2 Laurent Goubet CLA 2015-05-27 08:56:27 EDT
Closing resolved bugs