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

Implicit ';' when known form context #54

Closed
jquorning opened this issue Aug 9, 2020 · 4 comments
Closed

Implicit ';' when known form context #54

jquorning opened this issue Aug 9, 2020 · 4 comments
Assignees
Labels

Comments

@jquorning
Copy link

jquorning commented Aug 9, 2020

Proposal

Make semicolon (';') optional in cases when statement end is known by program text context.
Lets make semicolon optional when not needed anyway..

Example

procedure semicolon is
   i, n : natural
   c : constant positive := 123

   function func (p : integer) return integer
   function func (p : integer) return integer is
   begin
       return p + 5 + c
   end

begin
   null                  -- comment
   n := 3  ; n := c + 5 -- semicolon needed
   i := func (n)
end semicolon

Parser outputs

Outputs from GNAT compiler:

semicolon.adb:2:17: missing ";"
semicolon.adb:3:31: missing ";"
semicolon.adb:5:45: missing ";"
semicolon.adb:8:22: missing ";"
semicolon.adb:9:06: missing ";"
semicolon.adb:12:08: missing ";"
semicolon.adb:13:24: missing ";"
semicolon.adb:14:17: missing ";"
semicolon.adb:15:14: missing ";"

This indicates that the semicolon is redundant in many if not most cases.

Rationale

The semicolon (';') was introduced to help the parser.

Implementation

This proposal is expected to be easy to implement in the compiler parser.

@raph-amiard
Copy link
Member

Hi @jquorning , thank you for your interest!

However, you should supply more information on your issues, so that we can at least understand what you are proposing. Could you please fill the description with a small explanation of the problem and potential solution ?

Thanks in advance.

@jquorning
Copy link
Author

@raph-amiard ,
Thank You for your suggestions. I hope the newest brushup will clarify the proposal.. :-)

@raph-amiard
Copy link
Member

@jquorning much better indeed! Thanks 🙂

@raph-amiard raph-amiard self-assigned this Jan 12, 2021
@raph-amiard
Copy link
Member

Hi @jquorning,

This looks like this is out of the scope of what we want to accomplish, and more in the scope of a more in-depth syntax revisit of Ada, so we'll be closing this.

Kind regards

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

No branches or pull requests

3 participants