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

Add validation error when a variable is not found in current block #41

Open
tpluscode opened this issue Jul 22, 2019 · 2 comments
Open
Labels
Core ⚛️ Related to core grammar

Comments

@tpluscode
Copy link
Member

With Class "http://localhost:5678/api#Installation" {
    Expect Operation "http://localhost:5678/api#InstallOperation" {
        Invoke {
            Expect Status 201
            Expect Header Location [entrypoint]

            Follow [entry]
        }
    }
}

In the snippet above the variable entry used does not match the entrypoint being "declared". It should be validated and an error shown guarding against such errors

@tpluscode tpluscode added the Core ⚛️ Related to core grammar label Jul 22, 2019
@tpluscode
Copy link
Member Author

@mchlrch instead of using a validator, is it possible to declaratively construct language so that it's only possible to reference variables within a block and no other variables are suggested?

@mchlrch
Copy link
Collaborator

mchlrch commented Jul 23, 2019

For this case, it's best to adjust the scoping. The linker as well as proposals (code-assist) respect the scoping, so only elements in scope can be referenced.

I did this in the mapping-dsl as well, to scope the columns of a table that are eligible for the mapping
image

Implementation:
https://github.com/zazuko/rdf-mapping-dsl/blob/master/com.zazuko.rdfmapping.dsl.parent/com.zazuko.rdfmapping.dsl/src/com/zazuko/rdfmapping/dsl/scoping/RdfMappingScopeProvider.xtend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core ⚛️ Related to core grammar
Projects
None yet
Development

No branches or pull requests

2 participants