Skip to content

Instantly share code, notes, and snippets.

@eddyb
Last active August 1, 2024 09:55
Show Gist options
  • Save eddyb/3a233c4709018e92b866 to your computer and use it in GitHub Desktop.
Save eddyb/3a233c4709018e92b866 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
SED_SCRIPT=`echo '{\
s/_\\$/$/g;\
s/\\$BP\\$/\&/g;\
s/\\$SP\\$/\@/g;\
s/\\$LT\\$/</g;\
s/\\$GT\\$/>/g;\
s/\\$LP\\$/(/g;\
s/\\$RP\\$/)/g;\
s/\\$RF\\$/\\&/g;\
s/\\$C\\$/,/g;\
s/\.\./::/g;\
s/\\$u20\\$/ /g;\
s/\\$u27\\$/'\''/g;\
s/\\$u3b\\$/;/g;\
s/\\$u5b\\$/[/g;\
s/\\$u5d\\$/]/g;\
s/\\$u7b\\$/{/g;\
s/\\$u7d\\$/}/g;\
s/::h[a-f0-9]{16}[a-zA-Z0-9]*(::v[0-9]+.[0-9]+(pre)?)?//g\
}' | tr -d '\n'`
cat $* | sed 's/E\./E \\$PLACEHOLDER\\$ ./g' | c++filt | sed 's/ \\$PLACEHOLDER\\$ //g' | sed -r "$SED_SCRIPT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment