Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion common/corpus/declarations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,10 @@ abstract class Animal {
}
}

@bar
abstract class Foo {
}

---

(program
Expand Down Expand Up @@ -782,7 +786,11 @@ abstract class Animal {
function: (member_expression
object: (identifier)
property: (property_identifier))
arguments: (arguments (string)))))))))
arguments: (arguments (string))))))))
(abstract_class_declaration
decorator: (decorator (identifier))
name: (type_identifier)
body: (class_body)))

==================================
Index type queries
Expand Down
1 change: 1 addition & 0 deletions common/define-grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ module.exports = function defineGrammar(dialect) {
),

abstract_class_declaration: $ => seq(
repeat(field('decorator', $.decorator)),
'abstract',
'class',
field('name', $._type_identifier),
Expand Down
11 changes: 11 additions & 0 deletions typescript/src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -6985,6 +6985,17 @@
"abstract_class_declaration": {
"type": "SEQ",
"members": [
{
"type": "REPEAT",
"content": {
"type": "FIELD",
"name": "decorator",
"content": {
"type": "SYMBOL",
"name": "decorator"
}
}
},
{
"type": "STRING",
"value": "abstract"
Expand Down
10 changes: 10 additions & 0 deletions typescript/src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,16 @@
}
]
},
"decorator": {
"multiple": true,
"required": false,
"types": [
{
"type": "decorator",
"named": true
}
]
},
"name": {
"multiple": false,
"required": true,
Expand Down
Loading