      */
     public static func read(_ sexpr:String) -> SExpr{
         
-        struct ParseError: Error {
-            var message: String
-        }
-        
-        func appendTo(list: SExpr?, node:SExpr) -> SExpr {
-            var list = list
-            
-            if list != nil, case var .List(elements) = list! {
-                elements.append(node)
-                list = .List(elements)
-            }else{
-                list = node
-            }
-            return list!
-        }
-        
         enum Token{
             case pOpen,pClose,textBlock(String)
         }

        
        let tokens = tokenize(sexpr)
        let res = parse(tokens)
        return res.1 ?? .List([])
    }
}


            return res
        }
        
        struct ParseError: Error {
            var message: String
        }
        
        func appendTo(list: SExpr?, node:SExpr) -> SExpr {
            var list = list
            
            if list != nil, case var .List(elements) = list! {
                elements.append(node)
                list = .List(elements)
            }else{
                list = node
            }
            return list!
        }
        
        /**
         Parses a series of tokens to obtain a hierachical S-Expression
         
