diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index ccfd2deaed..02efe9301b 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -65,6 +65,7 @@ runtime/compiler/gawk.vim @dkearns runtime/compiler/gjs.vim @dkearns runtime/compiler/gm2.vim @dkearns runtime/compiler/go.vim @dbarnett +runtime/compiler/groff.vim @Konfekt runtime/compiler/haml.vim @tpope runtime/compiler/hare.vim @selenebun runtime/compiler/icon.vim @dkearns @@ -75,6 +76,7 @@ runtime/compiler/jshint.vim @dkearns runtime/compiler/jsonlint.vim @dkearns runtime/compiler/jq.vim @vito-c runtime/compiler/lazbuild.vim @dkearns +runtime/compiler/pandoc.vim @Konfekt runtime/compiler/perl.vim @petdance @heptite runtime/compiler/perlcritic.vim @petdance @dkearns runtime/compiler/php.vim @dkearns diff --git a/runtime/compiler/README.txt b/runtime/compiler/README.txt index dccf4a9762..327d0a7fde 100644 --- a/runtime/compiler/README.txt +++ b/runtime/compiler/README.txt @@ -4,6 +4,8 @@ They are used with the ":compiler" command. These scripts usually set options, for example 'errorformat'. See ":help write-compiler-plugin". +To undo the effect of a compiler plugin, use the make compiler plugin. + If you want to write your own compiler plugin, have a look at the other files for how to do it, the format is simple. diff --git a/runtime/compiler/groff.vim b/runtime/compiler/groff.vim new file mode 100644 index 0000000000..640146d6a1 --- /dev/null +++ b/runtime/compiler/groff.vim @@ -0,0 +1,45 @@ +" Vim compiler file +" Compiler: Groff +" Maintainer: Konfekt +" Last Change: 2024 Sep 8 +" +" Expects output file extension, say `:make html` or `:make pdf`. +" Supported devices as of Sept 2024 are: (x)html, pdf, ps, dvi, lj4, lbp ... +" Adjust command-line flags, language, encoding by buffer-local/global variables +" groff_compiler_args, groff_compiler_lang, and groff_compiler_encoding, +" which default to '', &spelllang and 'utf8'. + +if exists("current_compiler") + finish +endif + +let s:keepcpo = &cpo +set cpo&vim + +let current_compiler = 'groff' + +silent! function s:groff_compiler_lang() + let lang = get(b:, 'groff_compiler_lang', + \ &spell ? matchstr(&spelllang, '^\a\a') : '') + if lang ==# 'en' | let lang = '' | endif + return empty(lang) ? '' : '-m'..lang +endfunction + +" Requires output format (= device) to be set by user after :make. +execute 'CompilerSet makeprg=groff'..escape( + \ ' '..s:groff_compiler_lang().. + \ ' -K'..get(b:, 'groff_compiler_encoding', get(g:, 'groff_compiler_encoding', 'utf8')).. + \ ' '..get(b:, 'groff_compiler_args', get(g:, 'groff_compiler_args', '')).. + \ ' -mom -T$* -- %:S > %:r:S.$*', ' ') +" From Gavin Freeborn's https://github.com/Gavinok/vim-troff under Vim License +" https://github.com/Gavinok/vim-troff/blob/91017b1423caa80aba541c997909a4f810edd275/compiler/troff.vim#L39 +CompilerSet errorformat=%o:\ (%f):%l:%m, + \%o:\ \ (%f):%l:%m, + \%o:%f:%l:%m, + \%o:\ %f:%l:%m, + \%f:%l:\ macro\ %trror:%m, + \%f:%l:%m, + \%W%tarning:\ file\ '%f'\\,\ around\ line\ %l:,%Z%m + +let &cpo = s:keepcpo +unlet s:keepcpo diff --git a/runtime/compiler/make.vim b/runtime/compiler/make.vim new file mode 100644 index 0000000000..748251bf8e --- /dev/null +++ b/runtime/compiler/make.vim @@ -0,0 +1,13 @@ +" Vim compiler plugin +" +" Maintainer: The Vim Project +" Last Change: 2024 Sep 10 +" Original Author: Konfekt +" +" This compiler plugin is used to reset previously set compiler options. + +if exists("g:current_compiler") | unlet g:current_compiler | endif +if exists("b:current_compiler") | unlet b:current_compiler | endif + +CompilerSet makeprg& +CompilerSet errorformat& diff --git a/runtime/compiler/pandoc.vim b/runtime/compiler/pandoc.vim index ecc935a836..6c15e104c3 100644 --- a/runtime/compiler/pandoc.vim +++ b/runtime/compiler/pandoc.vim @@ -1,10 +1,12 @@ " Vim compiler file " Compiler: Pandoc " Maintainer: Konfekt -" Last Change: 2024 Aug 20 +" Last Change: 2024 Sep 8 " " Expects output file extension, say `:make html` or `:make pdf`. " Passes additional arguments to pandoc, say `:make html --self-contained`. +" Adjust command-line flags by buffer-local/global variable +" b/g:pandoc_compiler_args which defaults to empty. if exists("current_compiler") finish @@ -40,18 +42,21 @@ silent! function s:PandocFiletype(filetype) abort endif endfunction -let b:pandoc_compiler_from = get(b:, 'pandoc_compiler_from', s:PandocFiletype(&filetype)) -let b:pandoc_compiler_lang = get(b:, 'pandoc_compiler_lang', &spell ? matchstr(&spelllang, '^\a\a') : '') +silent! function s:PandocLang() + let lang = get(b:, 'pandoc_compiler_lang', + \ &spell ? matchstr(&spelllang, '^\a\a') : '') + if lang ==# 'en' | let lang = '' | endif + return empty(lang) ? '' : '--metadata lang='..lang +endfunction execute 'CompilerSet makeprg=pandoc'..escape( - \ ' --standalone' . - \ (b:pandoc_compiler_from ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s+\S+', 'cnw') > 0)) ? - \ '' : ' --metadata title=%:t:r:S') . - \ (empty(b:pandoc_compiler_lang) ? - \ '' : ' --metadata lang='..b:pandoc_compiler_lang) . - \ ' --from='..b:pandoc_compiler_from . - \ ' '..get(b:, 'pandoc_compiler_args', get(g:, 'pandoc_compiler_args', '')) . - \ ' --output %:r:S.$* -- %:S', ' ') + \ ' --standalone'.. + \ (s:PandocFiletype(&filetype) ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s+\S+', 'cnw') > 0)) ? + \ '' : ' --metadata title=%:t:r:S').. + \ ' '..s:PandocLang().. + \ ' --from='..s:PandocFiletype(&filetype).. + \ ' '..get(b:, 'pandoc_compiler_args', get(g:, 'pandoc_compiler_args', '')).. + \ ' --output %:r:S.$* -- %:S', ' ') CompilerSet errorformat=\"%f\",\ line\ %l:\ %m let &cpo = s:keepcpo diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 8e1cffc841..48c8dce439 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2024 Aug 08 +*builtin.txt* For Vim version 9.1. Last change: 2024 Sep 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -8965,6 +8965,9 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) {timeout} is 500 the search stops after half a second. The value must not be negative. A zero value is like not giving the argument. + + Note: the timeout is only considered when searching, not + while evaluating the {skip} expression. {only available when compiled with the |+reltime| feature} If the {skip} expression is given it is evaluated with the diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 7bcb32fbeb..4bafe4c9af 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2024 Sep 07 +*options.txt* For Vim version 9.1. Last change: 2024 Sep 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2163,10 +2163,7 @@ A jump table for the options with a short description can be found at |Q_op|. fuzzy Enable |fuzzy-matching| for completion candidates. This allows for more flexible and intuitive matching, where characters can be skipped and matches can be found even - if the exact sequence is not typed. Only makes a - difference how completion candidates are reduced from the - list of alternatives, but not how the candidates are - collected (using different completion types). + if the exact sequence is not typed. *'completepopup'* *'cpp'* 'completepopup' 'cpp' string (default empty) diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index e44c5d5ee8..ea5f01d25e 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2024 Aug 20 +*quickfix.txt* For Vim version 9.1. Last change: 2024 Sep 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1276,6 +1276,7 @@ not "b:current_compiler". What the command actually does is the following: For writing a compiler plugin, see |write-compiler-plugin|. +Use the |compiler-make| plugin to undo the effect of a compiler plugin. DOTNET *compiler-dotnet* @@ -1291,7 +1292,6 @@ Example: limit output to only display errors, and suppress the project name: > let dotnet_show_project_file = v:false compiler dotnet < - GCC *quickfix-gcc* *compiler-gcc* There's one variable you can set for the GCC compiler: @@ -1302,7 +1302,6 @@ g:compiler_gcc_ignore_unmatched_lines commands run from make are generating false positives. - JAVAC *compiler-javac* Commonly used compiler options can be added to 'makeprg' by setting the @@ -1310,6 +1309,12 @@ g:javac_makeprg_params variable. For example: > let g:javac_makeprg_params = "-Xlint:all -encoding utf-8" < +GNU MAKE *compiler-make* + +Since the default make program is "make", the compiler plugin for make, +:compiler make, will reset the 'makeprg' and 'errorformat' option to +the default values and unlet any variables that may have been set by a +previous compiler plugin. MANX AZTEC C *quickfix-manx* *compiler-manx* @@ -1335,6 +1340,18 @@ If Vim was started from the compiler, the :sh and some :! commands will not work, because Vim is then running in the same process as the compiler and stdin (standard input) will not be interactive. +GROFF *quickfix-groff* *compiler-groff* + +The GROFF compiler plugin uses the mom macro set (documented in the groff_mom +manpage) as input and expects that the output file type extension is passed to +make, say :make html or :make pdf. + +Additional arguments can be passed to groff by setting them in +`b:groff_compiler_args` or `g:groff_compiler_args`. The `language` argument +passed to groff is set using 'spelllang'; it can be overridden by setting +`b:groff_compiler_lang`. The default enconding is `UTF-8` and can be changed +by setting `b:groff_compiler_encoding` or `g:groff_compiler_encoding`. + PANDOC *quickfix-pandoc* *compiler-pandoc* The Pandoc compiler plugin expects that an output file type extension is @@ -1347,8 +1364,7 @@ Additional arguments can be passed to pandoc: The `--from` argument is an educated guess using the buffer file type; it can be overridden by setting `b:pandoc_compiler_from`. -Likewise the `--metadata lang` argument is set using `&spelllang`; -it can be overridden by setting `b:pandoc_compiler_lang`. +The `--metadata lang` argument is set using 'spelllang'; If `--from=markdown` is assumed and no title set in a title header or YAML block, then the filename (without extension) is used as the title. diff --git a/runtime/doc/tags b/runtime/doc/tags index 7cd2299ea2..88fc3bf3fb 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -6644,8 +6644,10 @@ compiler-decada ft_ada.txt /*compiler-decada* compiler-dotnet quickfix.txt /*compiler-dotnet* compiler-gcc quickfix.txt /*compiler-gcc* compiler-gnat ft_ada.txt /*compiler-gnat* +compiler-groff quickfix.txt /*compiler-groff* compiler-hpada ft_ada.txt /*compiler-hpada* compiler-javac quickfix.txt /*compiler-javac* +compiler-make quickfix.txt /*compiler-make* compiler-manx quickfix.txt /*compiler-manx* compiler-pandoc quickfix.txt /*compiler-pandoc* compiler-perl quickfix.txt /*compiler-perl* @@ -9806,6 +9808,7 @@ quickfix-directory-stack quickfix.txt /*quickfix-directory-stack* quickfix-error-lists quickfix.txt /*quickfix-error-lists* quickfix-functions usr_41.txt /*quickfix-functions* quickfix-gcc quickfix.txt /*quickfix-gcc* +quickfix-groff quickfix.txt /*quickfix-groff* quickfix-index quickfix.txt /*quickfix-index* quickfix-manx quickfix.txt /*quickfix-manx* quickfix-pandoc quickfix.txt /*quickfix-pandoc* diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 220b37173e..3af6d03eac 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -2371,7 +2371,7 @@ au BufNewFile,BufRead *.sml setf sml au BufNewFile,BufRead *.cm setf voscm " Swift -au BufNewFile,BufRead *.swift setf swift +au BufNewFile,BufRead *.swift,*.swiftinterface setf swift au BufNewFile,BufRead *.swift.gyb setf swiftgyb " Swift Intermediate Language or SILE diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim index 9040e19ce1..fa125be52c 100644 --- a/runtime/ftplugin/spec.vim +++ b/runtime/ftplugin/spec.vim @@ -2,8 +2,9 @@ " Filename: spec.vim " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com " Former Maintainer: Gustavo Niemeyer (until March 2014) -" Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko -" Update by Zdenek Dohnal, 2022 May 17 +" Last Change: 2015 Jun 01 +" Update by Zdenek Dohnal, 2022 May 17 +" 2024 Sep 10 by Vim Project: add epoch support for spec changelog, #15537 if exists("b:did_ftplugin") finish @@ -66,9 +67,11 @@ if !exists("*s:SpecChangelog") endif let line = 0 let name = "" + let epoch = "" let ver = "" let rel = "" let nameline = -1 + let epochline = -1 let verline = -1 let relline = -1 let chgline = -1 @@ -77,6 +80,9 @@ if !exists("*s:SpecChangelog") if name == "" && linestr =~? '^Name:' let nameline = line let name = substitute(strpart(linestr,5), '^[ ]*\([^ ]\+\)[ ]*$','\1','') + elseif epoch == "" && linestr =~? '^Epoch:' + let epochline = line + let epoch = substitute(strpart(linestr,6), '^[ ]*\([^ ]\+\)[ ]*$','\1','') elseif ver == "" && linestr =~? '^Version:' let verline = line let ver = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','') @@ -93,6 +99,7 @@ if !exists("*s:SpecChangelog") if nameline != -1 && verline != -1 && relline != -1 let include_release_info = exists("g:spec_chglog_release_info") let name = s:ParseRpmVars(name, nameline) + let epoch = s:ParseRpmVars(epoch, epochline) let ver = s:ParseRpmVars(ver, verline) let rel = s:ParseRpmVars(rel, relline) else @@ -117,6 +124,9 @@ if !exists("*s:SpecChangelog") if chgline != -1 let tmptime = v:lc_time language time C + if strlen(epoch) + let ver = epoch.":".ver + endif let parsed_format = "* ".strftime(format)." - ".ver."-".rel execute "language time" tmptime let release_info = "+ ".name."-".ver."-".rel diff --git a/runtime/syntax/dosini.vim b/runtime/syntax/dosini.vim index 66e17ec9af..e8212b6d2e 100644 --- a/runtime/syntax/dosini.vim +++ b/runtime/syntax/dosini.vim @@ -1,12 +1,12 @@ " Vim syntax file " Language: Configuration File (ini file) for MSDOS/MS Windows -" Version: 2.3 +" Version: 2.4 " Original Author: Sean M. McKee " Previous Maintainer: Nima Talebi " Current Maintainer: Hong Xu " Homepage: http://www.vim.org/scripts/script.php?script_id=3747 " Repository: https://github.com/xuhdev/syntax-dosini.vim -" Last Change: 2023 Aug 20 +" Last Change: 2024 Sept 08 " quit when a syntax file was already loaded @@ -27,7 +27,7 @@ syn match dosiniNumber "=\zs\s*\d\+\s*$" syn match dosiniNumber "=\zs\s*\d*\.\d\+\s*$" syn match dosiniNumber "=\zs\s*\d\+e[+-]\=\d\+\s*$" syn region dosiniHeader start="^\s*\[" end="\]" -syn match dosiniComment "^[#;].*$" +syn match dosiniComment "^[#;].*$" contains=@Spell syn region dosiniSection start="\s*\[.*\]" end="\ze\s*\[.*\]" fold \ contains=dosiniLabel,dosiniValue,dosiniNumber,dosiniHeader,dosiniComment diff --git a/runtime/syntax/idlang.vim b/runtime/syntax/idlang.vim index 14e976ce05..f7bfcb203a 100644 --- a/runtime/syntax/idlang.vim +++ b/runtime/syntax/idlang.vim @@ -1,7 +1,8 @@ " Interactive Data Language syntax file (IDL, too [:-)] " Maintainer: Aleksandar Jelenak -" Last change: 2011 Apr 11 -" Created by: Hermann Rochholz +" Created By: Hermann Rochholz +" Last Change: 2011 Apr 11 +" 2024 Sep 10 by Vim Project: update syntax script, #15419 " Remove any old syntax stuff hanging around " quit when a syntax file was already loaded @@ -16,7 +17,7 @@ syn match idlangStatement "^\s*function\s" syn keyword idlangStatement return continue mod do break syn keyword idlangStatement compile_opt forward_function goto syn keyword idlangStatement begin common end of -syn keyword idlangStatement inherits on_ioerror begin +syn keyword idlangStatement inherits on_error on_ioerror begin syn keyword idlangConditional if else then for while case switch syn keyword idlangConditional endcase endelse endfor endswitch @@ -82,7 +83,7 @@ syn keyword idlangRoutine CALL_EXTERNAL CALL_FUNCTION CALL_METHOD syn keyword idlangRoutine CALL_PROCEDURE CATCH CD CEIL CHEBYSHEV CHECK_MATH syn keyword idlangRoutine CHISQR_CVF CHISQR_PDF CHOLDC CHOLSOL CINDGEN syn keyword idlangRoutine CIR_3PNT CLOSE CLUST_WTS CLUSTER COLOR_CONVERT -syn keyword idlangRoutine COLOR_QUAN COLORMAP_APPLICABLE COMFIT COMMON +syn keyword idlangRoutine COLOR_QUAN COLORMAP_APPLICABLE COMFIT syn keyword idlangRoutine COMPLEX COMPLEXARR COMPLEXROUND syn keyword idlangRoutine COMPUTE_MESH_NORMALS COND CONGRID CONJ syn keyword idlangRoutine CONSTRAINED_MIN CONTOUR CONVERT_COORD CONVOL @@ -98,7 +99,7 @@ syn keyword idlangRoutine CW_PALETTE_EDITOR_GET CW_PALETTE_EDITOR_SET syn keyword idlangRoutine CW_PDMENU CW_RGBSLIDER CW_TMPL CW_ZOOM DBLARR syn keyword idlangRoutine DCINDGEN DCOMPLEX DCOMPLEXARR DEFINE_KEY DEFROI syn keyword idlangRoutine DEFSYSV DELETE_SYMBOL DELLOG DELVAR DERIV DERIVSIG -syn keyword idlangRoutine DETERM DEVICE DFPMIN DIALOG_MESSAGE +syn keyword idlangRoutine DETERM DEVICE DFPMIN DIAG_MATRIX DIALOG_MESSAGE syn keyword idlangRoutine DIALOG_PICKFILE DIALOG_PRINTERSETUP syn keyword idlangRoutine DIALOG_PRINTJOB DIALOG_READ_IMAGE syn keyword idlangRoutine DIALOG_WRITE_IMAGE DIGITAL_FILTER DILATE DINDGEN @@ -155,7 +156,7 @@ syn keyword idlangRoutine MPEG_PUT MPEG_SAVE MSG_CAT_CLOSE MSG_CAT_COMPILE syn keyword idlangRoutine MSG_CAT_OPEN MULTI N_ELEMENTS N_PARAMS N_TAGS syn keyword idlangRoutine NEWTON NORM OBJ_CLASS OBJ_DESTROY OBJ_ISA OBJ_NEW syn keyword idlangRoutine OBJ_VALID OBJARR ON_ERROR ON_IOERROR ONLINE_HELP -syn keyword idlangRoutine OPEN OPENR OPENW OPLOT OPLOTERR P_CORRELATE +syn keyword idlangRoutine OPEN OPENR OPENW OPENU OPLOT OPLOTERR P_CORRELATE syn keyword idlangRoutine PARTICLE_TRACE PCOMP PLOT PLOT_3DBOX PLOT_FIELD syn keyword idlangRoutine PLOTERR PLOTS PNT_LINE POINT_LUN POLAR_CONTOUR syn keyword idlangRoutine POLAR_SURFACE POLY POLY_2D POLY_AREA POLY_FIT diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index 8aa053d522..293d63c0a2 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -3,7 +3,7 @@ " Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> " Former Maintainer: Claudio Fleiner " Repository: https://github.com/zzzyxwvut/java-vim.git -" Last Change: 2024 Aug 26 +" Last Change: 2024 Sep 10 " Please check :help java.vim for comments on some of the options available. @@ -157,13 +157,20 @@ endif " testing in a project without attendant confusion for IDEs, with the " ".java\=" extension used for a production version and an arbitrary " extension used for a testing version. -if fnamemodify(bufname("%"), ":t") =~ '^module-info\%(\.class\>\)\@!' +if fnamemodify(bufname("%"), ":t") =~ '^module-info\>\%(\.class\>\)\@!' syn keyword javaModuleStorageClass module transitive syn keyword javaModuleStmt open requires exports opens uses provides syn keyword javaModuleExternal to with hi def link javaModuleStorageClass StorageClass hi def link javaModuleStmt Statement hi def link javaModuleExternal Include + + if !exists("g:java_ignore_javadoc") && g:main_syntax != 'jsp' + syn match javaDocProvidesTag contained "@provides\_s\+\S\+" contains=javaDocParam + syn match javaDocUsesTag contained "@uses\_s\+\S\+" contains=javaDocParam + hi def link javaDocProvidesTag Special + hi def link javaDocUsesTag Special + endif endif " Fancy parameterised types (JLS-17, ยง4.5). @@ -335,29 +342,99 @@ if !exists("g:java_ignore_javadoc") && g:main_syntax != 'jsp' call s:ReportOnce(v:exception) endtry - syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag,javaTodo,javaCommentError,javaSpaceError,@Spell fold - exec 'syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle end="\.$" end="\.[ \t\r]\@=" end="\%(^\s*\**\s*\)\@' . s:ff.Peek('80', '') . '<=@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,javaCommentError,javaSpaceError,@Spell,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag' - syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*\s*\r\=\n\=\s*\**\s*\%({@return\>\)\@=" matchgroup=javaCommentTitle end="}\%(\s*\.*\)*" contains=@javaHtml,javaCommentStar,javaTodo,javaCommentError,javaSpaceError,@Spell,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag - syn region javaDocTags contained start="{@\%(li\%(teral\|nk\%(plain\)\=\)\|inherit[Dd]oc\|doc[rR]oot\|value\)\>" end="}" - syn match javaDocTags contained "@\%(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam - syn match javaDocParam contained "\s\S\+" - syn match javaDocTags contained "@\%(version\|author\|return\|deprecated\|serial\%(Field\|Data\)\=\)\>" - syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam - syn match javaDocSeeTagParam contained @"\_[^"]\+"\|\|\%(\k\|\.\)*\%(#\k\+\%((\_[^)]*)\)\=\)\=@ contains=@javaHtml extend + syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,@javaDocTags,javaTodo,javaCommentError,javaSpaceError,@Spell fold + exec 'syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle end="\.$" end="\.[ \t\r]\@=" end="\%(^\s*\**\s*\)\@' . s:ff.Peek('80', '') . '<=@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,javaCommentError,javaSpaceError,@Spell,@javaDocTags' + syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*\s*\r\=\n\=\s*\**\s*\%({@return\>\)\@=" matchgroup=javaCommentTitle end="}\%(\s*\.*\)*" contains=@javaHtml,javaCommentStar,javaTodo,javaCommentError,javaSpaceError,@Spell,@javaDocTags,javaTitleSkipBlock + syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*\s*\r\=\n\=\s*\**\s*\%({@summary\>\)\@=" matchgroup=javaCommentTitle end="}" contains=@javaHtml,javaCommentStar,javaTodo,javaCommentError,javaSpaceError,@Spell,@javaDocTags,javaTitleSkipBlock + " The members of javaDocTags are sub-grouped according to the Java + " version of their introduction, and sub-group members in turn are + " arranged in alphabetical order, so that future newer members can + " be pre-sorted and appended without disturbing the current member + " placement. + " Since they only have significance in javaCommentTitle, neither + " javaDocSummaryTag nor javaDocReturnTitleTag are defined. + syn cluster javaDocTags contains=javaDocAuthorTag,javaDocDeprecatedTag,javaDocExceptionTag,javaDocParamTag,javaDocReturnTag,javaDocSeeTag,javaDocVersionTag,javaDocSinceTag,javaDocLinkTag,javaDocSerialTag,javaDocSerialDataTag,javaDocSerialFieldTag,javaDocThrowsTag,javaDocDocRootTag,javaDocInheritDocTag,javaDocLinkplainTag,javaDocValueTag,javaDocCodeTag,javaDocLiteralTag,javaDocHiddenTag,javaDocIndexTag,javaDocProvidesTag,javaDocUsesTag,javaDocSystemPropertyTag,javaDocSnippetTag,javaDocSpecTag + + " Anticipate non-standard inline tags in {@return} and {@summary}. + syn region javaTitleSkipBlock contained transparent start="{\%(@\%(return\|summary\)\>\)\@!" end="}" + syn match javaDocDocRootTag contained "{@docRoot}" + syn match javaDocInheritDocTag contained "{@inheritDoc}" + syn region javaIndexSkipBlock contained transparent start="{\%(@index\>\)\@!" end="}" contains=javaIndexSkipBlock,javaDocIndexTag + syn region javaDocIndexTag contained start="{@index\>" end="}" contains=javaDocIndexTag,javaIndexSkipBlock + syn region javaLinkSkipBlock contained transparent start="{\%(@link\>\)\@!" end="}" contains=javaLinkSkipBlock,javaDocLinkTag + syn region javaDocLinkTag contained start="{@link\>" end="}" contains=javaDocLinkTag,javaLinkSkipBlock + syn region javaLinkplainSkipBlock contained transparent start="{\%(@linkplain\>\)\@!" end="}" contains=javaLinkplainSkipBlock,javaDocLinkplainTag + syn region javaDocLinkplainTag contained start="{@linkplain\>" end="}" contains=javaDocLinkplainTag,javaLinkplainSkipBlock + syn region javaLiteralSkipBlock contained transparent start="{\%(@literal\>\)\@!" end="}" contains=javaLiteralSkipBlock,javaDocLiteralTag + syn region javaDocLiteralTag contained start="{@literal\>" end="}" contains=javaDocLiteralTag,javaLiteralSkipBlock + syn region javaSystemPropertySkipBlock contained transparent start="{\%(@systemProperty\>\)\@!" end="}" contains=javaSystemPropertySkipBlock,javaDocSystemPropertyTag + syn region javaDocSystemPropertyTag contained start="{@systemProperty\>" end="}" contains=javaDocSystemPropertyTag,javaSystemPropertySkipBlock + syn region javaValueSkipBlock contained transparent start="{\%(@value\>\)\@!" end="}" contains=javaValueSkipBlock,javaDocValueTag + syn region javaDocValueTag contained start="{@value\>" end="}" contains=javaDocValueTag,javaValueSkipBlock + + syn match javaDocParam contained "\s\zs\S\+" + syn match javaDocExceptionTag contained "@exception\s\+\S\+" contains=javaDocParam + syn match javaDocParamTag contained "@param\s\+\S\+" contains=javaDocParam + syn match javaDocSinceTag contained "@since\s\+\S\+" contains=javaDocParam + syn match javaDocThrowsTag contained "@throws\s\+\S\+" contains=javaDocParam + syn match javaDocSpecTag contained "@spec\_s\+\S\+\ze\_s\+\S\+" contains=javaDocParam + + syn match javaDocAuthorTag contained "@author\>" + syn match javaDocDeprecatedTag contained "@deprecated\>" + syn match javaDocHiddenTag contained "@hidden\>" + syn match javaDocReturnTag contained "@return\>" + syn match javaDocSerialTag contained "@serial\>" + syn match javaDocSerialDataTag contained "@serialData\>" + syn match javaDocSerialFieldTag contained "@serialField\>" + syn match javaDocVersionTag contained "@version\>" + + syn match javaDocSeeTag contained "@see\>" nextgroup=javaDocSeeTag1,javaDocSeeTag2,javaDocSeeTag3,javaDocSeeTagStar skipwhite skipempty + syn match javaDocSeeTagStar contained "^\s*\*\+\%(\s*{\=@\|/\|$\)\@!" nextgroup=javaDocSeeTag1,javaDocSeeTag2,javaDocSeeTag3 skipwhite skipempty + syn match javaDocSeeTag1 contained @"\_[^"]\+"@ + syn match javaDocSeeTag2 contained @@ contains=@javaHtml extend + syn match javaDocSeeTag3 contained @["< \t]\@!\%(\k\|[/.]\)*\%(##\=\k\+\%((\_[^)]*)\)\=\)\=@ nextgroup=javaDocSeeTag3Label skipwhite skipempty + syn match javaDocSeeTag3Label contained @\k\%(\k\+\s*\)*$@ + syn region javaCodeSkipBlock contained transparent start="{\%(@code\>\)\@!" end="}" contains=javaCodeSkipBlock,javaDocCodeTag syn region javaDocCodeTag contained start="{@code\>" end="}" contains=javaDocCodeTag,javaCodeSkipBlock + exec 'syn region javaDocSnippetTagAttr contained transparent matchgroup=javaHtmlArg start=/\<\%(class\|file\|id\|lang\|region\)\%(\s*=\)\@=/ matchgroup=javaHtmlString end=/:$/ end=/\%(=\s*\)\@' . s:ff.Peek('80', '') . '<=\%("[^"]\+"\|' . "\x27[^\x27]\\+\x27" . '\|\%([.\\/-]\|\k\)\+\)/ nextgroup=javaDocSnippetTagAttr skipwhite skipnl' syn region javaSnippetSkipBlock contained transparent start="{\%(@snippet\>\)\@!" end="}" contains=javaSnippetSkipBlock,javaDocSnippetTag,javaCommentMarkupTag syn region javaDocSnippetTag contained start="{@snippet\>" end="}" contains=javaDocSnippetTag,javaSnippetSkipBlock,javaDocSnippetTagAttr,javaCommentMarkupTag syntax case match hi def link javaDocComment Comment + hi def link javaDocSeeTagStar javaDocComment hi def link javaCommentTitle SpecialComment - hi def link javaDocTags Special + hi def link javaDocParam Function + + hi def link javaDocAuthorTag Special hi def link javaDocCodeTag Special + hi def link javaDocDeprecatedTag Special + hi def link javaDocDocRootTag Special + hi def link javaDocExceptionTag Special + hi def link javaDocHiddenTag Special + hi def link javaDocIndexTag Special + hi def link javaDocInheritDocTag Special + hi def link javaDocLinkTag Special + hi def link javaDocLinkplainTag Special + hi def link javaDocLiteralTag Special + hi def link javaDocParamTag Special + hi def link javaDocReturnTag Special + hi def link javaDocSeeTag Special + hi def link javaDocSeeTag1 String + hi def link javaDocSeeTag2 Special + hi def link javaDocSeeTag3 Function + hi def link javaDocSerialTag Special + hi def link javaDocSerialDataTag Special + hi def link javaDocSerialFieldTag Special + hi def link javaDocSinceTag Special hi def link javaDocSnippetTag Special - hi def link javaDocSeeTagParam Function - hi def link javaDocParam Function + hi def link javaDocSpecTag Special + hi def link javaDocSystemPropertyTag Special + hi def link javaDocThrowsTag Special + hi def link javaDocValueTag Special + hi def link javaDocVersionTag Special endif " match the special comment /**/ diff --git a/runtime/syntax/spec.vim b/runtime/syntax/spec.vim index 4cb3a343eb..730a0b8cc5 100644 --- a/runtime/syntax/spec.vim +++ b/runtime/syntax/spec.vim @@ -4,6 +4,7 @@ " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com " Former Maintainer: Donovan Rebbechi elflord@panix.com (until March 2014) " Last Change: 2020 May 25 +" 2024 Sep 10 by Vim Project: add file triggers support, #15569 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -111,7 +112,7 @@ syn region specDescriptionArea matchgroup=specSection start='^%description' end= syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment "%% Scripts Section %% -syn region specScriptArea matchgroup=specSection start='^%\(prep\|generate_buildrequires\|conf\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 +syn region specScriptArea matchgroup=specSection start='^%\(prep\|generate_buildrequires\|conf\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\|filetriggerin\|filetriggerun\|filetriggerpostun\|transfiletriggerin\|transfiletriggerun\|transfiletriggerpostun\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 "%% Changelog Section %% syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense diff --git a/runtime/syntax/testdir/dumps/java_comments_00.dump b/runtime/syntax/testdir/dumps/java_comments_00.dump index a629664e84..f0ecd9d5a4 100644 --- a/runtime/syntax/testdir/dumps/java_comments_00.dump +++ b/runtime/syntax/testdir/dumps/java_comments_00.dump @@ -1,20 +1,20 @@ ->/+0#0000e05#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|i|g|n|o|r|e|_|j+0&#ffd7d7255|a|v|a|d|o|c| +0&#ffffff0|g|:|j|a|v|a|_|n|o|_|t|r|a|i|l|_|s|p|a|c|e|_|e|r@1|o|r| +0#0000000& -|/+0#0000e05&@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|n|o|_|t|a|b|_|s|p|a|c|e|_|e|r@1|o|r| +0#0000000&@24 -|/+0#0000e05&@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |[|g|:|j|a|v|a|_|s|p|a|c|e|_|e|r@1|o|r|s|,|g|:|j|a|v|a|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s|]| |=| |[|1+0#e000002&|,+0#0000e05&|1+0#e000002&|]+0#0000e05&| +0#0000000& -|/+0#0000e05&@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s+0&#ffd7d7255|e|t|l|o|c|a|l| +0&#ffffff0|s|p|e|l@1| ||| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |j+0&#ffd7d7255|a|v|a|C|o|m@1|e|n|t|S|t|a|r|t| +0&#ffffff0|T+0&#ffd7d7255|o|d|o| +0#0000000#ffffff0@3 -@75 -@75 -@75 -@75 -|/+0#0000e05&|*@1|/| +0#0000000&|/+0#0000001#ffff4012|*|/+0#0000e05#ffffff0| |*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000001#ffff4012|*| +0#0000e05#ffffff0|/+0#ffffff16#ff404010|*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000001#ffff4012|*|/+0#ffffff16#ff404010|*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000001#ffff4012|*|/+0#0000e05#ffffff0|/+0#ffffff16#ff404010|*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000e05&|*@1| +0#e000e06&|C|o|m@1|e|n|t| |t|e|s|t|s|.| +0#0000000&@24 -| +0#0000e05&|*| |<+0#00e0e07&|p+0#af5f00255&|>+0#00e0e07&|T+0#0000e05&|h|e|r|e| |i|s| |n|o| |e|n|t|r|y| |p|o|i|n|t| |m|e|t|h|o|d| |{+0#e000e06&|@|c|o|d|e| |m|a|i|n|}|:+0#0000e05&| +0#0000000&@24 -| +0#0000e05&|*| |{+0#e000e06&|@|s|n|i|p@1|e|t| |f+0#00e0003&|i|l|e| +0#e000e06&|=| |S+0#e000002&|n|i|p@1|e|t|s|.|j|a|v|a| +0#e000e06&|r+0#00e0003&|e|g|i|o|n| +0#e000e06&|=| |m+0#e000002&|a|i|n| +0#e000e06&|i+0#00e0003&|d| +0#e000e06&|=| |_+0#e000002&|0|1|}+0#e000e06&| +0#0000000&@17 -| +0#0000e05&|*| |<+0#00e0e07&|p+0#af5f00255&|>+0#00e0e07&|T+0#0000e05&|h|e|r|e| |i|s| |n|o| |t|e|x|t|u|a|l| |r|e|p|r|e|s|e|n|t|a|t|i|o|n|:| +0#0000000&@33 -| +0#0000e05&|*| |{+0#e000e06&|@|s|n|i|p@1|e|t| |c+0#00e0003&|l|a|s@1| +0#e000e06&|=| |S+0#e000002&|n|i|p@1|e|t|s| +0#e000e06&|r+0#00e0003&|e|g|i|o|n| +0#e000e06&|=| |t+0#e000002&|o|S|t|r|i|n|g| +0#e000e06&|i+0#00e0003&|d| +0#e000e06&|=| |_+0#e000002&|0|2|}+0#e000e06&| +0#0000e05&|*|/| +0#0000000&@14 -|c+0#00e0003&|l|a|s@1| +0#0000000&|C|o|m@1|e|n|t|s|T|e|s|t|s| @55 -|{| @73 -@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.| +0#0000e05&|e+0fd7ff255|.+0&#ffffff0| |n+0fd7ff255|o| +0&#ffffff0|o|p|e|r|a|t|i|o|n|.| +0#0000000&@40 -| +0#0000e05&@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|@|l|i|t|e|r|a|l|}| +0#0000e05&|m|a|y| |b|e| |u|s|e|d| |w|i|t|h| |{+0#e000e06&|@|c|o|d|e| |.|}| +0#0000e05&|f|o|r| |c|o|n|t|r|a|c|t|i|o|n|.|)| +0#0000000&@4 -| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 -@4|V|o|i|d| |n|o|O|p|1|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +| +0#0000e05#a8a8a8255@1>/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|n|o|_|t|a|b|_|s|p|a|c|e|_|e|r@1|o|r| |g|:|j|a|v|a|_|i|g|n|o|r|e|_|j+0&#ffd7d7255|a|v|a|d|o|c| +0#0000000#ffffff0 +| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|n|o|_|t|r|a|i|l|_|s|p|a|c|e|_|e|r@1|o|r| +0#0000000&@20 +| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |[|g|:|j|a|v|a|_|s|p|a|c|e|_|e|r@1|o|r|s|,|g|:|j|a|v|a|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s|]|=|[|1+0#e000002&|,+0#0000e05&|1+0#e000002&|]+0#0000e05&| +0#0000000& +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s+0&#ffd7d7255|e|t|l|o|c|a|l| +0&#ffffff0|s|p|e|l@1| |f+0&#ffd7d7255|d|c|=+0&#ffffff0|2+0#e000002&| +0#0000e05&|f+0&#ffd7d7255|d|l|=+0&#ffffff0|6+0#e000002&|4| +0#0000e05&|f+0&#ffd7d7255|d|m|=+0&#ffffff0|s|y|n|t|a|x| |f|e|n| +0#0000000&@12 +| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |j+0&#ffd7d7255|a|v|a|C|o|m@1|e|n|t|S|t|a|r|t| +0&#ffffff0|T+0&#ffd7d7255|o|d|o| +0#0000000#ffffff0@18 +| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |j+0&#ffd7d7255|a|v|a|C|o|m@1|e|n|t|T|i|t|l|e| +0&#ffffff0|U|n|d|e|r|l|i|n|e|d| +0#0000000&@12 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 @57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/java_comments_01.dump b/runtime/syntax/testdir/dumps/java_comments_01.dump index 77d7c4acf5..ab6007b2e2 100644 --- a/runtime/syntax/testdir/dumps/java_comments_01.dump +++ b/runtime/syntax/testdir/dumps/java_comments_01.dump @@ -1,20 +1,20 @@ -|c+0#00e0003#ffffff0|l|a|s@1| +0#0000000&|C|o|m@1|e|n|t|s|T|e|s|t|s| @55 -|{| @73 -@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.| +0#0000e05&|e+0fd7ff255|.+0&#ffffff0| |n+0fd7ff255|o| +0&#ffffff0|o|p|e|r|a|t|i|o|n|.| +0#0000000&@40 -| +0#0000e05&@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|@|l|i|t|e|r|a|l|}| +0#0000e05&|m|a|y| |b|e| |u|s|e|d| |w|i|t|h| |{+0#e000e06&|@|c|o|d|e| |.|}| +0#0000e05&|f|o|r| |c|o|n|t|r|a|c|t|i|o|n|.|)| +0#0000000&@4 -| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 -@4>V|o|i|d| |n|o|O|p|1|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@75 -@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|.| +0#0000e05&|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@41 -| +0#0000e05&@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|<|!|-@1| |-@1|>|}| +0#0000e05&|m|a|y| |b|e| |u|s|e|d| |a|f|t|e|r| |{+0#e000e06&|@|c|o|d|e| |.|}| +0#0000e05&|f|o|r| |c|o|n|t|r|a|c|t|i|o|n|.|)| +0#0000000&@3 -| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 -@4|V|o|i|d| |n|o|O|p|2|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@75 -@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|\|u+0&#ffd7d7255|0@1|2|e| +0&#ffffff0|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@36 -| +0#0000e05&@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|\|u|0@1|5|c|u|0@1|2|e|}| +0#0000e05&|i|s| |p|r|o|c|e|s@1|e|d| |e|a|r|l|y|,| |u|s|e| |a|l|t|e|r|n|a|t|i|v|e|s|.|)| +0#0000000&@7 -| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 -@4|V|o|i|d| |n|o|O|p|3|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@75 -@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|{|@|l|i|t|e|r|a|l| |.|}| |n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@30 -| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 -@57|1|9|,|2|-|5| @7|1|8|%| +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1> +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| |/+0&#ffffff0|*@1|/| +0#0000000&|/+0#0000001#ffff4012|*|/+0#0000e05#ffffff0| |*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000001#ffff4012|*| +0#0000e05#ffffff0|/+0#ffffff16#ff404010|*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000001#ffff4012|*|/+0#ffffff16#ff404010|*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000001#ffff4012|*|/+0#0000e05#ffffff0|/+0#ffffff16#ff404010|*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000e05&|*@1| +8#e000e06&|C|o|m@1|e|n|t| |t|e|s|t|s|.| +0#0000000&@22 +||+0#0000e05#a8a8a8255| | +0&#ffffff0|*| |<+0#00e0e07&|p+0#af5f00255&|>+0#00e0e07&|T+0#0000e05&|h|e|r|e| |i|s| |n|o| |e|n|t|r|y| |p|o|i|n|t| |m|e|t|h|o|d| |{+0#e000e06&|@|c|o|d|e| |m|a|i|n|}|:+0#0000e05&| +0#0000000&@22 +||+0#0000e05#a8a8a8255| | +0&#ffffff0|*| |{+0#e000e06&|@|s|n|i|p@1|e|t| |f+0#00e0003&|i|l|e| +0#e000e06&|=| |S+0#e000002&|n|i|p@1|e|t|s|.|j|a|v|a| +0#e000e06&|r+0#00e0003&|e|g|i|o|n| +0#e000e06&|=| |m+0#e000002&|a|i|n| +0#e000e06&|i+0#00e0003&|d| +0#e000e06&|=| |_+0#e000002&|0|1|}+0#e000e06&| +0#0000000&@15 +||+0#0000e05#a8a8a8255| | +0&#ffffff0|*| |<+0#00e0e07&|p+0#af5f00255&|>+0#00e0e07&|T+0#0000e05&|h|e|r|e| |i|s| |n|o| |t|e|x|t|u|a|l| |r|e|p|r|e|s|e|n|t|a|t|i|o|n|:| +0#0000000&@31 +||+0#0000e05#a8a8a8255| | +0&#ffffff0|*| |{+0#e000e06&|@|s|n|i|p@1|e|t| |c+0#00e0003&|l|a|s@1| +0#e000e06&|=| |S+0#e000002&|n|i|p@1|e|t|s| +0#e000e06&|r+0#00e0003&|e|g|i|o|n| +0#e000e06&|=| |t+0#e000002&|o|S|t|r|i|n|g| +0#e000e06&|i+0#00e0003&|d| +0#e000e06&|=| |_+0#e000002&|0|2|}+0#e000e06&| +0#0000e05&|*|/| +0#0000000&@12 +| +0#0000e05#a8a8a8255@1|c+0#00e0003#ffffff0|l|a|s@1| +0#0000000&|C|o|m@1|e|n|t|s|T|e|s|t|s| |i+0#00e0003&|m|p|l|e|m|e|n|t|s| +0#0000000&|C|o|m|p|a|r|a|b|l|e|<|C|o|m@1|e|n|t|s|T|e|s|t|s|>| @16 +| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @71 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|p+0#00e0003&|r|i|v|a|t|e| +0#0000000&|C|o|m@1|e|n|t|s|T|e|s|t|s|(|)| |{| |}| @41 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +8#e000e06&|N|o|-|o|p|,| |i|.| +0#0000e05&|e+0fd7ff255|.+0&#ffffff0| |n+0fd7ff255|o| +0&#ffffff0|o|p|e|r|a|t|i|o|n|.| +0#0000000&@38 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|@|l|i|t|e|r|a|l|}| +0#0000e05&|m|a|y| |b|e| |u|s|e|d| |w|i|t|h| |{+0#e000e06&|@|c|o|d|e| |.|}| +0#0000e05&|f|o|r| |c|o|n|t|r|a|c|t|i|o|n|.|)| +0#0000000&@2 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@43 +@57|1|9|,|0|-|1| @7|1|2|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_02.dump b/runtime/syntax/testdir/dumps/java_comments_02.dump index 25babc7665..03c4bcfc14 100644 --- a/runtime/syntax/testdir/dumps/java_comments_02.dump +++ b/runtime/syntax/testdir/dumps/java_comments_02.dump @@ -1,20 +1,20 @@ -| +0#0000e05#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 -@4|V|o|i|d| |n|o|O|p|4|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@75 -@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|.|<|!|-@1| |-@1|>| |n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@33 -| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 -@4>V|o|i|d| |n|o|O|p|5|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@75 -@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|.|&|n|b|s|p|;|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@36 -| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 -@4|V|o|i|d| |n|o|O|p|6|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@75 -@4|/+0#0000e05&|*@1| |{+0#e000e06&|@|r|e|t|u|r|n| |{|@|c|o|d|e| |n|u|l@1|}|,| |w|i|t|h| |n|o|-|o|p|,| |i|.|e|.| |n|o| |o|p|e|r|a|t|i|o|n|}| |*+0#0000e05&|/| +0#0000000&@10 -@4|V|o|i|d| |n|o|O|p|7|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@75 -@4|/+0#0000e05&|*@1| |{+0#e000e06&|@|r|e|t|u|r|n| |{|@|c|o|d|e| |n|u|l@1|}|,| |w|i|t|h| |n|o|-|o|p|,| |i|.|e|.| |n|o| |o|p|e|r|a|t|i|o|n|}|.@1| |*+0#0000e05&|/| +0#0000000&@8 -@4|V|o|i|d| |n|o|O|p|8|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@75 -@4|/+0#0000e05&|*@1| |{+0#e000e06&|@|r|e|t|u|r|n| |{|@|c|o|d|e| |n|u|l@1|}|,| |w|i|t|h| |n|o|-|o|p|,| |i|.|e|.| |n|o| |o|p|e|r|a|t|i|o|n|}| |.| |.| |*+0#0000e05&|/| +0#0000000&@6 -@4|V|o|i|d| |n|o|O|p|9|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@57|3|7|,|2|-|5| @7|4|3|%| +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@43 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|V|o|i|d| |n|o|O|p|1|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @39 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +8#e000e06&|N|o|-|o|p|,| |i|.|e|.| +0#0000e05&|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@39 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|<|!|-@1| |-@1|>|}| +0#0000e05&|m|a|y| |b|e| |u|s|e|d| |a|f|t|e|r| |{+0#e000e06&|@|c|o|d|e| |.|}| +0#0000e05&|f|o|r| |c|o|n|t|r|a|c|t|i|o|n|.|)| +0#0000000&@1 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3>*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@43 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|V|o|i|d| |n|o|O|p|2|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @39 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +8#e000e06&|N|o|-|o|p|,| |i|.|e|\|u+8&#ffd7d7255|0@1|2|e| +8&#ffffff0|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@34 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|\|u|0@1|5|c|u|0@1|2|e|}| +0#0000e05&|i|s| |p|r|o|c|e|s@1|e|d| |e|a|r|l|y|,| |u|s|e| |a|l|t|e|r|n|a|t|i|v|e|s|.|)| +0#0000000&@5 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@43 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|V|o|i|d| |n|o|O|p|3|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @39 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +8#e000e06&|N|o|-|o|p|,| |i|.|e|{+0&&|@|l|i|t|e|r|a|l| |.|}| +8&&|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@28 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@43 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|V|o|i|d| |n|o|O|p|4|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @39 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +8#e000e06&|N|o|-|o|p|,| |i|.|e|.|<+0&&|!|-@1| |-@1|>| +8&&|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@31 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@43 +@57|3|7|,|2|-|5| @7|3|0|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_03.dump b/runtime/syntax/testdir/dumps/java_comments_03.dump index f3f8d56f3b..a407805eed 100644 --- a/runtime/syntax/testdir/dumps/java_comments_03.dump +++ b/runtime/syntax/testdir/dumps/java_comments_03.dump @@ -1,20 +1,20 @@ -| +0&#ffffff0@3|V|o|i|d| |n|o|O|p|9|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 -@75 -@4|/+0#0000e05&|*@1| +0#e000e06&|R|e|t|u|r|n|s| |a|n| |e|m|p|t|y| |s|t|r|i|n|g| |f|o|r| |a|n| |@|O|v|e|r@1|i|d|e| |a|n@1|o|t|a|t|e|d| |m|e|t|h|o|d| +0#0000000&@9 -| +0#0000e05&@3|*| +0#e000e06&|(|s|e@1| |C|h|a|p|t|e|r| |9|.|6|.|4|.|4| |{|@|l|i|t|e|r|a|l| |@|O|v|e|r@1|i|d|e|}| |i|n| |a| |J|a|v|a| |L|a|n|g|u|a|g|e| +0#0000000&@8 -| +0#0000e05&@3|*| +0#e000e06&|S|p|e|c|i|f|i|c|a|t|i|o|n|)| |o|v|e|r@1|i|d@1|e|n| |f|r|o|m| |<+0#00e0e07&|c+0#af5f00255&|o|d|e|>+0#00e0e07&|j+0#e000e06&|a|v|a|.|l+0&#ffd7d7255|a|n|g|.+0&#ffffff0|O|b|j|e|c|t|<+0#00e0e07&|/|c+0#af5f00255&|o|d|e|>+0#00e0e07&| +0#0000000&@8 -| +0#0000e05&@3>*| +0#0000000&@69 -| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|a|n| |e|m|p|t|y| |s|t|r|i|n|g| |*|/@2| |N|o| |p|e|r|i|o|d| |f|o|r| |t|h|e| |a|b|o|v|e| |s|u|m@1|a|r|y|!| +0#0000000&@7 -@4|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|p+0#00e0003&|u|b|l|i|c| +0#0000000&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&@1|;+0#0000000&| |}| @21 -|}| @73 -@75 -|/+0#0000e05&@1| |j+0&#ffd7d7255|a|v|a|d|o|c| +0&#ffffff0|-@1|s|n|i|p@1|e|t|-|p|a|t|h| |.| |-@1|s|o|u|r|c|e|-|p|a|t|h| |.| |-|d| |/|t+0&#ffd7d7255|m|p|/+0&#ffffff0|d|o|c|/| |-|p|a|c|k|a|g|e| |\| +0#0000000&@7 -|/+0#0000e05&@1| +0#ffffff16#ff404010| +0#0000e05#ffffff0|-|t|a|g| |'|j+0&#ffd7d7255|l|s|:+0&#ffffff0|a|:|S|e@1| |J|a|v|a| |L|a|n|g|u|a|g|e| |S|p|e|c|i|f|i|c|a|t|i|o|n|:|'| |S|n|i|p@1|e|t|s|.|j|a|v|a| +0#0000000&@11 -|/+0#0000e05&|*@1| +0#e000e06&|S|n|i|p@1|e|t|s| |f|o|r| |c|o|m@1|e|n|t| |t|e|s|t|s|.| +0#0000e05&|*|/| +0#0000000&@40 -|c+0#00e0003&|l|a|s@1| +0#0000000&|S|n|i|p@1|e|t|s| @60 -|{| @2|/+0#0000001#ffff4012|*| +0#ffffff16#ff404010| +0#0000e05#ffffff0|T|R|A|I|L|I|N|G| |B|L|A|N|K|S| |A|N|D| |M+0&#ffd7d7255|E|S@1|P|I|L@1|I|N|G|S| +0&#ffffff0|A|R|E| |S|I|G|N|I|F|I|C|A|N|T|!| |*+0#0000001#ffff4012|/| +0#0000000#ffffff0@14 -@4|/+0#0000e05&|*@1| +0#e000e06&|T|h|e| |m|e|t|h|o|d| |{|@|c|o|d|e| |m|a|i|n|}| |m|u|s|t| |b|e| |d|e|c|l|a|r|e|d| |{|@|c|o|d|e| |p|u|b|l|i|c|}|,| |{|@|c|o|d|e| +0#0000000&@3 -| +0#e000e06&@4|*| |s|t|a|t|i|c|}|,| |a|n|d| |{|@|c|o|d|e| |v|o|i|d|}|.| +0#0000e05&@1|I|t| |m|u|s|t| |s|p|e|c|i|f|y| |a| |f|o|r|m|a|l| |p|a|r|a|m|e|t|e|r| +0#0000000&@5 -| +0#0000e05&@4|*| |w|h|o|s|e| |d|e|c|l|a|r|e|d| |t|y|p|e| |i|s| |a|r@1|a|y| |o|f| |{+0#e000e06&|@|l|i|n|k| |S|t|r|i|n|g|}|.+0#0000e05&| @1|T|h|e|r|e|f|o|r|e|,| +0#0000000&@8 -| +0#0000e05&@4|*| |e|i|t|h|e|r| |o|f| |t|h|e| |f|o|l@1|o|w|i|n|g| |d|e|c|l|a|r|a|t|i|o|n|s| |i|s| |a|c@1|e|p|t|a|b|l|e|:| +0#0000000&@16 -@57|5@1|,|2|-|5| @7|6|9|%| +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@43 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|V|o|i|d| |n|o|O|p|5|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @39 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +8#e000e06&|N|o|-|o|p|,| |i|.|e|.|&+0&&|n|b|s|p|;|n+8&&|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@34 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@43 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3>V|o|i|d| |n|o|O|p|6|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @39 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&|*@1| |{+8#e000e06&|@+0&&|r|e|t|u|r|n| +8&&|{+0&&|@|c|o|d|e| |n|u|l@1|}|,+8&&| |w|i|t|h| |n|o|-|o|p|,| |i|.|e|.| |n|o| |o|p|e|r|a|t|i|o|n|}| |*+0#0000e05&|/| +0#0000000&@8 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|V|o|i|d| |n|o|O|p|7|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @39 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&|*@1| |{+8#e000e06&|@+0&&|r|e|t|u|r|n| +8&&|{+0&&|@|c|o|d|e| |n|u|l@1|}|,+8&&| |w|i|t|h| |n|o|-|o|p|,| |i|.|e|.| |n|o| |o|p|e|r|a|t|i|o|n|}|.@1| |*+0#0000e05&|/| +0#0000000&@6 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|V|o|i|d| |n|o|O|p|8|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @39 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&|*@1| |{+8#e000e06&|@+0&&|r|e|t|u|r|n| +8&&|{+0&&|@|c|o|d|e| |n|u|l@1|}|,+8&&| |w|i|t|h| |n|o|-|o|p|,| |i|.|e|.| |n|o| |o|p|e|r|a|t|i|o|n|}| |.| |.| |*+0#0000e05&|/| +0#0000000&@4 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|V|o|i|d| |n|o|O|p|9|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @39 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&|*@1| |{+8#e000e06&|@+0&&|r|e|t|u|r|n| +8&&|t|h|e| |m|a|j|o|r| |J|a|v|a| |v|e|r|s|i|o|n|}| |@+0&&|h|i|d@1|e|n| +0#0000e05&|*|/| +0#0000000&@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#0000000&|i+0#00e0003&|n|t| +0#0000000&|m|a|j|o|r|V|e|r|s|i|o|n|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|2+0#e000002&|1|;+0#0000000&| |}| @25 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +@57|5@1|,|2|-|5| @7|4|7|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_04.dump b/runtime/syntax/testdir/dumps/java_comments_04.dump index 01703a809e..d415c024cc 100644 --- a/runtime/syntax/testdir/dumps/java_comments_04.dump +++ b/runtime/syntax/testdir/dumps/java_comments_04.dump @@ -1,20 +1,20 @@ -| +0#0000e05#ffffff0@4|*| |e|i|t|h|e|r| |o|f| |t|h|e| |f|o|l@1|o|w|i|n|g| |d|e|c|l|a|r|a|t|i|o|n|s| |i|s| |a|c@1|e|p|t|a|b|l|e|:| +0#0000000&@16 -| +0#0000e05&@4|*| +0#ffffff16#ff404010| +0#0000e05#ffffff0|{+0#e000e06&|@|s|n|i|p@1|e|t| |l+0#00e0003&|a|n|g|=+0#e000e06&|"+0#e000002&|j|a|v|a|"|:+0#e000e06&| +0#0000000&@44 -| +0#e000e06&@4|*| |/@1| |@+0#0000000&|h|i|g|h|l|i|g|h|t| +0#e000e06&|s+0#00e0003&|u|b|s|t|r|i|n|g|=+0#e000e06&|"+0#e000002&|m|a|i|n|"| +0#e000e06&|t+0#00e0003&|y|p|e|=+0#e000e06&|"+0#e000002&|i|t|a|l|i|c|"|:+0#e000e06&| +0#0000000&@22 -| +0#e000e06&@4|*| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| +0#0000000&@25 -| +0#e000e06&@4|*| |}|<+0#00e0e07&|b+0#af5f00255&|r| +0#00e0e07&|/|>|<|p+0#af5f00255&|r|e| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|s|n|i|p@1|e|t|"|>+0#00e0e07&| +0#0000000&@39 -| +0#0000e05&@4>*|{+0#e000e06&|@|c|o|d|e| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|.@2| |a|r|g|s|)| |{| |}@1|<+0#00e0e07&|/|p+0#af5f00255&|r|e|>+0#00e0e07&| +0#0000000&@11 -| +0#0000e05&@4|*| +0#0000000&@68 -| +0#0000e05&@4|*| |@+0#e000e06&|p|a|r|a|m| +0#00e0e07&|a|r|g|s| +0#0000e05&|o|p|t|i|o|n|a|l| |c+0&#ffd7d7255|o|m@1|a|n|d|e|-+0&#ffffff0|l|i|n|e| |a|r|g|u|m|e|n|t|s| +0#ffffff16#ff404010| +0#0000000#ffffff0@22 -| +0#0000e05&@4|*| |@|j+0&#ffd7d7255|l|s| +0&#ffffff0|1|2|.|1|.|4| |I|n|v|o|k|e| |{+0#e000e06&|@|c|o|d|e| |T|e|s|t|.|m|a|i|n|}| +0#0000e05&|*|/| +0#0000000&@28 -@4|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |m+0#e000002&|a|i|n| +0#ffffff16#ff404010@4| +0#0000000#ffffff0@42 -@4|/+0#0000e05&@1| |@+0#0000000&|l|i|n|k| +0#0000e05&|s+0#00e0003&|u|b|s|t|r|i|n|g| +0#0000e05&|=| |'+0#e000002&|S|t|r|i|n|g|'| +0#0000e05&|t+0#00e0003&|a|r|g|e|t| +0#0000e05&|=| |'+0#e000002&|j|a|v|a|.|l|a|n|g|.|S|t|r|i|n|g|'| +0#0000e05&|:| +0#0000000&@11 -@4|p+0#00e0003&|u|b|l|i|c| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&|m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| @28 -@4|/+0#0000e05&@1| |@+0#0000000&|e|n|d| +0#ffffff16#ff404010| +0#0000000#ffffff0@62 -@75 -@4|/+0#0000e05&|*@1| |{+0#e000e06&|@|r|e|t|u|r|n| |a|n| |e|m|p|t|y| |s|t|r|i|n|g|}| +0#ffffff16#ff404010@2| +0#0000000#ffffff0@38 -| +0#0000e05&@4|*| +0#e000e06&|@|s|e@1| |<+0#00e0e07&|a+0#af5f00255&| +0#00e0e07&|h+0#00e0003&|r|e|f|=+0#00e0e07&|"+0#e000002&|h|t@1|p|s|:|/@1|d|o|c|s|.|o|r|a|c|l|e|.|c|o|m|/|j|a|v|a|s|e|/|s|p|e|c|s|/|j|l|s|/|s|e|2|1|/|h|t|m|l|/|j|l|s -|-|3|.|h|t|m|l|#|j|l|s|-|3|.|1|0|.|5|"|>+0#00e0e07&|3+8#e000e06&|.|1|0|.|5| |S|t|r|i|n|g| |L|i|t|e|r|a|l|s|<+0#00e0e07&|/|a+0#af5f00255&|>+0#00e0e07&| +0#0000000&@28 -| +0#0000e05&@4|*| +0#e000e06&|@|s|e@1| |O+0#00e0e07&|b|j|e|c|t|#|t|o|S|t|r|i|n|g|(|)| +0#0000000&|*+0#e000e06&|/| +0#0000000&@42 -@4|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |t+0#e000002&|o|S|t|r|i|n|g| +0#ffffff16#ff404010| +0#0000000#ffffff0@42 -@57|7|3|,|3|-|6| @7|9|3|%| +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| |{+8#e000e06&|@|s|u|m@1|a|r|y| |C|o|m|p|a|r|e|s| |t|h|i|s| |i|n|s|t|a|n|c|e| |w|i|t|h| |t|h|e| |p|a|s@1|e|d| |{+0&&|@|c|o|d|e| |t|h|a|t|}| +0#0000000&@3 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| +8#e000e06&|i|n|s|t|a|n|c|e| |f|o|r| |o|r|d|e|r| |b|y| |i|n|v|o|k|i|n|g| |{+0&&|@|l|i|n|k| |I|n|t|e|g|e|r|#|c|o|m|p|a|r|e|(|i|n|t|,| |i|n|t|)| +0#0000000&@2 +||+0#0000e05#a8a8a8255| | +0#e000e06#ffffff0@4|*| |c|o|m|p|a|r|e|}| +8&&|a|n|d| |p|a|s@1|i|n|g| |i|t| |{+0&&|@|c|o|d|e| |t|h|i|s|.|m|a|j|o|r|V|e|r|s|i|o|n|(|)|}| +8&&|a|n|d| +0#0000000&@10 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| +8#e000e06&|{+0&&|@|c|o|d|e| |t|h|a|t|.|m|a|j|o|r|V|e|r|s|i|o|n|(|)|}| +8&&|a|s| |r|e|s|p|e|c|t|i|v|e| |@|a|r|g|u|m|e|n|t|s|.|}| +0#0000000&@11 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4>*| +0#0000000&@66 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| |{+0#e000e06&|@|i|n|h|e|r|i|t|D|o|c|}| +0#0000e05&|*|/| +0#0000000&@49 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|p+0#00e0003&|u|b|l|i|c| +0#0000000&|i+0#00e0003&|n|t| +0#0000000&|c|o|m|p|a|r|e|T|o|(|C|o|m@1|e|n|t|s|T|e|s|t|s| |t|h|a|t|)| @18 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|{| @67 +||+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@7|j|a|v|a|.|u|t|i|l|.|O|b|j|e|c|t|s|.|r|e|q|u|i|r|e|N|o|n|N|u|l@1|(|t|h|a|t|,| |"+0#e000002&|t|h|a|t|"|)+0#0000000&|;| @17 +||+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@7|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|I|n|t|e|g|e|r|.|c|o|m|p|a|r|e|(|t+0#00e0003&|h|i|s|.+0#0000000&|m|a|j|o|r|V|e|r|s|i|o|n|(|)|,| @21 +||+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@23|t|h|a|t|.|m|a|j|o|r|V|e|r|s|i|o|n|(|)@1|;| @27 +||+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|}| @67 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +8#e000e06&|R|e|t|u|r|n|s| |a|n| |e|m|p|t|y| |s|t|r|i|n|g| |f|o|r| |a|n| |@|O|v|e|r@1|i|d|e| |a|n@1|o|t|a|t|e|d| |m|e|t|h|o|d| +0#0000000&@7 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| +8#e000e06&|(|s|e@1| |C|h|a|p|t|e|r| |9|.|6|.|4|.|4| |{+0&&|@|l|i|t|e|r|a|l| |@|O|v|e|r@1|i|d|e|}| +8&&|i|n| |a| |J|a|v|a| |L|a|n|g|u|a|g|e| +0#0000000&@6 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| +8#e000e06&|S|p|e|c|i|f|i|c|a|t|i|o|n|)| |o|v|e|r@1|i|d@1|e|n| |f|r|o|m| |<+0#00e0e07&|c+0#af5f00255&|o|d|e|>+0#00e0e07&|j+8#e000e06&|a|v|a|.|l+8&#ffd7d7255|a|n|g|.+8&#ffffff0|O|b|j|e|c|t|<+0#00e0e07&|/|c+0#af5f00255&|o|d|e|>+0#00e0e07&| +0#0000000&@6 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| +0#0000000&@67 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|a|n| |e|m|p|t|y| |s|t|r|i|n|g| |*|/@2| |N|o| |p|e|r|i|o|d| |f|o|r| |t|h|e| |a|b|o|v|e| |s|u|m@1|a|r|y|!| +0#0000000&@5 +@57|7|3|,|3|-|6| @7|6|5|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_05.dump b/runtime/syntax/testdir/dumps/java_comments_05.dump index 53c7850806..85492d8a57 100644 --- a/runtime/syntax/testdir/dumps/java_comments_05.dump +++ b/runtime/syntax/testdir/dumps/java_comments_05.dump @@ -1,20 +1,20 @@ -| +0&#ffffff0@3|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |t+0#e000002&|o|S|t|r|i|n|g| +0#ffffff16#ff404010| +0#0000000#ffffff0@42 -@4|/+0#0000e05&@1| |@+0#0000000&|r|e|p|l|a|c|e| +0#0000e05&|s+0#00e0003&|u|b|s|t|r|i|n|g| +0#0000e05&|=| |'+0#e000002&|"@1|'| +0#0000e05&|r+0#00e0003&|e|p|l|a|c|e|m|e|n|t| +0#0000e05&|=| |"+0#e000002&|\|u|0@1|2@1|\|u|0@1|2@1|"| +0#0000000&@13 -@4|/+0#0000e05&@1| |@+0#0000000&|l|i|n|k| +0#0000e05&|r+0#00e0003&|e|g|e|x| +0#0000e05&|=| |'+0#e000002&|\|b|S|t|r|i|n|g|'| +0#0000e05&|t+0#00e0003&|a|r|g|e|t| +0#0000e05&|=| |j+0#e000002&|a|v|a|.|l|a|n|g|.|S|t|r|i|n|g| +0#0000e05&|t+0#00e0003&|y|p|e| +0#0000e05&|=| |l+0#e000002&|i|n|k|p|l|a|i|n| +0#0000e05& -|:| +0#0000000&@73 -@4|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|p+0#00e0003&|u|b|l|i|c| +0#0000000&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&@1|;+0#0000000&| |}| @21 -@4>/+0#0000e05&@1| |@+0#0000000&|e|n|d| +0#ffffff16#ff404010| +0#0000000#ffffff0@62 -|}| @73 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|8|9|,|2|-|5| @7|B|o|t| +||+0#0000e05#a8a8a8255| | +0&#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|a|n| |e|m|p|t|y| |s|t|r|i|n|g| |*|/@2| |N|o| |p|e|r|i|o|d| |f|o|r| |t|h|e| |a|b|o|v|e| |s|u|m@1|a|r|y|!| +0#0000000&@5 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|p+0#00e0003&|u|b|l|i|c| +0#0000000&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&@1|;+0#0000000&| |}| @19 +| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @71 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |j+0&#ffd7d7255|a|v|a|d|o|c| +0&#ffffff0|-@1|s|n|i|p@1|e|t|-|p|a|t|h| |.| |-@1|s|o|u|r|c|e|-|p|a|t|h| |.| |-|d| |/|t+0&#ffd7d7255|m|p|/+0&#ffffff0|d|o|c|s|/| |-|p|a|c|k|a|g|e| |\| +0#0000000&@4 +| +0#0000e05#a8a8a8255@1>/+0&#ffffff0@1| +0#ffffff16#ff404010| +0#0000e05#ffffff0|-|t|a|g| |'|j+0&#ffd7d7255|l|s|:+0&#ffffff0|a|:|S|e@1| |J|a|v|a| |L|a|n|g|u|a|g|e| |S|p|e|c|i|f|i|c|a|t|i|o|n|:|'| |S|n|i|p@1|e|t|s|.|j|a|v|a| +0#0000000&@9 +| +0#0000e05#a8a8a8255@1|/+0&#ffffff0|*@1| +8#e000e06&|S|n|i|p@1|e|t|s| |f|o|r| |c|o|m@1|e|n|t| |t|e|s|t|s|.| +0#0000e05&|*|/| +0#0000000&@38 +| +0#0000e05#a8a8a8255@1|c+0#00e0003#ffffff0|l|a|s@1| +0#0000000&|S|n|i|p@1|e|t|s| @58 +| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @2|/+0#0000001#ffff4012|*| +0#ffffff16#ff404010| +0#0000e05#ffffff0|T|R|A|I|L|I|N|G| |B|L|A|N|K|S| |A|N|D| |M+0&#ffd7d7255|E|S@1|P|I|L@1|I|N|G|S| +0&#ffffff0|A|R|E| |S|I|G|N|I|F|I|C|A|N|T|!| |*+0#0000001#ffff4012|/| +0#0000000#ffffff0@12 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|p+0#00e0003&|r|i|v|a|t|e| +0#0000000&|S|n|i|p@1|e|t|s|(|)| |{| |}| @46 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +8#e000e06&|T|h|e| |m|e|t|h|o|d| |{+0&&|@|c|o|d|e| |m|a|i|n|}| +8&&|m|u|s|t| |b|e| |d|e|c|l|a|r|e|d| |{+0&&|@|c|o|d|e| |p|u|b|l|i|c|}|,+8&&| |{+0&&|@|c|o|d|e| +0#0000000&@1 +||+0#0000e05#a8a8a8255| | +0#e000e06#ffffff0@4|*| |s|t|a|t|i|c|}|,+8&&| |a|n|d| |{+0&&|@|c|o|d|e| |v|o|i|d|}|.+8&&| +0#0000e05&@1|I|t| |m|u|s|t| |s|p|e|c|i|f|y| |a| |f|o|r|m|a|l| |p|a|r|a|m|e|t|e|r| +0#0000000&@3 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| |w|h|o|s|e| |d|e|c|l|a|r|e|d| |t|y|p|e| |i|s| |a|r@1|a|y| |o|f| |{+0#e000e06&|@|l|i|n|k| |S|t|r|i|n|g|}|.+0#0000e05&| @1|T|h|e|r|e|f|o|r|e|,| +0#0000000&@6 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| |<+0#00e0e07&|e+0#af5f00255&|m|>+0#00e0e07&|e+0#0000000&|i|t|h|e|r|<+0#00e0e07&|/|e+0#af5f00255&|m|>+0#00e0e07&| +0#0000e05&|o|f| |t|h|e| |f|o|l@1|o|w|i|n|g| |d|e|c|l|a|r|a|t|i|o|n|s| |i|s| |a|c@1|e|p|t|a|b|l|e|:| +0#0000000&@5 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| +0#ffffff16#ff404010| +0#0000e05#ffffff0|{+0#e000e06&|@|s|n|i|p@1|e|t| |l+0#00e0003&|a|n|g|=+0#e000e06&|"+0#e000002&|j|a|v|a|"|:+0#e000e06&| +0#0000000&@42 +||+0#0000e05#a8a8a8255| | +0#e000e06#ffffff0@4|*| |/@1| |@+0#0000000&|h|i|g|h|l|i|g|h|t| +0#e000e06&|s+0#00e0003&|u|b|s|t|r|i|n|g|=+0#e000e06&|"+0#e000002&|m|a|i|n|"| +0#e000e06&|t+0#00e0003&|y|p|e|=+0#e000e06&|"+0#e000002&|i|t|a|l|i|c|"|:+0#e000e06&| +0#0000000&@20 +||+0#0000e05#a8a8a8255| | +0#e000e06#ffffff0@4|*| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| +0#0000000&@23 +||+0#0000e05#a8a8a8255| | +0#e000e06#ffffff0@4|*| |}|<+0#00e0e07&|b+0#af5f00255&|r| +0#00e0e07&|/|>|<|p+0#af5f00255&|r|e| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|s|n|i|p@1|e|t|"|>+0#00e0e07&| +0#0000000&@37 +@57|9|1|,|1| @9|8|2|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_06.dump b/runtime/syntax/testdir/dumps/java_comments_06.dump new file mode 100644 index 0000000000..84336a33b4 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_comments_06.dump @@ -0,0 +1,20 @@ +||+0#0000e05#a8a8a8255| | +0#e000e06#ffffff0@4|*| |}|<+0#00e0e07&|b+0#af5f00255&|r| +0#00e0e07&|/|>|<|p+0#af5f00255&|r|e| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|s|n|i|p@1|e|t|"|>+0#00e0e07&| +0#0000000&@37 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*|{+0#e000e06&|@|c|o|d|e| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|.@2| |a|r|g|s|)| |{| |}@1|<+0#00e0e07&|/|p+0#af5f00255&|r|e|>+0#00e0e07&| +0#0000000&@9 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| +0#0000000&@66 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| |@+0#e000e06&|p|a|r|a|m| |a+0#00e0e07&|r|g|s| +0#0000e05&|o|p|t|i|o|n|a|l| |c+0&#ffd7d7255|o|m@1|a|n|d|e|-+0&#ffffff0|l|i|n|e| |a|r|g|u|m|e|n|t|s| +0#ffffff16#ff404010| +0#0000000#ffffff0@20 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| |@|j+0&#ffd7d7255|l|s| +0&#ffffff0|1|2|.|1|.|4| |I|n|v|o|k|e| |{+0#e000e06&|@|c|o|d|e| |T|e|s|t|.|m|a|i|n|}| +0#0000e05&|*|/| +0#0000000&@26 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3>/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |m+0#e000002&|a|i|n| +0#ffffff16#ff404010@4| +0#0000000#ffffff0@40 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&@1| |@+0#0000000&|l|i|n|k| +0#0000e05&|s+0#00e0003&|u|b|s|t|r|i|n|g| +0#0000e05&|=| |'+0#e000002&|S|t|r|i|n|g|'| +0#0000e05&|t+0#00e0003&|a|r|g|e|t| +0#0000e05&|=| |'+0#e000002&|j|a|v|a|.|l|a|n|g|.|S|t|r|i|n|g|'| +0#0000e05&|:| +0#0000000&@9 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|p+0#00e0003&|u|b|l|i|c| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&|m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| @26 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&@1| |@+0#0000000&|e|n|d| +0#ffffff16#ff404010| +0#0000000#ffffff0@60 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@3|/+0#0000e05&|*@1| |{+8#e000e06&|@+0&&|r|e|t|u|r|n| +8&&|a|n| |e|m|p|t|y| |s|t|r|i|n|g|}| +0#0000000&@39 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| |@+0#e000e06&|s|e@1| +0#0000e05&|<+0#00e0e07&|a+0#af5f00255&| +0#00e0e07&|h+0#00e0003&|r|e|f|=+0#00e0e07&|"+0#e000002&|h|t@1|p|s|:|/@1|d|o|c|s|.|o|r|a|c|l|e|.|c|o|m|/|j|a|v|a|s|e|/|s|p|e|c|s|/|j|l|s|/|s|e|2|1|/|h|t|m|l|/|j +||+0#0000e05#a8a8a8255| |l+0#e000002#ffffff0|s|-|3|.|h|t|m|l|#|j|l|s|-|3|.|1|0|.|5|"|>+0#00e0e07&|3+8#e000e06&|.|1|0|.|5| |S|t|r|i|n|g| |L|i|t|e|r|a|l|s|<+0#00e0e07&|/|a+0#af5f00255&|>+0#00e0e07&| +0#0000000&@24 +||+0#0000e05#a8a8a8255| | +0&#ffffff0@4|*| |@+0#e000e06&|s|e@1| +0#0000e05&|j+0#00e0e07&|a|v|a|.|b|a|s|e|/|j|a|v|a|.|l|a|n|g|.|O|b|j|e|c|t|#|t|o|S|t|r|i|n|g|(|)| +0#0000e05&|*|/| +0#0000000&@20 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |t+0#e000002&|o|S|t|r|i|n|g| +0#ffffff16#ff404010| +0#0000000#ffffff0@40 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&@1| |@+0#0000000&|r|e|p|l|a|c|e| +0#0000e05&|s+0#00e0003&|u|b|s|t|r|i|n|g| +0#0000e05&|=| |'+0#e000002&|"@1|'| +0#0000e05&|r+0#00e0003&|e|p|l|a|c|e|m|e|n|t| +0#0000e05&|=| |"+0#e000002&|\|u|0@1|2@1|\|u|0@1|2@1|"| +0#0000000&@11 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&@1| |@+0#0000000&|l|i|n|k| +0#0000e05&|r+0#00e0003&|e|g|e|x| +0#0000e05&|=| |'+0#e000002&|\|b|S|t|r|i|n|g|'| +0#0000e05&|t+0#00e0003&|a|r|g|e|t| +0#0000e05&|=| |j+0#e000002&|a|v|a|.|l|a|n|g|.|S|t|r|i|n|g| +0#0000e05&|t+0#00e0003&|y|p|e| +0#0000e05&|=| |l+0#e000002&|i|n|k|p|l|a|i +| +0#0000e05#a8a8a8255@1|n+0#e000002#ffffff0| +0#0000e05&|:| +0#0000000&@69 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|p+0#00e0003&|u|b|l|i|c| +0#0000000&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&@1|;+0#0000000&| |}| @19 +@57|1|0|9|,|2|-|5| @6|9|8|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_07.dump b/runtime/syntax/testdir/dumps/java_comments_07.dump new file mode 100644 index 0000000000..f83433e750 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_comments_07.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|p+0#00e0003&|u|b|l|i|c| +0#0000000&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&@1|;+0#0000000&| |}| @19 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&@1| |@+0#0000000&|e|n|d| +0#ffffff16#ff404010| +0#0000000#ffffff0@60 +| +0#0000e05#a8a8a8255@1>}+0#0000000#ffffff0| @71 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|2@1|,|1| @8|B|o|t| diff --git a/runtime/syntax/testdir/dumps/java_module_info_00.dump b/runtime/syntax/testdir/dumps/java_module_info_00.dump new file mode 100644 index 0000000000..a80da8932f --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_module_info_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |T|h|i|s| |m|o|d|u|l|e| |d|e|c|l|a|r|a|t|i|o|n| |b|e|l|o|n|g|s| |t|o| |t|h|e| |s|a|m|p|l|e| |p|r|o|j|e|c|t| |p|u|b|l|i|s|h|e|d| |a|t| +0#0000000&@5 +|/+0#0000e05&@1| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|z@2|y|x|w|v|u|t|/|m|o|d|u|l|e|-|i|n|f|o|.|g|i|t| |.| +0#0000000&@25 +@75 +|i+0#e000e06&|m|p|o|r|t| +0#0000000&|j|a|v|a|.|u|t|i|l|.|S|e|r|v|i|c|e|L|o|a|d|e|r|;| @43 +@75 +|/+0#0000e05&|*@1| +0#0000000&@71 +| +0#0000e05&|*| +0#e000e06&|D|e|f|i|n|e|s| |d|e|m|o| |r|e|l|a|t|e|d| |s|u|p@1|o|r|t|.| +0#0000000&@42 +| +0#0000e05&|*| +0#0000000&@72 +| +0#0000e05&|*| |N|o|t|e| |t|h|a|t| |t|h|e| |{+0#e000e06&|@|c|o|d|e| |T|e|s|t|a|b|l|e|}| +0#0000e05&|s|e|r|v|i|c|e| |i|s| |n|o|t| |e|x|p|o|r|t|e|d|.| +0#0000000&@16 +| +0#0000e05&|*| +0#0000000&@72 +| +0#0000e05&|*| |@+0#e000e06&|u|s|e|s| |o+0#00e0e07&|r|g|.|d|e|m|o|.|i|n|t|e|r|n|a|l|.|T|e|s|t|a|b|l|e| +0#0000000&@39 +| +0#0000e05&|*| |@+0#e000e06&|p|r|o|v|i|d|e|s| |o+0#00e0e07&|r|g|.|d|e|m|o|.|i|n|t|e|r|n|a|l|.|T|e|s|t|a|b|l|e| +0#0000000&@35 +| +0#0000e05&|*| |@+0#e000e06&|s|e@1| +0#0000e05&|S+0#00e0e07&|e|r|v|i|c|e|L|o|a|d|e|r| +0#0000000&@53 +| +0#0000e05&|*|/| +0#0000000&@71 +|m+0#00e0003&|o|d|u|l|e| +0#0000000&|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|d|e|m|o| @47 +|{| @73 +@4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|j|d|k|.|j|f|r|;| @46 +@4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|j|a|v|a|.|b|a|s|e|;| @51 +@4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|t+0#00e0003&|r|a|n|s|i|t|i|v|e| +0#0000000&|j|a|v|a|.|l|o|g@1|i|n|g|;| @37 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/java_module_info_01.dump b/runtime/syntax/testdir/dumps/java_module_info_01.dump new file mode 100644 index 0000000000..793cb89336 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_module_info_01.dump @@ -0,0 +1,20 @@ +| +0#0000e05#ffffff0|*|/| +0#0000000&@71 +|m+0#00e0003&|o|d|u|l|e| +0#0000000&|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|d|e|m|o| @47 +|{| @73 +@4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|j|d|k|.|j|f|r|;| @46 +@4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|j|a|v|a|.|b|a|s|e|;| @51 +@4>r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|t+0#00e0003&|r|a|n|s|i|t|i|v|e| +0#0000000&|j|a|v|a|.|l|o|g@1|i|n|g|;| @37 +@4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|t+0#00e0003&|r|a|n|s|i|t|i|v|e| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|t|e|s|t|e|r|;| @20 +@75 +@4|e+0#af5f00255&|x|p|o|r|t|s| +0#0000000&|o|r|g|.|d|e|m|o|;| @53 +@4|e+0#af5f00255&|x|p|o|r|t|s| +0#0000000&|o|r|g|.|d|e|m|o|.|i|n|t|e|r|n|a|l| |t+0#e000e06&|o| +0#0000000&@42 +@8|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|d|e|m|o|;| @45 +@75 +@4|o+0#af5f00255&|p|e|n|s| +0#0000000&|o|r|g|.|d|e|m|o|.|i|n|t|e|r|n|a|l| |t+0#e000e06&|o| +0#0000000&@44 +@8|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|d|e|m|o|;| @45 +@4|o+0#af5f00255&|p|e|n|s| +0#0000000&|o|r|g|.|d|e|m|o|.|t|e|s|t|s| |t+0#e000e06&|o| +0#0000000&@47 +@8|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|d|e|m|o|,| |o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|t|e|s|t|e|r|;| @21 +@75 +@4|u+0#af5f00255&|s|e|s| +0#0000000&|o|r|g|.|d|e|m|o|.|i|n|t|e|r|n|a|l|.|T|e|s|t|a|b|l|e|;| @38 +@75 +@57|1|9|,|2|-|5| @7|8|1|%| diff --git a/runtime/syntax/testdir/dumps/java_module_info_02.dump b/runtime/syntax/testdir/dumps/java_module_info_02.dump new file mode 100644 index 0000000000..cc258a9224 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_module_info_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +@4|p+0#af5f00255&|r|o|v|i|d|e|s| +0#0000000&|o|r|g|.|d|e|m|o|.|i|n|t|e|r|n|a|l|.|T|e|s|t|a|b|l|e| |w+0#e000e06&|i|t|h| +0#0000000&@30 +@8|o|r|g|.|d|e|m|o|.|t|e|s|t|s|.|A|r|i|t|h|m|e|t|i|c|O|p|e|r|a|t|i|o|n|T|e|s|t|s|;| @26 +>}| @73 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|5|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/java_comments.java b/runtime/syntax/testdir/input/java_comments.java index 3c1a8a2e32..35f6f7d50d 100644 --- a/runtime/syntax/testdir/input/java_comments.java +++ b/runtime/syntax/testdir/input/java_comments.java @@ -1,7 +1,19 @@ -// VIM_TEST_SETUP unlet! g:java_ignore_javadoc g:java_no_trail_space_error -// VIM_TEST_SETUP unlet! g:java_no_tab_space_error -// VIM_TEST_SETUP let [g:java_space_errors,g:java_comment_strings] = [1,1] -// VIM_TEST_SETUP setlocal spell | highlight link javaCommentStart Todo +// VIM_TEST_SETUP unlet! g:java_no_tab_space_error g:java_ignore_javadoc +// VIM_TEST_SETUP unlet! g:java_no_trail_space_error +// VIM_TEST_SETUP let [g:java_space_errors,g:java_comment_strings]=[1,1] + + + + + + + +// VIM_TEST_SETUP setlocal spell fdc=2 fdl=64 fdm=syntax fen +// VIM_TEST_SETUP highlight link javaCommentStart Todo +// VIM_TEST_SETUP highlight link javaCommentTitle Underlined + + + @@ -11,8 +23,10 @@ * {@snippet file = Snippets.java region = main id = _01} *

There is no textual representation: * {@snippet class = Snippets region = toString id = _02} */ -class CommentsTests +class CommentsTests implements Comparable { + private CommentsTests() { } + /** No-op, i. e. no operation. * ({@literal@literal} may be used with {@code .} for contraction.) * @return {@code null} */ @@ -49,6 +63,22 @@ class CommentsTests /** {@return {@code null}, with no-op, i.e. no operation} . . */ Void noOp9() { return null; } + /** {@return the major Java version} @hidden */ + protected int majorVersion() { return 21; } + + /** {@summary Compares this instance with the passed {@code that} + * instance for order by invoking {@link Integer#compare(int, int) + * compare} and passing it {@code this.majorVersion()} and + * {@code that.majorVersion()} as respective @arguments.} + * + * {@inheritDoc} */ + @Override public int compareTo(CommentsTests that) + { + java.util.Objects.requireNonNull(that, "that"); + return Integer.compare(this.majorVersion(), + that.majorVersion()); + } + /** Returns an empty string for an @Override annotated method * (see Chapter 9.6.4.4 {@literal @Override} in a Java Language * Specification) overridden from java.lang.Object @@ -57,15 +87,17 @@ class CommentsTests @Override public String toString() { return ""; } } -// javadoc --snippet-path . --source-path . -d /tmp/doc/ -package \ +// javadoc --snippet-path . --source-path . -d /tmp/docs/ -package \ // -tag 'jls:a:See Java Language Specification:' Snippets.java /** Snippets for comment tests. */ class Snippets { /* TRAILING BLANKS AND MESSPILLINGS ARE SIGNIFICANT! */ + private Snippets() { } + /** The method {@code main} must be declared {@code public}, {@code * static}, and {@code void}. It must specify a formal parameter * whose declared type is array of {@link String}. Therefore, - * either of the following declarations is acceptable: + * either of the following declarations is acceptable: * {@snippet lang="java": * // @highlight substring="main" type="italic": * public static void main(String[] args) { } @@ -79,9 +111,9 @@ class Snippets public static void main(String[] args) { } // @end - /** {@return an empty string} + /** {@return an empty string} * @see 3.10.5 String Literals - * @see Object#toString() */ + * @see java.base/java.lang.Object#toString() */ // @start region = toString // @replace substring = '""' replacement = "\u0022\u0022" // @link regex = '\bString' target = java.lang.String type = linkplain : diff --git a/runtime/syntax/testdir/input/java_module_info.java b/runtime/syntax/testdir/input/java_module_info.java new file mode 100644 index 0000000000..bfbea93a2e --- /dev/null +++ b/runtime/syntax/testdir/input/java_module_info.java @@ -0,0 +1,35 @@ +// This module declaration belongs to the sample project published at +// https://github.com/zzzyxwvut/module-info.git . + +import java.util.ServiceLoader; + +/** + * Defines demo related support. + * + * Note that the {@code Testable} service is not exported. + * + * @uses org.demo.internal.Testable + * @provides org.demo.internal.Testable + * @see ServiceLoader + */ +module org.module.info.demo +{ + requires static jdk.jfr; + requires java.base; + requires transitive java.logging; + requires transitive static org.module.info.tester; + + exports org.demo; + exports org.demo.internal to + org.module.info.demo; + + opens org.demo.internal to + org.module.info.demo; + opens org.demo.tests to + org.module.info.demo, org.module.info.tester; + + uses org.demo.internal.Testable; + + provides org.demo.internal.Testable with + org.demo.tests.ArithmeticOperationTests; +} diff --git a/runtime/syntax/testdir/input/setup/java_module_info.vim b/runtime/syntax/testdir/input/setup/java_module_info.vim new file mode 100644 index 0000000000..2711c1a9a0 --- /dev/null +++ b/runtime/syntax/testdir/input/setup/java_module_info.vim @@ -0,0 +1,30 @@ +vim9script + +# Test filenames are required to begin with the filetype name prefix, +# whereas the name of a Java module declaration must be "module-info". +const name_a: string = 'input/java_module_info.java' +const name_b: string = 'input/module-info.java' + +def ChangeFilename() + exec 'saveas! ' .. name_b +enddef + +def RestoreFilename() + exec 'saveas! ' .. name_a + delete(name_b) +enddef + +autocmd_add([{ + replace: true, + group: 'java_syntax_tests', + event: 'BufEnter', + pattern: name_a, + cmd: 'ChangeFilename()', + once: true, +}, { + group: 'java_syntax_tests', + event: ['BufLeave', 'ExitPre'], + pattern: name_b, + cmd: 'RestoreFilename()', + once: true, +}]) diff --git a/src/if_python3.c b/src/if_python3.c index ac817bdce4..139ec54df6 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -219,16 +219,9 @@ static HINSTANCE hinstPy3 = 0; // Instance of python.dll # define PyObject_GetItem py3_PyObject_GetItem # define PyObject_IsTrue py3_PyObject_IsTrue # define PyModule_GetDict py3_PyModule_GetDict -# if defined(USE_LIMITED_API) \ - && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG)) -# undef Py_INCREF -# if Py_LIMITED_API+0 >= 0x030a00A7 -# define _Py_IncRef py3__Py_IncRef -# define Py_INCREF _Py_IncRef -# else -# define Py_IncRef py3_Py_IncRef -# define Py_INCREF Py_IncRef -# endif +# if defined(USE_LIMITED_API) || PY_VERSION_HEX >= 0x03080000 +# define Py_IncRef py3_Py_IncRef +# define Py_DecRef py3_Py_DecRef # endif # ifdef USE_LIMITED_API # define Py_CompileString py3_Py_CompileString @@ -267,7 +260,8 @@ static HINSTANCE hinstPy3 = 0; // Instance of python.dll # define _Py_NoneStruct (*py3__Py_NoneStruct) # define _Py_FalseStruct (*py3__Py_FalseStruct) # define _Py_TrueStruct (*py3__Py_TrueStruct) -# ifndef USE_LIMITED_API +# if !defined(USE_LIMITED_API) && PY_VERSION_HEX < 0x030D0000 +// Private symbol that used to be required as part of PyIter_Check. # define _PyObject_NextNotImplemented (*py3__PyObject_NextNotImplemented) # endif # define PyModule_AddObject py3_PyModule_AddObject @@ -299,9 +293,6 @@ static HINSTANCE hinstPy3 = 0; // Instance of python.dll # define PyBytes_FromString py3_PyBytes_FromString # undef PyBytes_FromStringAndSize # define PyBytes_FromStringAndSize py3_PyBytes_FromStringAndSize -# if defined(Py_DEBUG) || PY_VERSION_HEX >= 0x030900b0 || defined(USE_LIMITED_API) -# define _Py_Dealloc py3__Py_Dealloc -# endif # define PyFloat_FromDouble py3_PyFloat_FromDouble # define PyFloat_AsDouble py3_PyFloat_AsDouble # define PyObject_GenericGetAttr py3_PyObject_GenericGetAttr @@ -402,14 +393,9 @@ static void (*py3_Py_Finalize)(void); static void (*py3_PyErr_SetString)(PyObject *, const char *); static void (*py3_PyErr_SetObject)(PyObject *, PyObject *); static int (*py3_PyErr_ExceptionMatches)(PyObject *); -# if defined(USE_LIMITED_API) \ - && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG)) -# if Py_LIMITED_API+0 >= 0x030a00A7 -# define _Py_IncRef py3__Py_IncRef -static void (*py3__Py_IncRef)(PyObject *); -# else +# if defined(USE_LIMITED_API) || PY_VERSION_HEX >= 0x03080000 static void (*py3_Py_IncRef)(PyObject *); -# endif +static void (*py3_Py_DecRef)(PyObject *); # endif # ifdef USE_LIMITED_API static PyObject* (*py3_Py_CompileString)(const char *, const char *, int); @@ -482,7 +468,7 @@ static void (*py3_PyErr_Clear)(void); static PyObject* (*py3_PyErr_Format)(PyObject *, const char *, ...); static void (*py3_PyErr_PrintEx)(int); static PyObject*(*py3__PyObject_Init)(PyObject *, PyTypeObject *); -# ifndef USE_LIMITED_API +# if !defined(USE_LIMITED_API) && PY_VERSION_HEX < 0x030D0000 static iternextfunc py3__PyObject_NextNotImplemented; # endif static PyObject* py3__Py_NoneStruct; @@ -508,9 +494,6 @@ static char* (*py3_PyBytes_AsString)(PyObject *bytes); static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, Py_ssize_t *length); static PyObject* (*py3_PyBytes_FromString)(char *str); static PyObject* (*py3_PyBytes_FromStringAndSize)(char *str, Py_ssize_t length); -# if defined(Py_DEBUG) || PY_VERSION_HEX >= 0x030900b0 || defined(USE_LIMITED_API) -static void (*py3__Py_Dealloc)(PyObject *obj); -# endif # if PY_VERSION_HEX >= 0x030900b0 static PyObject* (*py3__PyObject_New)(PyTypeObject *); # endif @@ -618,13 +601,9 @@ static struct {"PyErr_SetString", (PYTHON_PROC*)&py3_PyErr_SetString}, {"PyErr_SetObject", (PYTHON_PROC*)&py3_PyErr_SetObject}, {"PyErr_ExceptionMatches", (PYTHON_PROC*)&py3_PyErr_ExceptionMatches}, -# if defined(USE_LIMITED_API) \ - && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG)) -# if Py_LIMITED_API+0 >= 0x030a00A7 - {"_Py_IncRef", (PYTHON_PROC*)&py3__Py_IncRef}, -# else +# if defined(USE_LIMITED_API) || PY_VERSION_HEX >= 0x03080000 {"Py_IncRef", (PYTHON_PROC*)&py3_Py_IncRef}, -# endif + {"Py_DecRef", (PYTHON_PROC*)&py3_Py_DecRef}, # endif # ifdef USE_LIMITED_API {"Py_CompileString", (PYTHON_PROC*)&py3_Py_CompileString}, @@ -679,7 +658,7 @@ static struct {"PyEval_SaveThread", (PYTHON_PROC*)&py3_PyEval_SaveThread}, {"_PyArg_Parse_SizeT", (PYTHON_PROC*)&py3_PyArg_Parse}, {"Py_IsInitialized", (PYTHON_PROC*)&py3_Py_IsInitialized}, -# ifndef USE_LIMITED_API +# if !defined(USE_LIMITED_API) && PY_VERSION_HEX < 0x030D0000 {"_PyObject_NextNotImplemented", (PYTHON_PROC*)&py3__PyObject_NextNotImplemented}, # endif {"_Py_NoneStruct", (PYTHON_PROC*)&py3__Py_NoneStruct}, @@ -717,9 +696,6 @@ static struct {"PyBytes_AsStringAndSize", (PYTHON_PROC*)&py3_PyBytes_AsStringAndSize}, {"PyBytes_FromString", (PYTHON_PROC*)&py3_PyBytes_FromString}, {"PyBytes_FromStringAndSize", (PYTHON_PROC*)&py3_PyBytes_FromStringAndSize}, -# if defined(Py_DEBUG) || PY_VERSION_HEX >= 0x030900b0 || defined(USE_LIMITED_API) - {"_Py_Dealloc", (PYTHON_PROC*)&py3__Py_Dealloc}, -# endif # if PY_VERSION_HEX >= 0x030900b0 {"_PyObject_New", (PYTHON_PROC*)&py3__PyObject_New}, # endif @@ -767,53 +743,24 @@ static struct {"", NULL}, }; -# if PY_VERSION_HEX >= 0x030800f0 - static inline void -py3__Py_DECREF(const char *filename UNUSED, int lineno UNUSED, PyObject *op) -{ - if (--op->ob_refcnt != 0) - { -# ifdef Py_REF_DEBUG - if (op->ob_refcnt < 0) - { - _Py_NegativeRefcount(filename, lineno, op); - } -# endif - } - else - { - _Py_Dealloc(op); - } -} +# if defined(USE_LIMITED_API) || PY_VERSION_HEX >= 0x03080000 +// Use stable versions of inc/dec ref. Note that these always null-check and +// therefore there's no difference between XINCREF and INCREF. +// +// For 3.8 or above, we also use this version even if not using limited API. +// The Py_DECREF macros in 3.8+ include references to internal functions which +// cause link errors when building Vim. The stable versions are exposed as API +// functions and don't have these problems (albeit slightly slower as they +// require function calls rather than an inlined macro). +# undef Py_INCREF +# define Py_INCREF(obj) Py_IncRef((PyObject *)obj) +# undef Py_XINCREF +# define Py_XINCREF(obj) Py_IncRef((PyObject *)obj) # undef Py_DECREF -# define Py_DECREF(op) py3__Py_DECREF(__FILE__, __LINE__, _PyObject_CAST(op)) - - static inline void -py3__Py_XDECREF(PyObject *op) -{ - if (op != NULL) - { - Py_DECREF(op); - } -} - +# define Py_DECREF(obj) Py_DecRef((PyObject *)obj) # undef Py_XDECREF -# define Py_XDECREF(op) py3__Py_XDECREF(_PyObject_CAST(op)) -# endif - -# if defined(USE_LIMITED_API) \ - && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG)) - static inline void -py3__Py_XINCREF(PyObject *op) -{ - if (op != NULL) - { - Py_INCREF(op); - } -} -# undef Py_XINCREF -# define Py_XINCREF(op) py3__Py_XINCREF(_PyObject_CAST(op)) +# define Py_XDECREF(obj) Py_DecRef((PyObject *)obj) # endif # if PY_VERSION_HEX >= 0x030900b0 diff --git a/src/option.c b/src/option.c index e790fdb106..b349cfb28e 100644 --- a/src/option.c +++ b/src/option.c @@ -41,7 +41,7 @@ static void set_options_default(int opt_flags); static void set_string_default_esc(char *name, char_u *val, int escape); -static char_u *find_dup_item(char_u *origval, char_u *newval, long_u flags); +static char_u *find_dup_item(char_u *origval, char_u *newval, size_t newvallen, long_u flags); static char_u *option_expand(int opt_idx, char_u *val); static void didset_options(void); static void didset_options2(void); @@ -132,51 +132,72 @@ set_init_default_shell(void) set_init_default_backupskip(void) { int opt_idx; - long_u n; + int i; char_u *p; + int plen; #ifdef UNIX static char *(names[4]) = {"", "TMPDIR", "TEMP", "TMP"}; #else static char *(names[3]) = {"TMPDIR", "TEMP", "TMP"}; #endif - int len; garray_T ga; - char_u *item; opt_idx = findoption((char_u *)"backupskip"); ga_init2(&ga, 1, 100); - for (n = 0; n < (long)ARRAY_LENGTH(names); ++n) + for (i = 0; i < (int)ARRAY_LENGTH(names); ++i) { int mustfree = FALSE; #ifdef UNIX - if (*names[n] == NUL) + if (*names[i] == NUL) + { # ifdef MACOS_X p = (char_u *)"/private/tmp"; + plen = (int)STRLEN_LITERAL("/private/tmp"); # else - p = (char_u *)"/tmp"; + p = (char_u *)"/tmp"; + plen = (int)STRLEN_LITERAL("/tmp"); # endif + } else #endif - p = vim_getenv((char_u *)names[n], &mustfree); + { + p = vim_getenv((char_u *)names[i], &mustfree); + plen = 0; // will be calculated below + } if (p != NULL && *p != NUL) { - // First time count the NUL, otherwise count the ','. - len = (int)STRLEN(p) + 3; - item = alloc(len); + char_u *item; + size_t itemsize; + int has_trailing_path_sep = FALSE; + + if (plen == 0) + { + // the value was retrieved from the environment + plen = (int)STRLEN(p); + // does the value include a trailing path separator? + if (after_pathsep(p, p + plen)) + has_trailing_path_sep = TRUE; + } + + // item size needs to be large enough to include "/*" and a trailing NUL + // note: the value (and therefore plen) may already include a path separator + itemsize = plen + (has_trailing_path_sep ? 0 : 1) + 2; + item = alloc(itemsize); if (item != NULL) { - STRCPY(item, p); - add_pathsep(item); - STRCAT(item, "*"); - if (find_dup_item(ga.ga_data, item, options[opt_idx].flags) - == NULL - && ga_grow(&ga, len) == OK) + // add a preceeding comma as a separator after the first item + size_t itemseplen = (ga.ga_len == 0) ? 0 : 1; + size_t itemlen; + + itemlen = vim_snprintf((char *)item, itemsize, "%s%s*", p, (has_trailing_path_sep) ? "" : PATHSEPSTR); + + if (find_dup_item(ga.ga_data, item, itemlen, options[opt_idx].flags) == NULL + && ga_grow(&ga, itemseplen + itemlen + 1) == OK) { - if (ga.ga_len > 0) - STRCAT(ga.ga_data, ","); - STRCAT(ga.ga_data, item); - ga.ga_len += len; + ga.ga_len += vim_snprintf((char *)ga.ga_data + ga.ga_len, + itemseplen + itemlen + 1, + "%s%s", (itemseplen > 0) ? "," : "", item); } vim_free(item); } @@ -527,7 +548,7 @@ set_init_default_encoding(void) // MS-Windows has builtin support for conversion to and from Unicode, using // "utf-8" for 'encoding' should work best for most users. // z/OS built should default to UTF-8 mode as setlocale does not respect utf-8 environment variable locales - p = vim_strsave((char_u *)ENC_DFLT); + p = vim_strnsave((char_u *)ENC_DFLT, STRLEN_LITERAL(ENC_DFLT)); # else // enc_locale() will try to find the encoding of the current locale. // This works best for properly configured systems, old and new. @@ -545,7 +566,7 @@ set_init_default_encoding(void) // We don't support "gb18030", but "cp936" is a good substitute // for practical purposes, thus use that. It's not an alias to // still support conversion between gb18030 and utf-8. - p_enc = vim_strsave((char_u *)"cp936"); + p_enc = vim_strnsave((char_u *)"cp936", STRLEN_LITERAL("cp936")); vim_free(p); } #if defined(FEAT_GUI_MACVIM) @@ -602,14 +623,15 @@ set_init_default_encoding(void) GetACP() != GetConsoleCP()) { char buf[50]; + size_t buflen; // Win32 console: In ConPTY, GetConsoleCP() returns zero. // Use an alternative value. if (GetConsoleCP() == 0) - sprintf(buf, "cp%ld", (long)GetACP()); + buflen = vim_snprintf(buf, sizeof(buf), "cp%ld", (long)GetACP()); else - sprintf(buf, "cp%ld", (long)GetConsoleCP()); - p_tenc = vim_strsave((char_u *)buf); + buflen = vim_snprintf(buf, sizeof(buf), "cp%ld", (long)GetConsoleCP()); + p_tenc = vim_strnsave((char_u *)buf, buflen); if (p_tenc != NULL) { opt_idx = findoption((char_u *)"termencoding"); @@ -903,25 +925,23 @@ set_string_default(char *name, char_u *val) * "origval". Return NULL if not found. */ static char_u * -find_dup_item(char_u *origval, char_u *newval, long_u flags) +find_dup_item(char_u *origval, char_u *newval, size_t newvallen, long_u flags) { int bs = 0; - size_t newlen; char_u *s; if (origval == NULL) return NULL; - newlen = STRLEN(newval); for (s = origval; *s != NUL; ++s) { if ((!(flags & P_COMMA) || s == origval || (s[-1] == ',' && !(bs & 1))) - && STRNCMP(s, newval, newlen) == 0 + && STRNCMP(s, newval, newvallen) == 0 && (!(flags & P_COMMA) - || s[newlen] == ',' - || s[newlen] == NUL)) + || s[newvallen] == ',' + || s[newvallen] == NUL)) return s; // Count backslashes. Only a comma with an even number of backslashes // or a single backslash preceded by a comma before it is recognized as @@ -1307,28 +1327,34 @@ set_init_3(void) set_helplang_default(char_u *lang) { int idx; + size_t langlen; - if (lang == NULL || STRLEN(lang) < 2) // safety check + if (lang == NULL) // safety check return; + + langlen = STRLEN(lang); + if (langlen < 2) // safety check + return; + idx = findoption((char_u *)"hlg"); if (idx < 0 || (options[idx].flags & P_WAS_SET)) return; if (options[idx].flags & P_ALLOCED) free_string_option(p_hlg); - p_hlg = vim_strsave(lang); + p_hlg = vim_strnsave(lang, langlen); if (p_hlg == NULL) p_hlg = empty_option; else { // zh_CN becomes "cn", zh_TW becomes "tw" - if (STRNICMP(p_hlg, "zh_", 3) == 0 && STRLEN(p_hlg) >= 5) + if (STRNICMP(p_hlg, "zh_", 3) == 0 && langlen >= 5) { p_hlg[0] = TOLOWER_ASC(p_hlg[3]); p_hlg[1] = TOLOWER_ASC(p_hlg[4]); } // any C like setting, such as C.UTF-8, becomes "en" - else if (STRLEN(p_hlg) >= 1 && *p_hlg == 'C') + else if (langlen >= 1 && *p_hlg == 'C') { p_hlg[0] = 'e'; p_hlg[1] = 'n'; @@ -1643,13 +1669,13 @@ opt_backspace_nr2str( *(char_u **)varp = empty_option; break; case 1: - *(char_u **)varp = vim_strsave((char_u *)"indent,eol"); + *(char_u **)varp = vim_strnsave((char_u *)"indent,eol", STRLEN_LITERAL("indent,eol")); break; case 2: - *(char_u **)varp = vim_strsave((char_u *)"indent,eol,start"); + *(char_u **)varp = vim_strnsave((char_u *)"indent,eol,start", STRLEN_LITERAL("indent,eol,start")); break; case 3: - *(char_u **)varp = vim_strsave((char_u *)"indent,eol,nostop"); + *(char_u **)varp = vim_strnsave((char_u *)"indent,eol,nostop", STRLEN_LITERAL("indent,eol,nostop")); break; } vim_free(*oldval_p); @@ -1670,20 +1696,37 @@ opt_backspace_nr2str( static char_u * opt_whichwrap_nr2str(char_u **argp, char_u *whichwrap) { + size_t len = 0; + *whichwrap = NUL; int i = getdigits(argp); if (i & 1) - STRCAT(whichwrap, "b,"); + { + STRCPY(whichwrap, "b,"); + len += 2; + } if (i & 2) - STRCAT(whichwrap, "s,"); + { + STRCPY(whichwrap + len, "s,"); + len += 2; + } if (i & 4) - STRCAT(whichwrap, "h,l,"); + { + STRCPY(whichwrap + len, "h,l,"); + len += 4; + } if (i & 8) - STRCAT(whichwrap, "<,>,"); + { + STRCPY(whichwrap + len, "<,>,"); + len += 4; + } if (i & 16) - STRCAT(whichwrap, "[,],"); + { + STRCPY(whichwrap + len, "[,],"); + len += 4; + } if (*whichwrap != NUL) // remove trailing , - whichwrap[STRLEN(whichwrap) - 1] = NUL; + whichwrap[len - 1] = NUL; return whichwrap; } @@ -1970,7 +2013,7 @@ stropt_get_newval( if (op == OP_REMOVING || (flags & P_NODUP)) { len = (int)STRLEN(newval); - s = find_dup_item(origval, newval, flags); + s = find_dup_item(origval, newval, len, flags); // do not add if already there if ((op == OP_ADDING || op == OP_PREPENDING) && s != NULL) @@ -2698,12 +2741,11 @@ do_set( if (errmsg != NULL) { - vim_strncpy(IObuff, (char_u *)_(errmsg), IOSIZE - 1); - i = (int)STRLEN(IObuff) + 2; + i = vim_snprintf((char *)IObuff, IOSIZE, "%s", (char_u *)_(errmsg)) + 2; if (i + (arg - startarg) < IOSIZE) { // append the argument with the error - STRCAT(IObuff, ": "); + STRCPY(IObuff + i - 2, ": "); mch_memmove(IObuff + i, startarg, (arg - startarg)); IObuff[i + (arg - startarg)] = NUL; } @@ -5254,7 +5296,7 @@ get_option_value( // never return the value of the crypt key else if ((char_u **)varp == &curbuf->b_p_key && **(char_u **)(varp) != NUL) - *stringval = vim_strsave((char_u *)"*****"); + *stringval = vim_strnsave((char_u *)"*****", STRLEN_LITERAL("*****")); #endif else *stringval = vim_strsave(*(char_u **)(varp)); @@ -7494,6 +7536,7 @@ set_context_in_set_cmd( char_u *s; int is_term_option = FALSE; int key; + char_u *argend; expand_option_flags = opt_flags; @@ -7503,7 +7546,8 @@ set_context_in_set_cmd( xp->xp_pattern = arg; return; } - p = arg + STRLEN(arg) - 1; + argend = arg + STRLEN(arg); + p = argend - 1; if (*p == ' ' && *(p - 1) != '\\') { xp->xp_pattern = p + 1; @@ -7720,7 +7764,7 @@ set_context_in_set_cmd( // delimited by space. if ((flags & P_EXPAND) || (flags & P_COMMA) || (flags & P_COLON)) { - for (p = arg + STRLEN(arg) - 1; p >= xp->xp_pattern; --p) + for (p = argend - 1; p >= xp->xp_pattern; --p) { // count number of backslashes before ' ' or ',' or ':' if (*p == ' ' || *p == ',' || @@ -7747,7 +7791,7 @@ set_context_in_set_cmd( // An option that is a list of single-character flags should always start // at the end as we don't complete words. if (flags & P_FLAGLIST) - xp->xp_pattern = arg + STRLEN(arg); + xp->xp_pattern = argend; // Some options can either be using file/dir expansions, or custom value // expansion depending on what the user typed. Unfortunately we have to @@ -8266,7 +8310,7 @@ ExpandSettingSubtract( int count = 0; char_u *p; - p = vim_strsave(option_val); + p = vim_strnsave(option_val, num_flags); if (p == NULL) { VIM_CLEAR(*matches); diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 1e6c39ed99..c10023d94c 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -712,7 +712,7 @@ def s:GetFilenameChecks(): dict> svg: ['file.svg'], svn: ['svn-commitfile.tmp', 'svn-commit-file.tmp', 'svn-commit.tmp'], swayconfig: ['/home/user/.sway/config', '/home/user/.config/sway/config', '/etc/sway/config', '/etc/xdg/sway/config'], - swift: ['file.swift'], + swift: ['file.swift', 'file.swiftinterface'], swiftgyb: ['file.swift.gyb'], swig: ['file.swg', 'file.swig'], sysctl: ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf', 'any/etc/sysctl.conf', 'any/etc/sysctl.d/file.conf'], diff --git a/src/version.c b/src/version.c index 3171812267..00b7459a5a 100644 --- a/src/version.c +++ b/src/version.c @@ -719,6 +719,16 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 727, +/**/ + 726, +/**/ + 725, +/**/ + 724, +/**/ + 723, /**/ 722, /**/