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

an issue with parsing $$ #142

Open
kylcho opened this issue Aug 17, 2018 · 2 comments
Open

an issue with parsing $$ #142

kylcho opened this issue Aug 17, 2018 · 2 comments

Comments

@kylcho
Copy link

kylcho commented Aug 17, 2018

Kati does not seem to handle below case.

func = lib$(1)$(2)
bar := -lc -lm
$(eval foo := $(bar:-l%=$$(call func,%,.so)))
mylib:
@echo $(foo)

Expected output is
libc.so libm.so

Kati fails with following error.
makefile:3: *** unterminated call to function 'call': missing ')'.

@danw
Copy link
Collaborator

danw commented Aug 18, 2018

make using using $(call func,c,.so) $(call func,m,.so) for foo, while ckati is parsing it as $(call func,c,.so $(call func,m,.so. I guess we'd need to do more parenthesis matching?

A workaround is to delay the evaluation of bar, which gives the same result on make and ckati:

$(eval foo := $$(bar:-l%=$$(call func,%,.so)))

@kylcho
Copy link
Author

kylcho commented Aug 20, 2018

Thank you Dan.

When kati is parsing $(bar ..., it looks it sees opening '(' and records its closing ')' as a terminator. Then when it sees '(' of $$(call ..., it should handle increasing paren_depth etc but it does not. This seems to lead to missing the closing ')' of $$(call ...

Delayed expansion of bar variable as a workaround sounds right. I will try it

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

No branches or pull requests

2 participants