Strumenta / StarLasu

A collection of libraries to work with languages from Java, Kotlin, Python, Javascript, and Typescript
34 stars 2 forks source link

CodeProcessingResult package #27

Closed alessiostalla closed 1 year ago

alessiostalla commented 1 year ago

Currently, CodeProcessingResult – the base class of ParsingResult and LexingResult – lies in the "parsing" package.

This originated in Kolasu and it was ported into Tylasu.

However, in Tylasu we may want to model a "parser facade" that calls another StarLasu parser over the network (e.g. to avoid having a TypeScript version of the parser running in the browser). So it makes sense to have a "minimal return type" and minimal API for such a parser, and CodeProcessingResult fits the bill. Unfortunately, we can't use it without dragging the whole "parsing" subsystem and in turn its dependency on ANTLR even if we won't be using ANTLR.

So I propose moving CodeProcessingResult to another package, that has no dependencies on ANTLR. Or, alternatively, to leave it in the "parsing" package but move all the ANTLR-related stuff to a specific subpackage, such as "parsing.antlr".

I'm opening this here because it involves at least Kolasu and Tylasu and I'd like implement the same change on all platforms to avoid diverging.

ftomassetti commented 1 year ago

I agree, and this is connected to making the core package independent from ANTLR

alessiostalla commented 1 year ago

Actually, given the reorganization in Kolasu 1.6, this issue remains relevant only for Tylasu. So, I'll close this one and open one in Tylasu, to mirror/mimic the changes in Kolasu.