Skip to content

Commit c1a3ec3

Browse files
committed
Also add test for const comma declarations
1 parent e152aa5 commit c1a3ec3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

tygo/fixtures_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ func parseMarkdownFixtures(fileContents []byte) ([]MarkdownFixture, error) {
7878
}
7979

8080
return fixtures, nil
81-
8281
}
8382

8483
// Tests all markdown files in `testdata/fixtures/` directory.

tygo/package_generator.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ func (g *PackageGenerator) generateFile(s *strings.Builder, file *ast.File, file
1212

1313
ast.Inspect(file, func(n ast.Node) bool {
1414
switch x := n.(type) {
15-
1615
// GenDecl can be an import, type, var, or const expression
1716
case *ast.GenDecl:
1817
if x.Tok == token.IMPORT {

tygo/testdata/fixtures/simple.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ type B struct {
110110
// A comment above the fields separated by a comma
111111
Foo, Bar, baz string
112112
}
113+
114+
113115
```
114116
```ts
115117
export interface A {
@@ -126,4 +128,12 @@ export interface B {
126128
*/
127129
Bar: string;
128130
}
131+
```
132+
133+
```go
134+
const Pi, E = 3.14, 2.71 // A comment on constants separated by a comma
135+
```
136+
```ts
137+
export const Pi = 3.14; // A comment on constants separated by a comma
138+
export const E = 2.71; // A comment on constants separated by a comma
129139
```

0 commit comments

Comments
 (0)