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

Disable adjust line when emitting System Function #636

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

nananapo
Copy link
Contributor

@nananapo nananapo commented Apr 9, 2024

issue

module test () {
    initial {

        $display("Hello World!");
    }
}

this code was translated into

module test_test ();
    initial begin
        $
        display("Hello World!");
    end
endmodule

what this PR changed

This bug is caused by adjusting line when emitting identifier after $.

SymbolKind::SystemFunction => {
self.str("$");
self.identifier(&args[0]);
}

fn push_token(&mut self, x: &Token) {
if self.adjust_line && x.line > self.line + 1 {
self.newline();
}
self.adjust_line = false;

So I changed adjust_line to false when emitting system function.

Signed-off-by: Kanata Abe <kanapo.go@gmail.com>
@dalance
Copy link
Collaborator

dalance commented Apr 10, 2024

Thank you for your contribution!
I'll merge this PR.

@dalance dalance merged commit 12de79d into veryl-lang:master Apr 10, 2024
6 checks passed
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.

None yet

2 participants