Commit 99bf8316 authored by Hugo Moreau's avatar Hugo Moreau
Browse files

Checktype alphanumeric sort

After a little review, for a better understunding, we decided
to sort every case alphanumericly.
parent c42ac8bb
......@@ -9,17 +9,17 @@ import (
/*
The TypeChecker triggers errors for uses of :
- Non-integer variable
- Channel
- Struct
- Array
- Slice
- Panic
- Pointer
- Channel
- Interface
- Map
- Switch
- Non-integer variable
- Panic
- Pointer
- Select
- Slice
- Struct
- Switch
*/
type TypeChecker struct {
......@@ -43,37 +43,37 @@ func (t *TypeChecker) Pre(meta *Meta, v *Visitor) bool {
os.Exit(1)
}
}
case *ast.StarExpr:
fmt.Println("Pointers are not supported.")
os.Exit(1)
case *ast.UnaryExpr:
fmt.Println("Pointers are not supported.")
os.Exit(1)
case *ast.SliceExpr:
fmt.Println("Slices are not supported.")
os.Exit(1)
case *ast.InterfaceType:
fmt.Println("Interfaces are not supported.")
case *ast.ChanType:
fmt.Println("Channels are not supported.")
os.Exit(1)
case *ast.Ident:
if node.Name == "panic" {
fmt.Println("Panics are not supported.")
os.Exit(1)
}
case *ast.InterfaceType:
fmt.Println("Interfaces are not supported.")
os.Exit(1)
case *ast.MapType:
fmt.Println("Maps are not supported.")
os.Exit(1)
case *ast.SelectorExpr:
fmt.Println("Select are not supported.")
os.Exit(1)
case *ast.SliceExpr:
fmt.Println("Slices are not supported.")
os.Exit(1)
case *ast.StarExpr:
fmt.Println("Pointers are not supported.")
os.Exit(1)
case *ast.StructType:
fmt.Println("Structs are not supported.")
os.Exit(1)
case *ast.ChanType:
fmt.Println("Channels are not supported.")
os.Exit(1)
case *ast.SwitchStmt:
fmt.Println("Switch are not supported.")
os.Exit(1)
case *ast.SelectorExpr:
fmt.Println("Select are not supported.")
case *ast.UnaryExpr:
fmt.Println("Pointers are not supported.")
os.Exit(1)
}
return true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment