inweb-bootstrap: Add inweb2noweb.scm.
This commit is contained in:
parent
60735b4c46
commit
6e43c03343
1 changed files with 21 additions and 0 deletions
21
inweb2noweb.scm
Normal file
21
inweb2noweb.scm
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
(use-modules (guix build utils))
|
||||||
|
|
||||||
|
;; These set of substitutions convert most of the inweb markup syntax
|
||||||
|
;; to noweb markup syntax, but some parts still need to be converted by hand.
|
||||||
|
|
||||||
|
(substitute* (find-files "." "\\.nw$")
|
||||||
|
(("^@h (.*)\n$" all header)
|
||||||
|
(string-append "@ \\section{" header "}\n"))
|
||||||
|
(("^=.*\n$") "<<*>>=\n")
|
||||||
|
(("^@define ") "#define ")
|
||||||
|
(("^@enum ") "enum ")
|
||||||
|
(("^@d ") "#define ")
|
||||||
|
(("^@e ") "enum ")
|
||||||
|
(("@<") "<<")
|
||||||
|
(("@> =") ">>=")
|
||||||
|
(("@>") ">>")
|
||||||
|
(("@ =") "<<*>>=")
|
||||||
|
(("\\|(.*)\\|" all keyword)
|
||||||
|
(string-append "[[" keyword "]]"))
|
||||||
|
(("\\[\\[\\]\\]") "||"))
|
||||||
|
|
Loading…
Reference in a new issue