Skip to content

Commit 876e82a

Browse files
authored
Merge pull request #4317 from masatake/typescript-static-property
Typescript: add property field to record static modifier
2 parents e9c5b48 + be2316d commit 876e82a

File tree

12 files changed

+98
-6
lines changed

12 files changed

+98
-6
lines changed

Tmain/list-fields-with-prefix.d/stdout-expected.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@ x UCTAGSxpath no NONE s-- no -- 0 xpath
5454
- UCTAGSparameter no SystemVerilog --b no -- 0 parameter whose value can be overridden.
5555
- UCTAGStarget yes Thrift s-- no -- 0 the target language specified at "namespace"
5656
- UCTAGSthrows yes Thrift s-- no -- 0 throws list of function
57+
- UCTAGSproperties no TypeScript s-- no -- 1 properties (static)
5758
- UCTAGSarchitecture yes VHDL s-- no -- 0 architecture designing the entity
5859
- UCTAGSparameter no Verilog --b no -- 0 parameter whose value can be overridden.

Tmain/list-fields.d/stdout-expected.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ z kind no NONE s-- no r- 0 [tags output] prepend "kind:" to k/ (or K/) field out
7272
- parameter no SystemVerilog --b no -- 0 parameter whose value can be overridden.
7373
- target yes Thrift s-- no -- 0 the target language specified at "namespace"
7474
- throws yes Thrift s-- no -- 0 throws list of function
75+
- properties no TypeScript s-- no -- 1 properties (static)
7576
- architecture yes VHDL s-- no -- 0 architecture designing the entity
7677
- parameter no Verilog --b no -- 0 parameter whose value can be overridden.
7778
#
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--sort=no
2+
--fields-TypeScript=+{properties}
3+
--fields=+{access}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
C input.ts /^class C {$/;" c
2+
a input.ts /^ a$/;" p class:C access:public
3+
b input.ts /^ protected b;$/;" p class:C access:protected
4+
c input.ts /^ c$/;" p class:C access:public
5+
d input.ts /^ static d;$/;" p class:C access:public properties:static
6+
e input.ts /^ e$/;" p class:C access:public
7+
f input.ts /^ protected static f;$/;" p class:C access:protected properties:static
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class C {
2+
a
3+
protected b;
4+
c
5+
static d;
6+
e
7+
protected static f;
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tsc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
--sort=no
22
--kinds-typescript=*
33
--fields=+i
4+
--fields-typescript=+{properties}

Units/parser-typescript.r/ts-class.d/expected.tags

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ temp input.ts /^ var temp = this.next;$/;" l method:List.insertAfter
2323
log input.ts /^ log() {$/;" m class:List
2424
C input.ts /^class C {$/;" c
2525
x input.ts /^ x: number;$/;" p class:C
26-
x input.ts /^ static x: string;$/;" p class:C
26+
x input.ts /^ static x: string;$/;" p class:C properties:static
2727
Messenger input.ts /^class Messenger {$/;" c
2828
message input.ts /^ message = "Hello World";$/;" p class:Messenger
2929
start input.ts /^ start() {$/;" m class:Messenger
@@ -38,12 +38,12 @@ constructor input.ts /^ constructor(public x: number, public y: number) { }$/;"
3838
x input.ts /^ constructor(public x: number, public y: number) { }$/;" p class:Point
3939
y input.ts /^ constructor(public x: number, public y: number) { }$/;" p class:Point
4040
length input.ts /^ public length() { return Math.sqrt(this.x * this.x + this.y * this.y); }$/;" m class:Point
41-
origin input.ts /^ static origin = new Point(0, 0);$/;" p class:Point
41+
origin input.ts /^ static origin = new Point(0, 0);$/;" p class:Point properties:static
4242
A input.ts /^class A {$/;" c
4343
x input.ts /^ private x: number;$/;" p class:A
4444
y input.ts /^ protected y: number;$/;" p class:A
4545
fun input.ts /^ public fun: (a: 22 | 30, b: CPoint) => number | string;$/;" p class:A
46-
f input.ts /^ static f(a: A, b: B) {$/;" m class:A
46+
f input.ts /^ static f(a: A, b: B) {$/;" m class:A properties:static
4747
a input.ts /^ static f(a: A, b: B) {$/;" z method:A.f
4848
b input.ts /^ static f(a: A, b: B) {$/;" z method:A.f
4949
getXAsT input.ts /^ getXAsT<T = any>(): T {$/;" m class:A

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
dnf -y install awk gcc automake autoconf pkgconfig make libseccomp-devel libxml2-devel jansson-devel libyaml-devel pcre2-devel findutils diffutils sudo
2525
dnf -y install jq puppet python3-sphinx
2626
# These are for input-validation.
27-
dnf -y install g++ jq puppet nodejs gcc-gfortran gcc-gnat
27+
dnf -y install g++ jq puppet nodejs gcc-gfortran gcc-gnat typescript
2828
# nodejs requires libsqlite.so.0 with sqlite-session feature
2929
# It was tured off in 3.46.1-1.
3030
dnf -y update sqlite-libs

misc/validators/validator-tsc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -*- sh -*-
2+
# validator-tsc - validating TypeScript input files with tsc
3+
#
4+
# Copyright (c) 2025, Masatake YAMATO
5+
#
6+
# This program is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU General Public License
8+
# as published by the Free Software Foundation; either version 2
9+
# of the License, or (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19+
# USA.
20+
#
21+
action=$1
22+
input=$2
23+
case "$action" in
24+
is_runnable)
25+
type tsc > /dev/null 2>&1
26+
exit $?
27+
;;
28+
validate)
29+
tsc --noEmit "$input" > /dev/null
30+
exit $?
31+
;;
32+
esac

0 commit comments

Comments
 (0)