-
-
Save ul/0e04ecc600b2c975e863baf1f41e0e4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
["" [[path "" body ["(define (id x)" " x)"]]] "" [[path "" body [" (define x 1)" " <<id>>" " (id x)"]]] "" [[path "test2.ss" body [" :paddle no" " (define y 2)" " <<id>>" " (id x)"]]] "" [[path "test.ss" body [" :paddle no" " ;; ok" " <<test2.ss>>"]]]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input: { | |
Test for tangle.red. | |
#+NAME: id | |
#+BEGIN_SRC scheme | |
(define (id x) | |
x) | |
#+END_SRC | |
boo | |
#+BEGIN_SRC scheme | |
(define x 1) | |
<<id>> | |
(id x) | |
#+END_SRC | |
yadaydya | |
#+NAME: test2.ss | |
#+BEGIN_SRC scheme :tangle test2.ss :paddle no | |
(define y 2) | |
<<id>> | |
(id x) | |
#+END_SRC | |
bla-b;a | |
#+BEGIN_SRC scheme :tangle test.ss :paddle no | |
;; ok | |
<<test2.ss>> | |
#+END_SRC | |
} | |
src-name: ["#+NAME:" any space copy name to newline] | |
src-path: [":tangle" some space copy path to [space thru newline | newline]] | |
src-begin: ["#+BEGIN_SRC" thru [src-path | copy path none newline]] | |
src-end: ["#+END_SRC"] | |
src-collect: [ | |
keep (copy name) | |
collect keep (reduce ['path (copy path) 'body (split body newline)]) | |
] | |
src-body: [src-begin copy body to src-end src-collect] | |
code: [[ src-name | copy name none] src-body ] | |
prose: [thru newline] | |
doc: [some [code | prose] to end] | |
probe parse input [collect doc] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment