bugmake - Bugs: bug #59752, feature request: quote/expand...

 
 

bug #59752: feature request: quote/expand function

Submitter:  Aleksey Covacevice <alecov>
Submitted:  Tue 22 Dec 2020 07:00:07 PM UTC
   
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  None Operating System:  None
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 22 Dec 2020 07:00:07 PM UTC, original submission:  

It would be nice to have a $(quote) function which escapes a string for safe use within $(eval) contexts:

That is:

    define y
    1 # x
    z = 2
    endef

    $(eval x = $y)          # x = 1, and introduces z = 2
    $(eval x = $(quote $y)) # x = 1 # x\nz = 2


Also, the $(value) function is inconsistent with regards to $'s between simple and recursive variables:

    a1  = $x $$y \# z
    a2 := $x $$y \# z
    $(info $(value a1)) # Prints '$x $$y # z'
    $(info $(value a2)) # Prints ' $y # z'

This also might give problems in $(eval) contexts eg:

    $(eval b1 = $(value a1)) # b1 = $x $$y
    $(eval b2 = $(value a2)) # b2 = $y

    # $(quote $(value)) doesn't fit:
    $(eval b1 = $(quote $(value a1))) # b1 = $$x $$$$y \# z
    $(eval b2 = $(quote $(value a2))) # b2 = $$y \# z

Hence, I'd suggest also introducing $(expand) which is similar to $(quote) above, but for variables:

    $(eval b1 = $(expand a1))) # b1 = $x $$y \# z
    $(eval b2 = $(expand a2))) # b2 = $$y \# z

Aleksey Covacevice <alecov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by alecov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code