2010-11-21 22:04:39 +00:00
|
|
|
# this sed script replaces some bits of the original leg file
|
|
|
|
# to make it more similar to the Go version, thus avoiding
|
|
|
|
# to many differences
|
|
|
|
|
|
|
|
/\$\$/ {
|
|
|
|
s,\$\$->,$$.,g
|
|
|
|
/\$\$[^}]*$/s,\; *$,,g
|
|
|
|
}
|
|
|
|
|
|
|
|
s,parse_result,p.tree,
|
|
|
|
s,references,p.references,
|
|
|
|
s,notes,p.notes,
|
|
|
|
s,find_reference,p.findReference,g
|
|
|
|
|
|
|
|
s,->key,.key,g
|
|
|
|
s,->children,.children,g
|
|
|
|
s,->contents.str,.contents.str,g
|
|
|
|
|
|
|
|
/{ *if (extens/ {
|
|
|
|
s,if (,if ,
|
|
|
|
s,)),),
|
|
|
|
}
|
|
|
|
/EXT/ s,if extension,if p.extension,
|
|
|
|
/EXT/ s,{ *extension,{ p.extension,g
|
|
|
|
/EXT/ s,{ *!extension,{ !p.extension,g
|
2010-11-24 18:56:25 +00:00
|
|
|
/EXT/ {
|
|
|
|
s,extension.EXT_FILTER_HTML.,extension.FilterHTML,g
|
|
|
|
s,extension.EXT_FILTER_STYLES.,extension.FilterStyles,g
|
|
|
|
s,extension.EXT_SMART.,extension.Smart,g
|
|
|
|
s,extension.EXT_NOTES.,extension.Notes,g
|
|
|
|
}
|
2010-11-21 22:04:39 +00:00
|
|
|
|
|
|
|
s,{ *element \*[a-z]*\; *$,{,
|
|
|
|
|
|
|
|
/raw\.key =/ s,;$,,
|
|
|
|
/result =/ s,;$,,
|
|
|
|
s,result = mk_el,result := mk_el,
|
|
|
|
|
|
|
|
s,NULL,nil,g
|
|
|
|
|
|
|
|
s, *\; *}, },g
|
|
|
|
|
|
|
|
s,strlen(,len(,g
|