View in color | License | Download script | History | Other scripts by: ladislav |
30-Apr 15:46 UTC
[0.047] 10.276k
[0.047] 10.276k
find-script.rREBOL [
Title: "Find script"
Author: "Ladislav Mecir"
Date: 12-Nov-2012/0:11:35+1:00
File: %find-script.r
Purpose: {The FIND-SCRIPT function from R3.}
]
whitespace: charset [#"^A" - #" " #"^(7F)"]
find-script: func [
{Find a script header. Return starting position.}
script [string! binary!]
/local result
] [
parse/all script [
any [
any whitespace
script:
opt [#"[" any whitespace]
"rebol"
any whitespace
#"["
(result: script)
break
| thru #"^(line)"
]
]
result
] |