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

new structure for checks #86

Open
florianschanda opened this issue Jun 5, 2024 · 0 comments
Open

new structure for checks #86

florianschanda opened this issue Jun 5, 2024 · 0 comments
Labels
large topic: core Affects lexer/parser/infrastructure topic: LRM Affects the Language Reference Manual

Comments

@florianschanda
Copy link
Collaborator

florianschanda commented Jun 5, 2024

Having written several complex checks, its clear to me that the existing format is too simple, quickly resulting in repeated constructs.

I suggest a new form:

type T {

  a Integer
  b Integer
  c String
  d Integer [1 .. *]

  begin checks

    if a > b then
	   assert c == "gt", "blah"
	elif a < b then
	   assert c == "lt", "blah"
	else
	   assert c == "eq", "blah"
	end if

	let tmp = a + b

	forall item in d loop
	   assert d >= tmp, "blah"
        end loop

  end checks

}

For a more detailed proposal see https://github.com/florianschanda/trlc/blob/main/language-reference-manual/proposal-checks.md

@florianschanda florianschanda added topic: LRM Affects the Language Reference Manual topic: core Affects lexer/parser/infrastructure large labels Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large topic: core Affects lexer/parser/infrastructure topic: LRM Affects the Language Reference Manual
Projects
None yet
Development

No branches or pull requests

1 participant