Coder Social home page Coder Social logo

Comments (23)

lewis6991 avatar lewis6991 commented on May 20, 2024

Its because the begin and end are on the same line. Is there any reason you are writing the case statement in this style? The begin and end's are redundant.

from verilog_systemverilog.vim.

xguerin avatar xguerin commented on May 20, 2024

Yes, it actually makes register mapping a bit more readable. Another type of issue arises when I skip begin and end:

case (XfrState)
  One_XFR : XfrState_str = "One";
  Two_XFR : XfrState_str = "Two";
  End_XFR : XfrState_str = "End";
  default : XfrState_str = "N/A";
endcase

is formatted :

case (XfrState)
  One_XFR : XfrState_str = "One";
  Two_XFR : XfrState_str = "Two";
  End_XFR : XfrState_str = "End";
default : XfrState_str = "N/A";
endcase

or, within a process:

always @(XfrState)
  case (XfrState)
    One_XFR : XfrState_str = "One";
    Two_XFR : XfrState_str = "Two";
    End_XFR : XfrState_str = "End";
default : XfrState_str = "N/A";
  endcase
end

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

I'm still not convinced about the begin statement(); end style. Im my opinion it should be avoided and discouraged. An older version of the new script did support this style, however I removed this at the benefit of better performance. In the future I will review whether adding this back effects performance and If it doesn't I'll change it back.

The other issue on the other hand was a different problem because the script wasn't reliably case-sensitive. I've just pushed a fix. Thanks for raising this.

from verilog_systemverilog.vim.

xguerin avatar xguerin commented on May 20, 2024

I don't mind adapting the code. Thanks for looking into it.

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

@lewis6991 I am unable to replicate the second situation in my current master branch. You did not include the case-sensitive fix in the PR, correct?

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

That is correct.

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

The reason you cannot replicate is because you probably don't have set ignorecase in your vimrc.

Having this set changes the behaviour of the plugin. My commit for this was to change this option and restore it at the end of indenting.

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

Understood. Let me think about this for some a day or two.

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

The only other solution I can think of is to have \C in every regex which I think would be a bit of a pain.

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

That's not the problem.

Try the exact same test case as above, but replace "End" with "end". I'm almost 100% sure that it will be incorrectly indented even with you case-insensitive fix.

We need to filter out strings. Maybe by doing something like we're doing for comments: we just strip them out from the input before parsing?

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

Just submitted some more changes. Please check them.

Could you take a look at the "end" issue for me? I can't invest more time in this for today :)

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

Stripping out strings may be the best solution. I'm just a little worried about performance.

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

Feel free to assign to me. I'll check it out when I get some time.

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

I was trying to!!! For some reason you don't appear in the list!

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

Is it because it is your personal repo and not an organisation?

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

Let me try this: @lewis6991

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

Dumb me: https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/

"You can only create assignments for yourself, collaborators on personal projects, or members of your organization with read permissions on the repository."

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

Fixed in 7d83a3e

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

Nice! Thanks.

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

Hope you don't mind me making commits like this without PR'ing them.

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

I don't mind, but I don't think that's the best workflow.

Now that I have a collaborator I'm considering starting to PR my own commits, giving us the opportunity to review and discuss the changes before submitting. Hopefully, this will result in better and more feature complete code.

from verilog_systemverilog.vim.

lewis6991 avatar lewis6991 commented on May 20, 2024

I agree. I only pushed the commits today as I felt they were fairly trivial and small. I'll put future ones in a PR.

from verilog_systemverilog.vim.

vhda avatar vhda commented on May 20, 2024

Will do the same.

from verilog_systemverilog.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.