Skip to content

an issue with parsing $$ #142

Open
Open

Description

@kylcho

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 ')'.

Activity

  1. danw commented on Aug 18, 2018

    @danw
    Collaborator

    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)))
    
  2. kylcho commented on Aug 20, 2018

    @kylcho
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions