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

Configurable language parsing #23

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Configurable language parsing #23

wants to merge 3 commits into from

Conversation

nikku
Copy link
Member

@nikku nikku commented Jun 18, 2024

Proposed Changes

This allows us to configure custom language parsing to be used. This way we can validate (using text validation) expression and unaryTests, but also provide custom context.

Related to camunda/camunda-modeler#3983

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@nikku nikku requested review from marstamm and barmac June 18, 2024 09:48
@nikku nikku changed the title Langage parsing Configurable language parsing Jun 18, 2024
@nikku
Copy link
Member Author

nikku commented Jun 18, 2024

I'd be interested in your feedback @barmac and @marstamm: What representation shall we use for context here? The low-level context required by lezer-feel or the higher level context (variables, built-ins) provided by feel-editor?

@marstamm
Copy link
Collaborator

I think that depends on how we want to use it. We use it in bpmnlint-plugin-camunda-compat, where we currently don't have any concept of available Context. Do we want to duplicate the built-ins in linting as well, similar to how we do it in the editor?

@barmac
Copy link
Member

barmac commented Jun 18, 2024

Some use cases I can see for this tool in DMN editor are:

  • detect usage of unavailable variables
  • type mismatch (e.g. variable has type number but function expects string)
  • function arguments mismatch (e.g. function expects 2 parameters but 3 were given)

To support this, the context should not assume that we can pass exact values.

@nikku
Copy link
Member Author

nikku commented Jun 19, 2024

Thanks for your feedback folks. What I get is the following:

  • We want to have a unified way to provide context, to feel-lint and feel-editor, not based on actual data, but based on the data model.
  • We shall consider to also adopt this format for lezer-feel, where it is equally needed. For example in lezer-feel you cannot type functions right now, but what you'd want to express (grammar wise) is function(arg1: type, args: type) : return_type.

@barmac barmac marked this pull request as draft June 25, 2024 13:35
@barmac
Copy link
Member

barmac commented Jun 25, 2024

I am making it a draft as it's still in progress.

misiekhardcore

This comment was marked as off-topic.

@misiekhardcore misiekhardcore dismissed their stale review October 29, 2024 08:20

Made on wrong PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants