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

Simplify attribute nesting #378

Open
n-osborne opened this issue Jan 22, 2024 · 0 comments
Open

Simplify attribute nesting #378

n-osborne opened this issue Jan 22, 2024 · 0 comments

Comments

@n-osborne
Copy link
Contributor

In the current state, specification of a gospel value or a gospel type are in an attribute of an attribute. But this is written with two successive special coments. Thus, the source preprocessor has to manipulate two successive tokens to make one attribute.

I propose to let go of the successive special comments and write the logical declaration and its optional specifications in one. As specification clauses begin with a keyword, this should be possible to parse.

Then, instead of

(*@ type t *)
(*@ ephemeral *)

(*@ function f (x : integer) : bool *)
(*@ ensures true *)

(*@ function g (x : integer) : integer = x + 2 *)
(*@ requires true *)

we would write

(*@ type t
    ephemeral *)

(*@ function f (x : integer) : bool
    ensures true *)

(*@ function g (x : integer) : integer = x + 2
    requires true *)

which will be turned by the source preprocessor in one floating attribute and then parsed by the gospel (attribute) parser into the corresponding items of the Uast.

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

No branches or pull requests

1 participant