diff options
-rw-r--r-- | runtime/syntax/testdir/dumps/vim_variables_00.dump | 20 | ||||
-rw-r--r-- | runtime/syntax/testdir/dumps/vim_variables_01.dump | 20 | ||||
-rw-r--r-- | runtime/syntax/testdir/dumps/vim_variables_02.dump | 20 | ||||
-rw-r--r-- | runtime/syntax/testdir/dumps/vim_variables_03.dump | 20 | ||||
-rw-r--r-- | runtime/syntax/testdir/dumps/vim_variables_04.dump | 20 | ||||
-rw-r--r-- | runtime/syntax/testdir/dumps/vim_variables_05.dump | 20 | ||||
-rw-r--r-- | runtime/syntax/testdir/dumps/vim_variables_06.dump | 20 | ||||
-rw-r--r-- | runtime/syntax/testdir/dumps/vim_variables_07.dump | 20 | ||||
-rw-r--r-- | runtime/syntax/testdir/dumps/vim_variables_99.dump | 36 | ||||
-rw-r--r-- | runtime/syntax/testdir/input/vim_variables.vim | 127 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 24 |
11 files changed, 316 insertions, 31 deletions
diff --git a/runtime/syntax/testdir/dumps/vim_variables_00.dump b/runtime/syntax/testdir/dumps/vim_variables_00.dump index ecf420d43d..9794113405 100644 --- a/runtime/syntax/testdir/dumps/vim_variables_00.dump +++ b/runtime/syntax/testdir/dumps/vim_variables_00.dump @@ -1,20 +1,20 @@ >"+0#0000e05#ffffff0| |V|i|m| |v|a|r|i|a|b|l|e| |h|i|g|h|l|i|g|h|t|i|n|g| +0#0000000&@47 @75 +|"+0#0000e05&| |:|l|e|t| +0#0000000&@68 +@75 |l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|e|x|p|r| @60 @75 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1|[+0#0000000&|0+0#e000002&|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @57 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1|[+0#0000000&|1+0#e000002&|:+0#0000000&|2+0#e000002&|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @55 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1|[+0#0000000&|:|2+0#e000002&|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @56 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1|[+0#0000000&|1+0#e000002&|:+0#0000000&|]| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @56 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1|[+0#0000000&|:|]| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @57 +@75 |l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|++0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 |l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|-+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 |l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|*+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 |l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|/+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 |l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|%+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 |l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 -|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|.+0#af5f00255&@1|=| +0#0000000&|e|x|p|r| @58 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|"+0#0000000&|i|n|p|u|t|/|v|i|m|_|v|a|r|i|a|b|l|e|s|.|v|i|m|"| |1@1|L|,| |1|5|8|B| @21|1|,|1| @10|A|l@1| +|"|i|n|p|u|t|/|v|i|m|_|v|a|r|i|a|b|l|e|s|.|v|i|m|"| |1|3|8|L|,| |1|5@1|4|B| @19|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_variables_01.dump b/runtime/syntax/testdir/dumps/vim_variables_01.dump new file mode 100644 index 0000000000..f1ce29d3ff --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_variables_01.dump @@ -0,0 +1,20 @@ +|l+0#af5f00255#ffffff0|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|++0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|-+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|*+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|/+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|%+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 +>l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|.+0#af5f00255&@1|=| +0#0000000&|e|x|p|r| @58 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|e|x|p|r| @59 +|l+0#af5f00255&|e|t| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @58 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|@+0#e000e06&|f| +0#0000000&|=+0#af5f00255&| +0#0000000&|e|x|p|r| @61 +|l+0#af5f00255&|e|t| +0#0000000&|@+0#e000e06&|f| +0#0000000&|.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @60 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|f|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|e|x|p|r| @59 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|t|_|k|1| +0#0000000&|=+0#af5f00255&| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|E+0#e000002&|s|c|>|[|2|3|4|;|"| +0#0000000&@49 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|f|o@1| +0#0000000&|.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @58 +@57|1|9|,|1| @9|1|0|%| diff --git a/runtime/syntax/testdir/dumps/vim_variables_02.dump b/runtime/syntax/testdir/dumps/vim_variables_02.dump new file mode 100644 index 0000000000..8f31c4709a --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_variables_02.dump @@ -0,0 +1,20 @@ +|l+0#af5f00255#ffffff0|e|t| +0#0000000&|&+0#00e0e07&|f|o@1| +0#0000000&|.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @58 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|f|o@1| +0#0000000&|++0#af5f00255&|=| +0#0000000&|e|x|p|r| @58 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|f|o@1| +0#0000000&|-+0#af5f00255&|=| +0#0000000&|e|x|p|r| @58 +@75 +>l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|l|:|f|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|e|x|p|r| @57 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|l|:|f|o@1| +0#0000000&|.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @56 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|l|:|f|o@1| +0#0000000&|++0#af5f00255&|=| +0#0000000&|e|x|p|r| @56 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|l|:|f|o@1| +0#0000000&|-+0#af5f00255&|=| +0#0000000&|e|x|p|r| @56 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|g|:|f|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|e|x|p|r| @57 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|g|:|f|o@1| +0#0000000&|.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @56 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|g|:|f|o@1| +0#0000000&|++0#af5f00255&|=| +0#0000000&|e|x|p|r| @56 +|l+0#af5f00255&|e|t| +0#0000000&|&+0#00e0e07&|g|:|f|o@1| +0#0000000&|-+0#af5f00255&|=| +0#0000000&|e|x|p|r| @56 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @53 +|l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| @65 +@57|3|7|,|1| @9|2|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_variables_03.dump b/runtime/syntax/testdir/dumps/vim_variables_03.dump new file mode 100644 index 0000000000..3260c374b1 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_variables_03.dump @@ -0,0 +1,20 @@ +|l+0#af5f00255#ffffff0|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| @65 +| +0#e000e06&@5|\| +0#0000000&|b+0#00e0e07&|a|r|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @55 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|]+0#0000000&| |.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @52 +|l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|]+0#0000000&| |++0#af5f00255&|=| +0#0000000&|e|x|p|r| @52 +>l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|]+0#0000000&| |-+0#af5f00255&|=| +0#0000000&|e|x|p|r| @52 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|;+0#0000000&| |b+0#00e0e07&|a|z|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @48 +|l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| @65 +| +0#e000e06&@5|\| +0#0000000&|b+0#00e0e07&|a|r|;+0#0000000&| @62 +| +0#e000e06&@5|\| +0#0000000&|b+0#00e0e07&|a|z|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @55 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|;+0#0000000&| |b+0#00e0e07&|a|z|]+0#0000000&| |.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @47 +|l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|;+0#0000000&| |b+0#00e0e07&|a|z|]+0#0000000&| |++0#af5f00255&|=| +0#0000000&|e|x|p|r| @47 +|l+0#af5f00255&|e|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|;+0#0000000&| |b+0#00e0e07&|a|z|]+0#0000000&| |-+0#af5f00255&|=| +0#0000000&|e|x|p|r| @47 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |E|N|D| +0#0000000&@59 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +@57|5@1|,|1| @9|4|1|%| diff --git a/runtime/syntax/testdir/dumps/vim_variables_04.dump b/runtime/syntax/testdir/dumps/vim_variables_04.dump new file mode 100644 index 0000000000..97d240ca8f --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_variables_04.dump @@ -0,0 +1,20 @@ +|E+0#e000e06#ffffff0|N|D| +0#0000000&@71 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |t|r|i|m| |E|N|D| +0#0000000&@54 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |e|v|a|l| |E|N|D| +0#0000000&@54 +>.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |t|r|i|m| |e|v|a|l| |E|N|D| +0#0000000&@49 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |e|v|a|l| |t|r|i|m| |E|N|D| +0#0000000&@49 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@67 +|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b|a|r| @63 +@75 +|"+0#0000e05&| |:|u|n|l|e|t| +0#0000000&@66 +@75 +@57|7|3|,|1| @9|5|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_variables_05.dump b/runtime/syntax/testdir/dumps/vim_variables_05.dump new file mode 100644 index 0000000000..7a932601b9 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_variables_05.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@65 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@61 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@65 +| +0#e000e06&@5|\| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@63 +> @74 +|u+0#af5f00255&|n|l|e|t|!| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@64 +|u+0#af5f00255&|n|l|e|t|!| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@60 +|u+0#af5f00255&|n|l|e|t|!| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@64 +| +0#e000e06&@5|\| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@63 +@75 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&@64 +|u+0#af5f00255&|n|l|e|t|!| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&@63 +@75 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|l+0#00e0e07&|i|s|t|[+0#0000000&|3+0#e000002&|]+0#0000000&| @61 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|l+0#00e0e07&|i|s|t|[+0#0000000&|3+0#e000002&|:+0#0000000&|]| @60 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|d+0#00e0e07&|i|c|t|[+0#0000000&|'+0#e000002&|t|w|o|'|]+0#0000000&| @57 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|d+0#00e0e07&|i|c|t|.+0#0000000&|t+0#00e0e07&|w|o| +0#0000000&@60 +@75 +@57|9|1|,|0|-|1| @7|7|1|%| diff --git a/runtime/syntax/testdir/dumps/vim_variables_06.dump b/runtime/syntax/testdir/dumps/vim_variables_06.dump new file mode 100644 index 0000000000..89b3d41fda --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_variables_06.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| |:|c|o|n|s|t| +0#0000000&@66 +@75 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|e|x|p|r| @58 +@75 +>c+0#af5f00255&|o|n|s|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @51 +@75 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|;+0#0000000&| |b+0#00e0e07&|a|z|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e|x|p|r| @46 +@75 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |E|N|D| +0#0000000&@57 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |t|r|i|m| |E|N|D| +0#0000000&@52 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |e|v|a|l| |E|N|D| +0#0000000&@52 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |t|r|i|m| |e|v|a|l| |E|N|D| +0#0000000&@47 +@57|1|0|9|,|1| @8|8|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_variables_07.dump b/runtime/syntax/testdir/dumps/vim_variables_07.dump new file mode 100644 index 0000000000..8be0fa8020 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_variables_07.dump @@ -0,0 +1,20 @@ +|c+0#af5f00255#ffffff0|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |t|r|i|m| |e|v|a|l| |E|N|D| +0#0000000&@47 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |e|v|a|l| |t|r|i|m| |E|N|D| +0#0000000&@47 +|.+0#e000002&@2| +0#0000000&@71 +>E+0#e000e06&|N|D| +0#0000000&@71 +@75 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@65 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b|a|r| @61 +@75 +|"+0#0000e05&| |:|f|o|r| +0#0000000&@68 +@75 +|f|o|r| |f+0#00e0e07&|o@1| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|e|x|p|r| @59 +|e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68 +@75 +|f|o|r| |[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|]+0#0000000&| |i+0#af5f00255&|n| +0#0000000&|e|x|p|r| @52 +|e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68 +|~+0#4040ff13&| @73 +|~| @73 +| +0#0000000&@56|1|2|7|,|1| @8|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_variables_99.dump b/runtime/syntax/testdir/dumps/vim_variables_99.dump index 230c121d10..6f3e1c4443 100644 --- a/runtime/syntax/testdir/dumps/vim_variables_99.dump +++ b/runtime/syntax/testdir/dumps/vim_variables_99.dump @@ -1,20 +1,20 @@ -|"+0#0000e05#ffffff0| |V|i|m| |v|a|r|i|a|b|l|e| |h|i|g|h|l|i|g|h|t|i|n|g| +0#0000000&@47 +|.+0#e000002#ffffff0@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |t|r|i|m| |e|v|a|l| |E|N|D| +0#0000000&@47 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#e000e06&|<@1| |e|v|a|l| |t|r|i|m| |E|N|D| +0#0000000&@47 +|.+0#e000002&@2| +0#0000000&@71 +|E+0#e000e06&|N|D| +0#0000000&@71 @75 -|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|e|x|p|r| @60 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@65 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b|a|r| @61 @75 -|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|++0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 -|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|-+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 -|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|*+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 -|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|/+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 -|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|%+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 -|l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|.+0#af5f00255&|=| +0#0000000&|e|x|p|r| @59 ->l+0#af5f00255&|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|.+0#af5f00255&@1|=| +0#0000000&|e|x|p|r| @58 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|"+0#0000000&|i|n|p|u|t|/|v|i|m|_|v|a|r|i|a|b|l|e|s|.|v|i|m|"| |1@1|L|,| |1|5|8|B| @21|1@1|,|1| @9|A|l@1| +|"+0#0000e05&| |:|f|o|r| +0#0000000&@68 +@75 +|f|o|r| |f+0#00e0e07&|o@1| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|e|x|p|r| @59 +|e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68 +@75 +|f|o|r| |[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|]+0#0000000&| |i+0#af5f00255&|n| +0#0000000&|e|x|p|r| @52 +>e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68 +@57|1|3|8|,|1| @8|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_variables.vim b/runtime/syntax/testdir/input/vim_variables.vim index 93ad6d911f..6f77da99fb 100644 --- a/runtime/syntax/testdir/input/vim_variables.vim +++ b/runtime/syntax/testdir/input/vim_variables.vim @@ -1,7 +1,16 @@ " Vim variable highlighting +" :let + let foo = expr +let foo[0] = expr + +let foo[1:2] = expr +let foo[:2] = expr +let foo[1:] = expr +let foo[:] = expr + let foo += expr let foo -= expr let foo *= expr @@ -9,3 +18,121 @@ let foo /= expr let foo %= expr let foo .= expr let foo ..= expr + +let $FOO = expr +let $FOO .= expr + +let @f = expr +let @f .= expr + +let &foo = expr + +let &t_k1 = "\<Esc>[234;" + +let &foo .= expr + +let &foo += expr +let &foo -= expr + +let &l:foo = expr + +let &l:foo .= expr +let &l:foo += expr +let &l:foo -= expr + +let &g:foo = expr + +let &g:foo .= expr +let &g:foo += expr +let &g:foo -= expr + +let [foo, bar] = expr +let [foo, + \ bar] = expr + +let [foo, bar] .= expr +let [foo, bar] += expr +let [foo, bar] -= expr + +let [foo, bar; baz] = expr +let [foo, + \ bar; + \ baz] = expr + +let [foo, bar; baz] .= expr +let [foo, bar; baz] += expr +let [foo, bar; baz] -= expr + +let foo =<< END +... +END +let foo =<< trim END +... +END +let foo =<< eval END +... +END +let foo =<< trim eval END +... +END +let foo =<< eval trim END +... +END + +let foo +let foo bar + +" :unlet + +unlet foo +unlet foo bar +unlet foo + \ bar + +unlet! foo +unlet! foo bar +unlet! foo + \ bar + +unlet $FOO +unlet! $FOO + +unlet list[3] +unlet list[3:] +unlet dict['two'] +unlet dict.two + +" :const + +const foo = expr + +const [foo, bar] = expr + +const [foo, bar; baz] = expr + +const foo =<< END +... +END +const foo =<< trim END +... +END +const foo =<< eval END +... +END +const foo =<< trim eval END +... +END +const foo =<< eval trim END +... +END + +const foo +const foo bar + +" :for + +for foo in expr +endfor + +for [foo, bar] in expr +endfor diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 5eb3154963..5697ce3f6d 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -4,7 +4,8 @@ " Last Change: May 09, 2023 " 2023 Nov 12 by Vim Project (:let-heredoc improvements) " 2023 Nov 20 by Vim Project (:loadkeymap improvements) -" 2023 Dec 06 by Vim Project (add missing :let{op}= assignment operators) +" 2023 Dec 06 by Vim Project (add missing assignment operators) +" 2023 Dec 10 by Vim Project (improve variable matching) " Version: 9.0-25 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM " Automatically generated keyword lists: {{{1 @@ -187,7 +188,9 @@ syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimEcho,v syn match vimIsCommand "\<\h\w*\>" contains=vimCommand syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" -syn match vimVar "\s\zs&\a\+\>" +syn match vimVar "\s\zs&\%([lg]:\)\=\a\+\>" +syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>" +syn match vimVar "\s\zs&t_k;" syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" syn keyword vimCommand contained in @@ -395,6 +398,7 @@ syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]' syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]' syn match vimRegister '@"' syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]' +syn match vimLetRegister contained '@["0-9\-a-zA-Z#=*+_/]' syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1 syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1 @@ -417,10 +421,20 @@ syn match vimSetMod contained "&vim\=\|[!&?<]\|all&" " Let And Var: {{{2 " =========== -syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc +syn keyword vimLet let skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc,vimLetRegister,vimVarList +syn keyword vimConst cons[t] skipwhite nextgroup=vimVar,vimLetHereDoc,vimVarList +syn region vimVarList contained start="\[" end="]" contains=vimVar,vimContinue + +syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars +syn match vimUnletBang contained "!" skipwhite nextgroup=vimUnletVars +syn region vimUnletVars contained start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber + VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' syn keyword vimLet var skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc +" For: {{{2 +" === +syn keyword vimFor for skipwhite nextgroup=vimVar,vimVarList " Abbreviations: {{{2 " ============= syn keyword vimAbb ab[breviate] ca[bbrev] inorea[bbrev] cnorea[bbrev] norea[bbrev] ia[bbrev] skipwhite nextgroup=vimMapMod,vimMapLhs @@ -909,6 +923,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimCommentString vimString hi def link vimCommentTitle PreProc hi def link vimCondHL vimCommand + hi def link vimConst vimCommand hi def link vimContinue Special hi def link vimCtrlChar SpecialChar hi def link vimEchoHLNone vimGroup @@ -959,6 +974,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimLetHereDoc vimString hi def link vimLetHereDocStart Special hi def link vimLetHereDocStop Special + hi def link vimLetRegister Special hi def link vimLineComment vimComment hi def link vim9LineComment vimComment hi def link vimMapBang vimCommand @@ -1035,6 +1051,8 @@ if !exists("skip_vim_syntax_inits") hi def link vimSynType vimSpecial hi def link vimTodo Todo hi def link vimType Type + hi def link vimUnlet vimCommand + hi def link vimUnletBang vimCommand hi def link vimUnmap vimMap hi def link vimUserAttrbCmpltFunc Special hi def link vimUserAttrbCmplt vimSpecial |