PageRenderTime 19ms CodeModel.GetById 8ms RepoModel.GetById 1ms app.codeStats 0ms

/flatten-aux-script.sed

https://code.google.com/p/latex-makefile/
sed | 23 lines | 14 code | 1 blank | 8 comment | 0 complexity | 142cba066c3fead10551a42ea09c187b MD5 | raw file
  1. #(##defaults() ##)
  2. # Creates a sed script that does aux flattening by finding all of the included
  3. # dependencies.
  4. /\\@input{\(.*\)}/{
  5. # Get the file name
  6. s//\1/
  7. # Escape periods and colons
  8. s![.:]!\\&!g
  9. h
  10. # Emit a test for the file name input
  11. s!.*!\\:\\\\@input{&}:{!
  12. p
  13. x
  14. # Remove escapes and emit a line that reads the file
  15. s/\\././g
  16. s/.*/r &/p
  17. # Add d and endgroup commands
  18. s/.*/d/p
  19. s/.*/}/p
  20. d
  21. }
  22. d