-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix parser multiline comment #321
Conversation
- after message sends - sanitizeWhitespaces
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #321 +/- ##
==========================================
- Coverage 89.75% 89.69% -0.06%
==========================================
Files 28 28
Lines 3181 3183 +2
Branches 578 579 +1
==========================================
Hits 2855 2855
- Misses 170 172 +2
Partials 156 156 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je suis totalement heureux d'avoir un ami comme vous (espero no cometer demasiadas faltas de ortografía)
@@ -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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esto quedó sin el parallel, ups
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creo que no importa, porque no se llama cuando se corren todos los tests.
De hecho, yo propongo tener:
- todos los tests particulares (parser, printer, etc) sin el
parallel
- tener un
all
ounit
que hagamocha -r ts-node/register/transpile-only test/**/*.ts
para que corra todo sin importar
Ahora ya tenemos todo esto, pero no está bien organizado.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh ahí me fijé y ya está así el unit. Solamente hay cosas de más en el script de npm test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no entendí muy bien, pero me parece que el parallel tiene sentido si querés correr solo los tests del parser
|
||
const comment = (position: 'start' | 'end' | 'inner') => lazy('comment', () => regex(/\/\*(.|[\r\n])*?\*\/|\/\/.*/)).map(text => new Annotation('comment', { text, position })) | ||
const sameLineComment: Parser<Annotation> = comment('end') | ||
const sameLineComment: Parser<Annotation> = spaces.then(comment('end')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magia pura acá, por suerte mientras lo paireamos lo ibas explicando
@@ -234,6 +238,45 @@ describe('Wollok parser', () => { | |||
.and.be.tracedTo(0, 124) | |||
}) | |||
|
|||
it('comments before many members with body expressions with send', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏼 👏🏼 👏🏼
@@ -1277,6 +1277,25 @@ describe('Wollok Printer', () => { | |||
self.println(a + b) | |||
}`) | |||
}) | |||
|
|||
it('testSimpleProgramWithSpacesBetweenSends', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qué beio!!!
Se arreglan los comentarios después de envío de mensajes.
Eso hizo saltar la ficha de que la función
sanitizeWhitespaces
tenía un par de casos borders que faltaban.Lo arreglamos pero @fdodino sugería tener un función que calcule la line y la column a partir del offset:
coordinates(input, offset) -> { from, to }
Esto arregla el issue de nuestro querido amigo @isaiaslafon
Fix uqbar-project/website-wollok-ts#53