Skip to content

Commit afa6bb3

Browse files
committed
states work: Extend state machine documentation.
1 parent 1ac39b0 commit afa6bb3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

highlighters/main/main-highlighter.zsh

+5
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ _zsh_highlight_main_highlighter()
131131
# - :regular: "Not a command word".
132132
# Mainly used to detect premature termination of commands.
133133
#
134+
# When the kind of a word is not yet known, $this_word / $next_word may contain
135+
# multiple states. For example, after "sudo -i", the next word may be either
136+
# another --flag or a command name, hence the state would include both :start:
137+
# and :sudo_opt:.
138+
#
134139
# The tokens are always added with both leading and trailing colons to serve as
135140
# word delimiters (an improvised array); [[ $x == *:foo:* ]] and x=${x//:foo:/}
136141
# will DTRT regardless of how many elements or repetitions $x has..

0 commit comments

Comments
 (0)