Этот коммит содержится в:
andygeiss 2018-06-18 19:26:13 +02:00
родитель eb79c94690
коммит d1d076bdc4
3 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -33,6 +33,7 @@ var (
"timer.Delay": "delay", "timer.Delay": "delay",
"wifi": "WiFi", "wifi": "WiFi",
"wifi.Client": "WiFiClient", "wifi.Client": "WiFiClient",
"client.Connect": "client.connect",
"wifi.Begin": "WiFi.begin", "wifi.Begin": "WiFi.begin",
"wifi.BeginEncrypted": "WiFi.begin", "wifi.BeginEncrypted": "WiFi.begin",
"wifi.BSSID": "WiFi.BSSID", "wifi.BSSID": "WiFi.BSSID",

Просмотреть файл

@ -8,6 +8,7 @@ import (
"go/token" "go/token"
"io" "io"
"strings" "strings"
"os"
) )
const ( const (
@ -74,7 +75,7 @@ func (w *Worker) Start() error {
} }
} }
// Print the AST. // Print the AST.
// ast.Fprint(os.Stderr, fset, file, nil) ast.Fprint(os.Stderr, fset, file, nil)
return nil return nil
} }
@ -152,12 +153,20 @@ func handleExpr(expr ast.Expr) string {
code += handleCallExpr(e) code += handleCallExpr(e)
case *ast.Ident: case *ast.Ident:
code += handleIdent(e) code += handleIdent(e)
case *ast.ParenExpr:
code += handleParenExpr(e)
case *ast.SelectorExpr: case *ast.SelectorExpr:
code += handleSelectorExpr(e) code += handleSelectorExpr(e)
} }
return code return code
} }
func handleParenExpr (stmt *ast.ParenExpr) string {
code := ""
code += handleExpr(stmt.X)
return code
}
func handleExprStmt(stmt *ast.ExprStmt) string { func handleExprStmt(stmt *ast.ExprStmt) string {
code := "" code := ""
switch x := stmt.X.(type) { switch x := stmt.X.(type) {

Просмотреть файл

@ -471,7 +471,7 @@ func Test_WiFiWebClient(t *testing.T) {
Serial.print("Connecting to"); Serial.print("Connecting to");
Serial.println(host); Serial.println(host);
Serial.print(" ..."); Serial.print(" ...");
if(){ if(client.connect(host, 443){
Serial.println(" Connected!"); Serial.println(" Connected!");
} else { } else {
Serial.println(" Failed!"); Serial.println(" Failed!");