Skip to content
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

Merged
merged 3 commits into from
Dec 13, 2024
Merged

Fix parser multiline comment #321

merged 3 commits into from
Dec 13, 2024

Conversation

PalumboN
Copy link
Contributor

@PalumboN PalumboN commented Dec 10, 2024

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

fdodino and others added 2 commits December 10, 2024 18:22
- after message sends
- sanitizeWhitespaces
@PalumboN PalumboN requested review from ivojawer and fdodino December 10, 2024 23:18
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.69%. Comparing base (75e485e) to head (bfcb3c4).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@fdodino fdodino left a 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",
Copy link
Contributor

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

Copy link
Contributor Author

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 o unit que haga mocha -r ts-node/register/transpile-only test/**/*.ts para que corra todo sin importar

Ahora ya tenemos todo esto, pero no está bien organizado.

Copy link
Contributor Author

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

Copy link
Contributor

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'))
Copy link
Contributor

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', () => {
Copy link
Contributor

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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qué beio!!!

@fdodino fdodino merged commit e9f6aa4 into master Dec 13, 2024
3 of 4 checks passed
@fdodino fdodino deleted the fix-parser-multiline-comment branch December 13, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WollokDoc "Documentation not found" on several game methods.
2 participants