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

parser: cmd style check tuple to list #1315

Merged
merged 8 commits into from Jul 4, 2022
Merged

parser: cmd style check tuple to list #1315

merged 8 commits into from Jul 4, 2022

Conversation

visualfc
Copy link
Member

@visualfc visualfc commented Jul 3, 2022

println (1,2)

@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2022

Codecov Report

Merging #1315 (d6c877e) into main (e0f975b) will increase coverage by 0.01%.
The diff coverage is 93.61%.

@@            Coverage Diff             @@
##             main    #1315      +/-   ##
==========================================
+ Coverage   90.88%   90.89%   +0.01%     
==========================================
  Files          22       22              
  Lines        8482     8503      +21     
==========================================
+ Hits         7709     7729      +20     
- Misses        623      624       +1     
  Partials      150      150              
Impacted Files Coverage Δ
parser/parser.go 88.57% <93.61%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0f975b...d6c877e. Read the comment docs.

parser/parser.go Outdated Show resolved Hide resolved
parser/parser.go Outdated Show resolved Hide resolved
@visualfc visualfc marked this pull request as ready for review July 3, 2022 14:00
for p.tok != endTok && p.tok != token.EOF && !ellipsis.IsValid() {
list = append(list, p.parseRHSOrType()) // builtins may expect a type: make(some type, ...)
expr := p.parseRHSOrType(isCmd && len(list) == 0)
if tuple, ok := expr.(*tupleExpr); ok {
Copy link
Member

Choose a reason for hiding this comment

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

Parsing

println (1, 2)*2

should return an error.

So, we should check if this statement is ended or not.

parser/parser.go Outdated Show resolved Hide resolved
parser/parser.go Outdated Show resolved Hide resolved
parser/parser.go Outdated Show resolved Hide resolved
parser/parser.go Outdated Show resolved Hide resolved
@xushiwei xushiwei merged commit 94eb724 into goplus:main Jul 4, 2022
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

3 participants