2.6.10: Inline script token expansion breaking perl #2185

Closed
gschueler opened this Issue Nov 18, 2016 · 3 comments

Projects

None yet

2 participants

@gschueler
Contributor

Bug report

via #2021 (comment)

sub perlFunction {
    ...
    return \@files;
}

the script would now be generated without the backslash:

sub perlFunction {
    ...
    return @files;
}
@schast
schast commented Nov 18, 2016

@gschueler would you prefer a way to disable it completely?

no, i need to replace the @ tokens in inline scripts.

i think the problem was generated with the fix in #1823.
before the fix in #1823 allowed characters was alphanumeric and .+-_:
now all characters are allowed which are no whitespace, right?
what characters are allowed for the ${ctx.name} syntax?

in my case their is only one @ in the line:

sub perlFunction {
    ...
    return \@files;
}

why this is affected?

possible solution:

  • \@ should escape the @ token expansion.
  • define allowed characters for the @ tokens like this: alphanumeric and .+-_:/
@gschueler gschueler added this to the 2.7.0 milestone Nov 21, 2016
@gschueler
Contributor

there is a bug affecting \@. But, the fix is that we have to have a global escape character, so \ followed by any char will always output the second char., so your example would require return \\@files;, and any \ in your code would also have to be escaped as a double backslash.

@gschueler gschueler self-assigned this Nov 21, 2016
@gschueler
Contributor

other solution: require double @ to be expanded as literal @

@gschueler gschueler added a commit that closed this issue Nov 29, 2016
@gschueler gschueler fix #2185 use double-@ to escape @ sign (#2196)
fix #2185 use double-@ to escape @ if it might be replaced
286c911
@gschueler gschueler closed this in 286c911 Nov 29, 2016
@gschueler gschueler removed the in progress label Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment