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

[WIP] #677 Ternary Expression Implementation #794

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Alexius-Huang
Copy link
Member

@Alexius-Huang Alexius-Huang commented Oct 20, 2019

I'm trying.

Issue #677

@@ -165,6 +165,14 @@ func (ti *TestableIdentifier) ShouldHaveName(expectedName string) {
}
}

// TestableTernaryExpression

Choose a reason for hiding this comment

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

comment on exported type TestableTernaryExpression should be of the form "TestableTernaryExpression ..." (with optional leading article)

compiler/ast/expressions.go Show resolved Hide resolved
@@ -262,6 +262,29 @@ func (n *NilExpression) String() string {
return "nil"
}

type TernaryExpression struct {

Choose a reason for hiding this comment

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

exported type TernaryExpression should have comment or be unexported

@@ -165,6 +165,14 @@ func (ti *TestableIdentifier) ShouldHaveName(expectedName string) {
}
}

// TestableTernaryExpression

Choose a reason for hiding this comment

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

comment on exported type TestableTernaryExpression should be of the form "TestableTernaryExpression ..." (with optional leading article)

}

func (te *TernaryExpression) expressionNode() {}
func (te *TernaryExpression) TokenLiteral() string {

Choose a reason for hiding this comment

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

exported method TernaryExpression.TokenLiteral should have comment or be unexported

compiler/ast/expressions.go Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 20, 2019

Codecov Report

Merging #794 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #794      +/-   ##
==========================================
+ Coverage    80.3%   80.32%   +0.02%     
==========================================
  Files          54       54              
  Lines        7417     7417              
==========================================
+ Hits         5956     5958       +2     
+ Misses       1234     1233       -1     
+ Partials      227      226       -1
Impacted Files Coverage Δ
compiler/parser/parser.go 94.07% <ø> (ø) ⬆️
compiler/token/token.go 100% <ø> (ø) ⬆️
compiler/parser/expression_parsing.go 70% <ø> (ø) ⬆️
compiler/lexer/lexer.go 95.6% <100%> (+0.73%) ⬆️

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 7ae1131...0c8c71e. Read the comment docs.

@st0012
Copy link
Member

st0012 commented Oct 23, 2019

👍 Although I seldom find ternary expression useful (too hard to find 3 expressions all simple and short enough to put into the same line). I'm quite curious about what the implementation would be.

@st0012 st0012 added this to the version 0.1.12 milestone Oct 23, 2019
@st0012
Copy link
Member

st0012 commented Feb 14, 2020

@Maxwell-Alexius any update on this?

@st0012 st0012 modified the milestones: version 0.1.12, version 0.2.0 Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants