strip_first
This commit is contained in:
parent
73fe260aea
commit
dfc7a776f5
1 changed files with 5 additions and 5 deletions
|
@ -58,7 +58,7 @@ function extract(string, type) {
|
|||
}
|
||||
}
|
||||
|
||||
function remove_first(string, target, tmp) {
|
||||
function strip_first(string, target, tmp) {
|
||||
tmp = string
|
||||
sub(target, "", tmp)
|
||||
return trim(tmp)
|
||||
|
@ -125,14 +125,14 @@ function parse(string) {
|
|||
# module
|
||||
if (match(string, RE_MODULE)) {
|
||||
current_match = "module"
|
||||
module = remove_first(string, "#\\.")
|
||||
module = strip_first(string, "#\\.")
|
||||
doc_reset()
|
||||
shebang = ""
|
||||
|
||||
# shebang
|
||||
} else if (match(string, RE_SHEBANG)) {
|
||||
current_match = "shebang"
|
||||
shebang = remove_first(string, "#!")
|
||||
shebang = strip_first(string, "#!")
|
||||
|
||||
# constant
|
||||
} else if (match(string, re["constant"])) {
|
||||
|
@ -147,14 +147,14 @@ function parse(string) {
|
|||
# alias
|
||||
} else if (match(string, re["alias"])) {
|
||||
current_match = "alias"
|
||||
alias = remove_first(string, "#=")
|
||||
alias = strip_first(string, "#=")
|
||||
aliases[alias] = ""
|
||||
doc_append("= " alias)
|
||||
|
||||
# command
|
||||
} else if (match(string, re["command"])) {
|
||||
current_match = "command"
|
||||
command = remove_first(string, "#/")
|
||||
command = strip_first(string, "#/")
|
||||
commands[command] = ""
|
||||
doc_append("/ " command)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue