doc: sample: add/update sample source files
This commit is contained in:
+14
-11
@@ -31,12 +31,12 @@ $a$b
|
||||
# VAR(a)
|
||||
# VAR(b)
|
||||
|
||||
# When the parser encounters SYMBOL(%) it should switch the lexer to COMMAND
|
||||
# When the parser encounters SYMBOL(&) it should switch the lexer to COMMAND
|
||||
# mode, which will allow the following word construction to be used.
|
||||
# this executes the command whose name is equal to concatenating the values
|
||||
# of $a and $b (in this case, '24')
|
||||
% $a$b
|
||||
# SYMBOL(%)
|
||||
& $a$b
|
||||
# SYMBOL(&)
|
||||
# WORD_START
|
||||
# VAR(a)
|
||||
# VAR(b)
|
||||
@@ -51,7 +51,7 @@ a+2b
|
||||
# the first char encountered is a symbol, which is read as a word in COMMAND
|
||||
# mode
|
||||
-no$a
|
||||
# WORD(-no)
|
||||
# WORD(-no$a)
|
||||
|
||||
# returns the result of applying the NOT operator to the value of $a.
|
||||
# the first char encountered is a symbol, which is read as a word in COMMAND
|
||||
@@ -62,16 +62,19 @@ a+2b
|
||||
# OP(not)
|
||||
# VAR(a)
|
||||
|
||||
# executes the command with the name '-not$a' ($a is NOT substituted)
|
||||
# executes the command with the name '-not$a' ($a is substituted)
|
||||
# because of the preceding hyphen, variable substitution is not performed.
|
||||
% -not$a
|
||||
# SYMBOL(%)
|
||||
# WORD(-not$a)
|
||||
& -not$a
|
||||
# SYMBOL(&)
|
||||
# WORD_START
|
||||
# WORD(-not)
|
||||
# VAR(a)
|
||||
# WORD_END
|
||||
|
||||
# executes the command with the name '-not2' ($a IS substituted)
|
||||
# executes the command with the name "-not$a" ($a IS substituted)
|
||||
# variable substitution IS performed in dquote strings regardless of the hyphen.
|
||||
% "-not$a"
|
||||
# SYMBOL(%)
|
||||
& "-not$a"
|
||||
# SYMBOL(&)
|
||||
# STR_START
|
||||
# STRING(-not)
|
||||
# VAR(a)
|
||||
|
||||
Reference in New Issue
Block a user