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 for issue #457 #462

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

marvinvo
Copy link

@marvinvo marvinvo commented Jan 22, 2022

Description

The built-in methods (alg, mode, padding, and so on) do not work in the REQUIRES section. For example, in the Cipher rule, we have generatedkey[key, alg(transformation)], but the alg does not function and it is interpreted as generatedkey[key, transformation].

Fix

The previous parsing code was actually a dublicate of the getPredicate() method, but it had no check for the “consPred” field, in which ‘alg(’, ‘mode(’ and ‘pad(’ is defined. Hence I just reuse the correctly working getPredicate() method at this place.

More background:
As you can also see in the crysl gramma, "pred" field in non-terminal "PredLit"("innerPred.getPred()" in Java code) is defined as a normal predicate and hence it can be simply interpreted like any other predicate too.
https://github.com/CROSSINGTUD/CryptSL/blob/25dc97eebdfd30989c312d28dc79a50fb4cc1209/de.darmstadt.tu.crossing.CrySL/src/de/darmstadt/tu/crossing/CrySL.xtext#L245

Fixes #457

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

  • Eclipse Version:
  • Java Version:
  • OS:

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

The previous parsing code was actually a dublicate of the getPredicate() method, but it had no check for the “consPred” field, in which ‘alg(’, ‘mode(’ and ‘pad(’ is defined.
@marvinvo marvinvo closed this Mar 5, 2022
@marvinvo marvinvo reopened this Mar 5, 2022
@marvinvo marvinvo closed this Jun 20, 2022
@marvinvo marvinvo reopened this Jun 20, 2022
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.

Built-in methods do not work in predicates of REQUIRES section
1 participant