mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Fixes lexicon filter pipes '|"
This commit is contained in:
parent
1cd50ba572
commit
a410c31bf8
1 changed files with 29 additions and 16 deletions
|
@ -137,17 +137,15 @@ t html
|
||||||
#.
|
#.
|
||||||
# Comments:
|
# Comments:
|
||||||
# Capture full line comments
|
# Capture full line comments
|
||||||
/^#.*$/ {
|
/^[ ]*#.*$/ {
|
||||||
# Assume any line starting with a # is complete
|
# Assume any line starting with a # is complete
|
||||||
s//@blah{&}/
|
s//@blah{&}/
|
||||||
t
|
t
|
||||||
}
|
}
|
||||||
# Match sub-line comments
|
# Match sub-line comments
|
||||||
/#[^0-9A-Za-z][ ]*.*$/ {
|
s/#\(.*$\)/\\\
|
||||||
# Assume comment finishes a line
|
<@blah{#\1}\
|
||||||
s//@blah{&}/
|
/
|
||||||
t
|
|
||||||
}
|
|
||||||
#.
|
#.
|
||||||
# Protected entities These shouldn't allow nested structure, so we move them
|
# Protected entities These shouldn't allow nested structure, so we move them
|
||||||
# to a marked, new line for a future extract/process/insert action.
|
# to a marked, new line for a future extract/process/insert action.
|
||||||
|
@ -213,27 +211,41 @@ s/\n//g
|
||||||
#.
|
#.
|
||||||
# Clean up special cases
|
# Clean up special cases
|
||||||
#.
|
#.
|
||||||
|
/@blah/{
|
||||||
|
s/\(blah{[^@]*\)@sglq{\([^}]*\)}/\1'\2'/
|
||||||
|
s/\(blah{[^@]*\)@dblq{\([^}]*\)}/\1"\2"/
|
||||||
|
s/\(blah{[^@]*\)@....{\([^}]*\)}/\1\2/
|
||||||
|
}
|
||||||
/@redr/{
|
/@redr/{
|
||||||
:cleanredr
|
:cleanredr
|
||||||
s/\(redr{[^@]*\)@cmnd{\([^}]*\)}/\1\2/
|
s/\(redr{[^@}]*\)@cmnd{\([^}]*\)}/\1\2/
|
||||||
s/\(redr{[^@]*\)@func{\([^}]*\)}/\1\2/
|
s/\(redr{[^@}]*\)@func{\([^}]*\)}/\1\2/
|
||||||
s/\(redr{[^@]*\)@sbin{\([^}]*\)}/\1\2/
|
s/\(redr{[^@}]*\)@sbin{\([^}]*\)}/\1\2/
|
||||||
s/\(redr{[^@]*\)@fsfo{\([^}]*\)}/\1\2/
|
s/\(redr{[^@}]*\)@fsfo{\([^}]*\)}/\1\2/
|
||||||
s/\(redr{[^}]*\)}\( *\)@path{\([^}]*\)/\1\2\3/
|
s/\(redr{[^}]*\)}\( *\)@path{\([^}]*\)/\1\2\3/
|
||||||
t cleanredr
|
t cleanredr
|
||||||
}
|
}
|
||||||
/@fsfo/{
|
/@fsfo/{
|
||||||
:cleanfsfo
|
:cleanfsfo
|
||||||
s/\(fsfo{[^@]*\)@cmnd{\([^}]*\)}/\1\2/
|
s/\(fsfo{[^@}]*\)@cmnd{\([^}]*\)}/\1\2/
|
||||||
s/\(fsfo{[^@]*\)@func{\([^}]*\)}/\1\2/
|
s/\(fsfo{[^@}]*\)@func{\([^}]*\)}/\1\2/
|
||||||
s/\(fsfo{[^@]*\)@sbin{\([^}]*\)}/\1\2/
|
s/\(fsfo{[^@}]*\)@sbin{\([^}]*\)}/\1\2/
|
||||||
t cleanfsfo
|
t cleanfsfo
|
||||||
}
|
}
|
||||||
#.
|
#.
|
||||||
# Finally, restructure to follow Fish's command [arguments] semantics.
|
# Finally, restructure to follow Fish's command [arguments] semantics.
|
||||||
# Find the initial command, and change any others to arguments, up to a ( or ;
|
# Find the initial command, and change any others to arguments, up to a |, ( or ;
|
||||||
# Assumes that a valid line will start with either a builtin, a function or a binary.
|
# Assumes that a valid line will start with either a builtin, a function or a binary.
|
||||||
#.
|
#.
|
||||||
|
s/^\([ ]*\)@cmnd\(.*\)/\1@xcmd\
|
||||||
|
\2/
|
||||||
|
t castargs
|
||||||
|
s/^\([ ]*\)@func\(.*\)/\1@xfnc\
|
||||||
|
\2/
|
||||||
|
t castargs
|
||||||
|
s/^\([ ]*\)@sbin\(.*\)/\1@xbin\
|
||||||
|
\2/
|
||||||
|
t castargs
|
||||||
:nextcmnd
|
:nextcmnd
|
||||||
s/@cmnd\(.*\)$/@xcmd\
|
s/@cmnd\(.*\)$/@xcmd\
|
||||||
\1/
|
\1/
|
||||||
|
@ -247,6 +259,7 @@ t castargs
|
||||||
b cleancmd
|
b cleancmd
|
||||||
:castargs
|
:castargs
|
||||||
s/\n\([^;(]*[;(]\)/\1/
|
s/\n\([^;(]*[;(]\)/\1/
|
||||||
|
s/\n\([^@]*@redr{|}\)/\1/
|
||||||
t nextcmnd
|
t nextcmnd
|
||||||
s/\n\([^@]*\)@cmnd\(.*\)/\1@args\
|
s/\n\([^@]*\)@cmnd\(.*\)/\1@args\
|
||||||
\2/
|
\2/
|
||||||
|
@ -271,8 +284,8 @@ s/</\</g
|
||||||
s/>/\>/g
|
s/>/\>/g
|
||||||
#.
|
#.
|
||||||
# Uncomment the folowing two lines (ss) to log the final output, sent to Doxygen.
|
# Uncomment the folowing two lines (ss) to log the final output, sent to Doxygen.
|
||||||
# s/^.*$/OUT : &/w debug-lexicon.log
|
s/^.*$/OUT : &/w debug-lexicon.log
|
||||||
# s/^OUT : //
|
s/^OUT : //
|
||||||
#.
|
#.
|
||||||
# Lines are reassembled, so branch to end
|
# Lines are reassembled, so branch to end
|
||||||
b
|
b
|
||||||
|
|
Loading…
Reference in a new issue