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

Update struct creation #81

Closed
CarlCui opened this issue Jan 25, 2021 · 0 comments · Fixed by #82
Closed

Update struct creation #81

CarlCui opened this issue Jan 25, 2021 · 0 comments · Fixed by #82
Labels

Comments

@CarlCui
Copy link
Owner

CarlCui commented Jan 25, 2021

Before:

[]*token.Token{
    &token.Token{TokenType: token.IF},
    &token.Token{TokenType: token.LEFT_PAREN}
}

// And

cur.Locator := locator.IndexLocation{scanner.pos}

Now:

[]*token.Token{
    {TokenType: token.IF}, // redundant type
    {TokenType: token.LEFT_PAREN}
}

cur.Locator := locator.IndexLocation{Index: scanner.pos} // disallow unnamed fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant