             } else {
                 print("Tried to assign a value to the undeclared variable \(property)")
                 throw ExecErrors.AssignUndeclaredVariableError
+            }
+        } else if cmd.containsString("(") {
+            var components = cmd.componentsSeparatedByString("(")
+            let methodName = components[0]
+            if methods[methodName] != nil {
+                components.removeFirst()
+                var arg = components.joinWithSeparator("(")
+                let range = arg.rangeOfString(")", options: .BackwardsSearch)
+                if range == nil {
+                    print("Missing closing bracket ')'")
+                    throw ExecErrors.SyntaxError
+                }
+                arg.removeRange(range!.startIndex..<arg.endIndex)
+                return try methods[methodName]!(arg)
             }
         }
         return null

        properties["theme.description"] = null
        properties["theme.author"] = null
        properties["theme.version"] = null
        // MARK: parse
        var commands: [(Int, String)] = []
        for line in 0..<lines.count {

class BBT2 {
    let null:String? = nil
    
    let dir: String
    
    var methods: [String: ((String) throws -> String?)] = [:]
    var properties: [String: String?] = [:]
    var constants: [String: String?] = [:]
    
    init(dir: String, code: String) throws {
        self.dir = dir
        let lines = code.componentsSeparatedByString("\n")
        // MARK: default properties
        constants["_PLATFORM"] = "iOS"
