Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9147ac1
circleci: delete duplicated packages
masatake Mar 12, 2026
f83af8b
circleci: add rubypick for running ruby input validator
masatake Mar 12, 2026
fec2aa4
main,comment: fix a typo
masatake Mar 12, 2026
ff6ebf0
Go,comment: add missing words
masatake Mar 13, 2026
a51d0a1
Go,NEWS: write about "receiver" field added ago
masatake Mar 11, 2026
3aacc1b
Go,comment: update the URL for the language reference
masatake Mar 11, 2026
ef42472
Go,refactor: use early return in collecion related functions
masatake Mar 12, 2026
e0c258f
Go: add const modifier to parameters of the collector functions
masatake Mar 13, 2026
ea5af74
Go: apply MAX_COLLECTOR_LENGTH more comprehensively
masatake Mar 12, 2026
4d0a204
Go,refactor: add a helper function and a macro managing collector lif…
masatake Mar 11, 2026
cdbba9a
validate-input: add #!/bin/sh line to the head of scripts
masatake Mar 12, 2026
aff0e08
validate-input: add default action for reporting an error
masatake Mar 12, 2026
9c27ce7
validate-input: use "." instead of source built-in
masatake Mar 13, 2026
6d2f641
validate-input,cosmetic: fix the indentation style
masatake Mar 13, 2026
4e238e6
validate-input: quote $n with "
masatake Mar 13, 2026
46bacca
validate-input(python): quote more $vars with "
masatake Mar 14, 2026
621b99b
validate-input: use more portable redirect notation
masatake Mar 13, 2026
0e8d511
validate-input: use "command" instead of "type" to detect command ava…
masatake Mar 13, 2026
5fa7d93
validate-input: add Go input validator
masatake Mar 12, 2026
471782f
Units(Go): add validator files
masatake Mar 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Units/parser-go.r/github-issue-2430.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main input.go /^func main() {$/;" f package:main
3 changes: 3 additions & 0 deletions Units/parser-go.r/github-issue-2430.d/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ package main
type Interval struct {
Start, Stop string
}

func main() {
}
1 change: 1 addition & 0 deletions Units/parser-go.r/github-issue-2430.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-crash-issue-2220.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-end-field-for-types.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-funcs.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-goroutines.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-helloworld.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-ignore-underscore-var.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-op-less-than.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-timeouts.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-torture.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
1 change: 1 addition & 0 deletions Units/parser-go.r/go-variadic-dots.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
name: Install tools for building ctags and validating test input files
command: |
dnf -y install awk gcc automake autoconf pkgconfig make libseccomp-devel libxml2-devel jansson-devel libyaml-devel pcre2-devel findutils diffutils sudo
dnf -y install jq puppet python3-sphinx
dnf -y install python3-sphinx
# These are for input-validation.
dnf -y install g++ jq puppet nodejs gcc-gfortran gcc-gnat typescript swi-prolog
dnf -y install g++ jq puppet nodejs gcc-gfortran gcc-gnat typescript swi-prolog rubypick golang-bin
# nodejs requires libsqlite.so.0 with sqlite-session feature
# It was turned off in 3.46.1-1.
dnf -y update sqlite-libs
Expand Down
4 changes: 4 additions & 0 deletions docs/news/HEAD.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ QemuHX:
* Implement a selector arbitrating Haxe and QemuHX parsers, both handling
``.hx`` file extension.

Go:

* Add ``receiver`` field to ``func`` kind tags.

New parsers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following parsers have been added:
Expand Down
4 changes: 2 additions & 2 deletions main/vstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ extern void vStringCat (vString *const string, const vString *const s);
extern void vStringCatS (vString *const string, const char *const s);
extern void vStringNCat (vString *const string, const vString *const s, const size_t length);

/* vStringNCatS calls strnlen(S,LENGTH) thought it takes LENGTH because
* the handle the case that the length of S is smaller than LENGTH.
/* vStringNCatS calls strnlen(S,LENGTH) though it takes LENGTH because
* it handles the case that the length of S is smaller than LENGTH.
*
* In the case a caller knows the length equals to or is greater than LENGTH,
* calling strlen is just overhead. vStringNCatSUnsafe doesn't call strlen. */
Expand Down
17 changes: 11 additions & 6 deletions misc/validators/g++-common.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# g++-common.sh - common code used in validator-cxx*
#
# Copyright (c) 2022, Masatake YAMATO
Expand All @@ -25,11 +26,15 @@ shift 3

case "$action" in
is_runnable)
type g++ > /dev/null 2>&1
exit $?
;;
command -v g++ > /dev/null 2>&1
exit $?
;;
validate)
g++ -fsyntax-only -std=${STD} "$@" "$input" > /dev/null
exit $?
g++ -fsyntax-only -std=${STD} "$@" "$input" > /dev/null
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
15 changes: 10 additions & 5 deletions misc/validators/gfortran-common.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# gfortran-common.sh - common code used in validator-fortran*
#
# Copyright (c) 2024, Masatake YAMATO
Expand All @@ -24,11 +25,15 @@ shift 2

case "$action" in
is_runnable)
type gfortran > /dev/null 2>&1
exit $?
command -v gfortran > /dev/null 2>&1
exit $?
;;
validate)
gfortran -fsyntax-only "$@" "$input" > /dev/null
exit $?
gfortran -fsyntax-only "$@" "$input" > /dev/null
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
15 changes: 10 additions & 5 deletions misc/validators/tsc-common.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# tsc-common.sh - common code used in validator-tsc*
#
# Copyright (c) 2026, Masatake YAMATO
Expand All @@ -25,11 +26,15 @@ shift 3

case "$action" in
is_runnable)
type tsc > /dev/null 2>&1
exit $?
command -v tsc > /dev/null 2>&1
exit $?
;;
validate)
tsc --noEmit "$input" --target $TARGET > /dev/null
exit $?
tsc --noEmit "$input" --target $TARGET > /dev/null
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
9 changes: 7 additions & 2 deletions misc/validators/validator-c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# validator-c --- validating C input files
#
# Copyright (c) 2022, Masatake YAMATO
Expand All @@ -22,11 +23,15 @@ input=$2

case "$action" in
is_runnable)
type gcc > /dev/null 2>&1
command -v gcc > /dev/null 2>&1
exit $?
;;
validate)
gcc -fsyntax-only "$input" > /dev/null
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
3 changes: 2 additions & 1 deletion misc/validators/validator-cxx03
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
source $3/g++-common.sh $1 $2 c++03
#!/bin/sh
. "$3"/g++-common.sh "$1" "$2" c++03
3 changes: 2 additions & 1 deletion misc/validators/validator-cxx11
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
source $3/g++-common.sh $1 $2 c++11
#!/bin/sh
. "$3"/g++-common.sh "$1" "$2" c++11
3 changes: 2 additions & 1 deletion misc/validators/validator-cxx17
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
source $3/g++-common.sh $1 $2 c++17
#!/bin/sh
. "$3"/g++-common.sh "$1" "$2" c++17
3 changes: 2 additions & 1 deletion misc/validators/validator-cxx20+module
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
source $3/g++-common.sh $1 $2 c++20 -fmodules-ts -c
#!/bin/sh
. "$3"/g++-common.sh "$1" "$2" c++20 -fmodules-ts -c
3 changes: 2 additions & 1 deletion misc/validators/validator-fortran+dollar-ok
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
source $3/gfortran-common.sh $1 $2 -fdollar-ok
#!/bin/sh
. "$3"/gfortran-common.sh "$1" "$2" -fdollar-ok
11 changes: 8 additions & 3 deletions misc/validators/validator-gnat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# validator-gnat --- validating Ada input files
#
# Copyright (c) 2025, Masatake YAMATO
Expand All @@ -22,11 +23,15 @@ input=$2

case "$action" in
is_runnable)
type gnat > /dev/null 2>&1
command -v gnat > /dev/null 2>&1
exit $?
;;
validate)
gnat compile -gnats "$input" >& /dev/null
gnat compile -gnats "$input" > /dev/null 2>&1
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
37 changes: 37 additions & 0 deletions misc/validators/validator-go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh
#
# validator-go - validating go input files with go command
#
# Copyright (c) 2026, Masatake YAMATO
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
action=$1
input=$2
case "$action" in
is_runnable)
command -v go > /dev/null 2>&1
exit $?
;;
validate)
go build -o /dev/null "$input"
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
9 changes: 7 additions & 2 deletions misc/validators/validator-jq
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# validator-jq - validating json input files
#
# Copyright (c) 2018, Red Hat, Inc.
Expand Down Expand Up @@ -32,11 +33,15 @@ action=$1
input=$2
case "$action" in
is_runnable)
type jq > /dev/null 2>&1
command -v jq > /dev/null 2>&1
exit $?
;;
validate)
jq . "$input" > /dev/null
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
9 changes: 7 additions & 2 deletions misc/validators/validator-node
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# validator-node - validating JavaScript input files with node
#
# Copyright (c) 2022, Masatake YAMATO
Expand All @@ -22,11 +23,15 @@ action=$1
input=$2
case "$action" in
is_runnable)
type node > /dev/null 2>&1
command -v node > /dev/null 2>&1
exit $?
;;
validate)
node --check "$input" > /dev/null
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
9 changes: 7 additions & 2 deletions misc/validators/validator-puppet
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# validator-puppet - validating puppetManifest input files
#
# Copyright (c) 2018, Hakan Baba
Expand Down Expand Up @@ -50,11 +51,15 @@ action=$1
input=$2
case "$action" in
is_runnable)
type puppet > /dev/null 2>&1
command -v puppet > /dev/null 2>&1
exit $?
;;
validate)
puppet apply --noop "$input" > /dev/null
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
15 changes: 10 additions & 5 deletions misc/validators/validator-python
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# validator-python --- validating Python input files
#
# Copyright (c) 2025, Masatake YAMATO
Expand All @@ -23,16 +24,20 @@ input=$2

case "$action" in
is_runnable)
type ${PYTHON} > /dev/null 2>&1
command -v "${PYTHON}" > /dev/null 2>&1
exit $?
;;
validate)
${PYTHON} -m py_compile "$input"
"${PYTHON}" -m py_compile "$input"
s=$?
d=$(dirname "$input")
b=$(basename "$input" .py)
rm $d/__pycache__/$b*pyc
rmdir $d/__pycache__
rm "$d"/__pycache__/"$b"*pyc
rmdir "$d"/__pycache__
exit $s
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
9 changes: 7 additions & 2 deletions misc/validators/validator-ruby
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- sh -*-
#!/bin/sh
#
# validator-ruby - validating Ruby input files with ruby
#
# Copyright (c) 2022 Masatake YAMATO
Expand All @@ -22,11 +23,15 @@ action=$1
input=$2
case "$action" in
is_runnable)
type ruby > /dev/null 2>&1
command -v ruby > /dev/null 2>&1
exit $?
;;
validate)
ruby -c "$input" > /dev/null
exit $?
;;
*)
echo "$0: unknown action: $action" >&2
exit 1
;;
esac
Loading
Loading