Last active
February 20, 2017 02:13
-
-
Save spiegel-im-spiegel/61aa7826ac040d1c2f838ab286fafa91 to your computer and use it in GitHub Desktop.
Go 言語の `++` や `--` は演算子ではない ref: http://qiita.com/spiegel-im-spiegel/items/2c6cf5ff44d816d1be7b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IncDecStmt = Expression ( "++" | "--" ) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
i := 1 | |
a := i++ | |
fmt.Println(a) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
i := 1 | |
i++ | |
a := i | |
fmt.Println(a) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
i := 1 | |
a := i | |
i++ | |
fmt.Println(a) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
i := 1 | |
a := i += 1 | |
fmt.Println(a) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expression = UnaryExpr | Expression binary_op Expression . | |
UnaryExpr = PrimaryExpr | unary_op UnaryExpr . | |
binary_op = "||" | "&&" | rel_op | add_op | mul_op . | |
rel_op = "==" | "!=" | "<" | "<=" | ">" | ">=" . | |
add_op = "+" | "-" | "|" | "^" . | |
mul_op = "*" | "/" | "%" | "<<" | ">>" | "&" | "&^" . | |
unary_op = "+" | "-" | "!" | "^" | "*" | "&" | "<-" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PrimaryExpr = | |
Operand | | |
Conversion | | |
PrimaryExpr Selector | | |
PrimaryExpr Index | | |
PrimaryExpr Slice | | |
PrimaryExpr TypeAssertion | | |
PrimaryExpr Arguments . | |
Selector = "." identifier . | |
Index = "[" Expression "]" . | |
Slice = "[" [ Expression ] ":" [ Expression ] "]" | | |
"[" [ Expression ] ":" Expression ":" Expression "]" . | |
TypeAssertion = "." "(" Type ")" . | |
Arguments = "(" [ ( ExpressionList | Type [ "," ExpressionList ] ) [ "..." ] [ "," ] ] ")" . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment