Skip to content

Commit

Permalink
WIP WIP WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Dec 10, 2024
1 parent 9e8acd6 commit 86435f4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"test:typeSystem": "mocha --parallel -r ts-node/register/transpile-only test/typeSystem*.test.ts",
"test:wtest": "mocha --delay -t 10000 -r ts-node/register/transpile-only test/wtest.ts",
"test:printer": "mocha --parallel -r ts-node/register/transpile-only test/printer.test.ts",
"test:parser": "mocha --parallel -r ts-node/register/transpile-only test/parser.test.ts",
"test:parser": "mocha -r ts-node/register/transpile-only test/parser.test.ts",
"lint:fix": "eslint . --fix",
"validate:wollokVersion": "ts-node scripts/validateWollokVersion.ts",
"prepublishOnly": "npm run validate:wollokVersion && npm run build && npm test",
Expand Down
37 changes: 37 additions & 0 deletions test/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,43 @@ describe('Wollok parser', () => {
.and.be.tracedTo(0, 124)
})

it.only('ESTE ES EL QUE ROMPE multiline comments before many members with body expressions', () => {
`
class String {
/**
* comment
*/
method words() = 2
/**
* another comment
*/
method capitalize() {
return 1
}
}`.should.be.parsedBy(parser).into(new Class({
name: 'String',
metadata: [],
members: [
new Method({
name: 'words',
body: new Body({ sentences: [new Return({ value: new Literal({ value: 2 }) })] }),
metadata: [
new Annotation('comment', { text: '/**\n * comment\n */', position: 'start' }),
],
}),
new Method({
name: 'capitalize',
body: new Body({ sentences: [new Return({ value: new Literal({ value: 1 }) })] }),
metadata: [
new Annotation('comment', { text: '/**\n * another comment\n */', position: 'start' }),
],
}),
],
}))
//.and.be.tracedTo(0, 233)
})

it('comments with block closures', () => {
`class c {
//some comment
Expand Down

0 comments on commit 86435f4

Please sign in to comment.