Pikchr

Nested Macro Call, Error If Pass-Through Parms on New Lines
Login

Nested Macro Call, Error If Pass-Through Parms on New Lines

(1) By pskechr on 2026-04-02 16:50:17 [source]

Hello,

If I separate the input parameters of a nested macro call onto separate lines with the escape, it breaks if the input parameters are the passed-through outer macro's parameter values. Is this expected?

For example:

This works

define drawLine {
line from $1 to $2
}

define drawLineWrapper {
drawLine(A,B)
}

A: dot at (0,0)
B: dot at (1,0.5)

drawLineWrapper(A,B)

define drawLine {
line from $1 to $2
}

define drawLineWrapper {
drawLine(A,B)
}

A: dot at (0,0)
B: dot at (1,0.5)

drawLineWrapper(A,B)

This works

define drawLine {
line from $1 to $2
}

define drawLineWrapper {
drawLine(A,\
B)
}

A: dot at (0,0)
B: dot at (1,0.5)

drawLineWrapper(A,B)

define drawLine {
line from $1 to $2
}

define drawLineWrapper {
drawLine(A,\
B)
}

A: dot at (0,0)
B: dot at (1,0.5)

drawLineWrapper(A,B)

This works

define drawLine {
line from $1 to $2
}

define drawLineWrapper {
drawLine($1,$2)
}

A: dot at (0,0)
B: dot at (1,0.5)

drawLineWrapper(A,B)

define drawLine {
line from $1 to $2
}

define drawLineWrapper {
drawLine($1,$2)
}

A: dot at (0,0)
B: dot at (1,0.5)

drawLineWrapper(A,B)

This breaks

define drawLine {
line from $1 to $2
}

define drawLineWrapper {
drawLine($1,\
$2)
}

A: dot at (0,0)
B: dot at (1,0.5)

drawLineWrapper(A,B)

define drawLine {
line from $1 to $2
}

define drawLineWrapper {
drawLine($1,\
$2)
}

A: dot at (0,0)
B: dot at (1,0.5)

drawLineWrapper(A,B)

Thanks for considering.

(2) By Stephan Beal (stephan) on 2026-04-03 02:44:41 in reply to 1 [link] [source]

Nested Macro Call, Error If Pass-Through Parms on New Lines

This is a reminder to self for later closer analysis: a cursory glance suggests that the bug is in this block.

(3) By Stephan Beal (stephan) on 2026-04-03 02:53:35 in reply to 2 [link] [source]

@drh: /info/356d9d976bd335b8 seems to resolve this, but perhaps there's a nicer solution.

(4) By drh on 2026-04-03 10:31:03 in reply to 3 [link] [source]

Similar fix added to trunk.