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

Streaming Operator detection #1692

Merged
merged 3 commits into from Aug 22, 2020

Conversation

vinamarora8
Copy link
Contributor

@vinamarora8 vinamarora8 commented Aug 22, 2020

This PR does 2 jobs:

  1. Fix Wrong indentation after SV streaming statement #1516
  2. Provide verilog-streaming-op-re, verilog-at-streaming-op-p for future use

The function is called `verilog-at-streaming-op-p`.
Also adds a check for streaming-op in `verilog-at-constraint-p`.
(Streaming operators mistaken as constraints otherwise)

This should fix veripool#1516
@vinamarora8 vinamarora8 changed the title Streaming op detect Streaming Operator detection Aug 22, 2020
Copy link
Member

@wsnyder wsnyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, glad to get these improvements.

Please add a test/ and test_ok/ file that checks the indentation of these.

Minor thing below.

Thanks

verilog-mode.el Outdated
))

(defun verilog-at-streaming-op-p ()
"If at the { of a streaming operator, return true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"If at the { of a streaming operator, return true"
"If at the { of a streaming operator, return t."

(M-x checkdoc will otherwise complain if no period.)

However I wonder if this function is worth bothering with - perhaps just inline the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do make it inline, we'll be putting code that checks if something is a streaming op or not, inside a function that itself checks if something is a constraint or not. Since constraints and streaming operators are not really related, this level of abstraction helps code readability by a significant amount, IMO.

Also, I believe this function is 'fundamental' enough, that we probably will end up using it at other places too.

The function is called `verilog-at-streaming-op-p`.
Also adds a check for streaming-op in `verilog-at-constraint-p`.
(Streaming operators mistaken as constraints otherwise)

This should fix veripool#1516
The particular test is taken from the issue
veripool#1516. The issue has now
been solved.
@veripoolbot
Copy link
Collaborator

Thanks much for working on this.

@veripoolbot veripoolbot merged commit e012785 into veripool:master Aug 22, 2020
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.

Wrong indentation after SV streaming statement
3 participants