diff --git a/Atom.xcodeproj/project.pbxproj b/Atom.xcodeproj/project.pbxproj new file mode 100644 index 000000000..fcf6a9d18 --- /dev/null +++ b/Atom.xcodeproj/project.pbxproj @@ -0,0 +1,404 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 043D7E4C145794990078D710 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 043D7E4B145794990078D710 /* Cocoa.framework */; }; + 043D7E56145794990078D710 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 043D7E54145794990078D710 /* InfoPlist.strings */; }; + 043D7E58145794990078D710 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E57145794990078D710 /* main.m */; }; + 043D7E621457949A0078D710 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 043D7E601457949A0078D710 /* MainMenu.xib */; }; + 043D7E84145795B20078D710 /* BridgeSupportController.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E6D145795B20078D710 /* BridgeSupportController.m */; }; + 043D7E85145795B20078D710 /* JSCocoaController.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E70145795B20078D710 /* JSCocoaController.m */; }; + 043D7E86145795B20078D710 /* JSCocoaFFIArgument.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E72145795B20078D710 /* JSCocoaFFIArgument.m */; }; + 043D7E87145795B20078D710 /* JSCocoaFFIClosure.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E74145795B20078D710 /* JSCocoaFFIClosure.m */; }; + 043D7E88145795B20078D710 /* JSCocoaLib.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E76145795B20078D710 /* JSCocoaLib.m */; }; + 043D7E89145795B20078D710 /* JSCocoaPrivateObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E78145795B20078D710 /* JSCocoaPrivateObject.m */; }; + 043D7E8A145795B20078D710 /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E7B145795B20078D710 /* UKFileWatcher.m */; }; + 043D7E8B145795B20078D710 /* UKFNSubscribeFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E7D145795B20078D710 /* UKFNSubscribeFileWatcher.m */; }; + 043D7E8C145795B20078D710 /* UKKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E7F145795B20078D710 /* UKKQueue.m */; }; + 043D7E8D145795B20078D710 /* UKMainThreadProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E81145795B20078D710 /* UKMainThreadProxy.m */; }; + 043D7E8E145795B20078D710 /* AtomWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 043D7E83145795B20078D710 /* AtomWindow.xib */; }; + 043D7E94145795B70078D710 /* AtomApp.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E91145795B70078D710 /* AtomApp.m */; }; + 043D7E95145795B70078D710 /* AtomController.m in Sources */ = {isa = PBXBuildFile; fileRef = 043D7E93145795B70078D710 /* AtomController.m */; }; + 047F26021457978C006DC904 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 047F26011457978C006DC904 /* JavaScriptCore.framework */; }; + 047F260414579792006DC904 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 047F260314579792006DC904 /* WebKit.framework */; }; + 047F260E145883B9006DC904 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 047F260D145883B9006DC904 /* Icon.icns */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 043D7E47145794990078D710 /* Atom.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Atom.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 043D7E4B145794990078D710 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 043D7E4E145794990078D710 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 043D7E4F145794990078D710 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 043D7E50145794990078D710 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 043D7E53145794990078D710 /* Atom-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Atom-Info.plist"; sourceTree = ""; }; + 043D7E55145794990078D710 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 043D7E57145794990078D710 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 043D7E59145794990078D710 /* Atom-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Atom-Prefix.pch"; sourceTree = ""; }; + 043D7E611457949A0078D710 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; + 043D7E6C145795B20078D710 /* BridgeSupportController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgeSupportController.h; sourceTree = ""; }; + 043D7E6D145795B20078D710 /* BridgeSupportController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BridgeSupportController.m; sourceTree = ""; }; + 043D7E6E145795B20078D710 /* JSCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoa.h; sourceTree = ""; }; + 043D7E6F145795B20078D710 /* JSCocoaController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaController.h; sourceTree = ""; }; + 043D7E70145795B20078D710 /* JSCocoaController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaController.m; sourceTree = ""; }; + 043D7E71145795B20078D710 /* JSCocoaFFIArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaFFIArgument.h; sourceTree = ""; }; + 043D7E72145795B20078D710 /* JSCocoaFFIArgument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaFFIArgument.m; sourceTree = ""; }; + 043D7E73145795B20078D710 /* JSCocoaFFIClosure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaFFIClosure.h; sourceTree = ""; }; + 043D7E74145795B20078D710 /* JSCocoaFFIClosure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaFFIClosure.m; sourceTree = ""; }; + 043D7E75145795B20078D710 /* JSCocoaLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaLib.h; sourceTree = ""; }; + 043D7E76145795B20078D710 /* JSCocoaLib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaLib.m; sourceTree = ""; }; + 043D7E77145795B20078D710 /* JSCocoaPrivateObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaPrivateObject.h; sourceTree = ""; }; + 043D7E78145795B20078D710 /* JSCocoaPrivateObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaPrivateObject.m; sourceTree = ""; }; + 043D7E7A145795B20078D710 /* UKFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKFileWatcher.h; sourceTree = ""; }; + 043D7E7B145795B20078D710 /* UKFileWatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKFileWatcher.m; sourceTree = ""; }; + 043D7E7C145795B20078D710 /* UKFNSubscribeFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKFNSubscribeFileWatcher.h; sourceTree = ""; }; + 043D7E7D145795B20078D710 /* UKFNSubscribeFileWatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKFNSubscribeFileWatcher.m; sourceTree = ""; }; + 043D7E7E145795B20078D710 /* UKKQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKKQueue.h; sourceTree = ""; }; + 043D7E7F145795B20078D710 /* UKKQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKKQueue.m; sourceTree = ""; }; + 043D7E80145795B20078D710 /* UKMainThreadProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKMainThreadProxy.h; sourceTree = ""; }; + 043D7E81145795B20078D710 /* UKMainThreadProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKMainThreadProxy.m; sourceTree = ""; }; + 043D7E83145795B20078D710 /* AtomWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = AtomWindow.xib; path = xibs/AtomWindow.xib; sourceTree = ""; }; + 043D7E90145795B70078D710 /* AtomApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomApp.h; path = Classes/AtomApp.h; sourceTree = ""; }; + 043D7E91145795B70078D710 /* AtomApp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AtomApp.m; path = Classes/AtomApp.m; sourceTree = ""; }; + 043D7E92145795B70078D710 /* AtomController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomController.h; path = Classes/AtomController.h; sourceTree = ""; }; + 043D7E93145795B70078D710 /* AtomController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AtomController.m; path = Classes/AtomController.m; sourceTree = ""; }; + 047F26011457978C006DC904 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + 047F260314579792006DC904 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; + 047F260D145883B9006DC904 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 043D7E44145794990078D710 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 047F260414579792006DC904 /* WebKit.framework in Frameworks */, + 047F26021457978C006DC904 /* JavaScriptCore.framework in Frameworks */, + 043D7E4C145794990078D710 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 043D7E3C145794990078D710 = { + isa = PBXGroup; + children = ( + 043D7E51145794990078D710 /* Atom */, + 043D7E4A145794990078D710 /* Frameworks */, + 043D7E48145794990078D710 /* Products */, + ); + sourceTree = ""; + }; + 043D7E48145794990078D710 /* Products */ = { + isa = PBXGroup; + children = ( + 043D7E47145794990078D710 /* Atom.app */, + ); + name = Products; + sourceTree = ""; + }; + 043D7E4A145794990078D710 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 047F260314579792006DC904 /* WebKit.framework */, + 047F26011457978C006DC904 /* JavaScriptCore.framework */, + 043D7E4B145794990078D710 /* Cocoa.framework */, + 043D7E4D145794990078D710 /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 043D7E4D145794990078D710 /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 043D7E4E145794990078D710 /* AppKit.framework */, + 043D7E4F145794990078D710 /* CoreData.framework */, + 043D7E50145794990078D710 /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 043D7E51145794990078D710 /* Atom */ = { + isa = PBXGroup; + children = ( + 043D7E90145795B70078D710 /* AtomApp.h */, + 043D7E91145795B70078D710 /* AtomApp.m */, + 043D7E92145795B70078D710 /* AtomController.h */, + 043D7E93145795B70078D710 /* AtomController.m */, + 043D7E6B145795B20078D710 /* JSCocoa */, + 043D7E79145795B20078D710 /* UKKQueue */, + 043D7E52145794990078D710 /* Supporting Files */, + ); + path = Atom; + sourceTree = ""; + }; + 043D7E52145794990078D710 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 047F260D145883B9006DC904 /* Icon.icns */, + 043D7E601457949A0078D710 /* MainMenu.xib */, + 043D7E83145795B20078D710 /* AtomWindow.xib */, + 043D7E53145794990078D710 /* Atom-Info.plist */, + 043D7E54145794990078D710 /* InfoPlist.strings */, + 043D7E57145794990078D710 /* main.m */, + 043D7E59145794990078D710 /* Atom-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 043D7E6B145795B20078D710 /* JSCocoa */ = { + isa = PBXGroup; + children = ( + 043D7E6C145795B20078D710 /* BridgeSupportController.h */, + 043D7E6D145795B20078D710 /* BridgeSupportController.m */, + 043D7E6E145795B20078D710 /* JSCocoa.h */, + 043D7E6F145795B20078D710 /* JSCocoaController.h */, + 043D7E70145795B20078D710 /* JSCocoaController.m */, + 043D7E71145795B20078D710 /* JSCocoaFFIArgument.h */, + 043D7E72145795B20078D710 /* JSCocoaFFIArgument.m */, + 043D7E73145795B20078D710 /* JSCocoaFFIClosure.h */, + 043D7E74145795B20078D710 /* JSCocoaFFIClosure.m */, + 043D7E75145795B20078D710 /* JSCocoaLib.h */, + 043D7E76145795B20078D710 /* JSCocoaLib.m */, + 043D7E77145795B20078D710 /* JSCocoaPrivateObject.h */, + 043D7E78145795B20078D710 /* JSCocoaPrivateObject.m */, + ); + path = JSCocoa; + sourceTree = ""; + }; + 043D7E79145795B20078D710 /* UKKQueue */ = { + isa = PBXGroup; + children = ( + 043D7E7A145795B20078D710 /* UKFileWatcher.h */, + 043D7E7B145795B20078D710 /* UKFileWatcher.m */, + 043D7E7C145795B20078D710 /* UKFNSubscribeFileWatcher.h */, + 043D7E7D145795B20078D710 /* UKFNSubscribeFileWatcher.m */, + 043D7E7E145795B20078D710 /* UKKQueue.h */, + 043D7E7F145795B20078D710 /* UKKQueue.m */, + 043D7E80145795B20078D710 /* UKMainThreadProxy.h */, + 043D7E81145795B20078D710 /* UKMainThreadProxy.m */, + ); + path = UKKQueue; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 043D7E46145794990078D710 /* Atom */ = { + isa = PBXNativeTarget; + buildConfigurationList = 043D7E651457949A0078D710 /* Build configuration list for PBXNativeTarget "Atom" */; + buildPhases = ( + 043D7E43145794990078D710 /* Sources */, + 043D7E44145794990078D710 /* Frameworks */, + 043D7E45145794990078D710 /* Resources */, + 047F25FF145796A2006DC904 /* Copy HTML folder & compile CoffeeScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Atom; + productName = Atom; + productReference = 043D7E47145794990078D710 /* Atom.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 043D7E3E145794990078D710 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = 043D7E41145794990078D710 /* Build configuration list for PBXProject "Atom" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 043D7E3C145794990078D710; + productRefGroup = 043D7E48145794990078D710 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 043D7E46145794990078D710 /* Atom */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 043D7E45145794990078D710 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 043D7E56145794990078D710 /* InfoPlist.strings in Resources */, + 043D7E621457949A0078D710 /* MainMenu.xib in Resources */, + 043D7E8E145795B20078D710 /* AtomWindow.xib in Resources */, + 047F260E145883B9006DC904 /* Icon.icns in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 047F25FF145796A2006DC904 /* Copy HTML folder & compile CoffeeScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy HTML folder & compile CoffeeScript"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "rake build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 043D7E43145794990078D710 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 043D7E58145794990078D710 /* main.m in Sources */, + 043D7E84145795B20078D710 /* BridgeSupportController.m in Sources */, + 043D7E85145795B20078D710 /* JSCocoaController.m in Sources */, + 043D7E86145795B20078D710 /* JSCocoaFFIArgument.m in Sources */, + 043D7E87145795B20078D710 /* JSCocoaFFIClosure.m in Sources */, + 043D7E88145795B20078D710 /* JSCocoaLib.m in Sources */, + 043D7E89145795B20078D710 /* JSCocoaPrivateObject.m in Sources */, + 043D7E8A145795B20078D710 /* UKFileWatcher.m in Sources */, + 043D7E8B145795B20078D710 /* UKFNSubscribeFileWatcher.m in Sources */, + 043D7E8C145795B20078D710 /* UKKQueue.m in Sources */, + 043D7E8D145795B20078D710 /* UKMainThreadProxy.m in Sources */, + 043D7E94145795B70078D710 /* AtomApp.m in Sources */, + 043D7E95145795B70078D710 /* AtomController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 043D7E54145794990078D710 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 043D7E55145794990078D710 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 043D7E601457949A0078D710 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 043D7E611457949A0078D710 /* en */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 043D7E631457949A0078D710 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-lffi"; + SDKROOT = macosx; + }; + name = Debug; + }; + 043D7E641457949A0078D710 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + OTHER_LDFLAGS = "-lffi"; + SDKROOT = macosx; + }; + name = Release; + }; + 043D7E661457949A0078D710 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Atom/Atom-Prefix.pch"; + INFOPLIST_FILE = "Atom/Atom-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 043D7E671457949A0078D710 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Atom/Atom-Prefix.pch"; + INFOPLIST_FILE = "Atom/Atom-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 043D7E41145794990078D710 /* Build configuration list for PBXProject "Atom" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 043D7E631457949A0078D710 /* Debug */, + 043D7E641457949A0078D710 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 043D7E651457949A0078D710 /* Build configuration list for PBXNativeTarget "Atom" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 043D7E661457949A0078D710 /* Debug */, + 043D7E671457949A0078D710 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 043D7E3E145794990078D710 /* Project object */; +} diff --git a/Cocoa/Atomicity-Info.plist b/Atom/Atom-Info.plist similarity index 79% rename from Cocoa/Atomicity-Info.plist rename to Atom/Atom-Info.plist index b7f901fe2..0ae74daad 100644 --- a/Cocoa/Atomicity-Info.plist +++ b/Atom/Atom-Info.plist @@ -3,13 +3,13 @@ CFBundleDevelopmentRegion - English + en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile - APPL.icns + Icon.icns CFBundleIdentifier - com.github.Atomicity + GitHub.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -24,6 +24,8 @@ 1 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2011 __MyCompanyName__. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/Atom/Atom-Prefix.pch b/Atom/Atom-Prefix.pch new file mode 100644 index 000000000..769e458da --- /dev/null +++ b/Atom/Atom-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Atom' target in the 'Atom' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/Cocoa/Classes/AtomApp.h b/Atom/Classes/AtomApp.h similarity index 100% rename from Cocoa/Classes/AtomApp.h rename to Atom/Classes/AtomApp.h diff --git a/Cocoa/Classes/AtomApp.m b/Atom/Classes/AtomApp.m similarity index 64% rename from Cocoa/Classes/AtomApp.m rename to Atom/Classes/AtomApp.m index 9a300777d..0bbe41ad4 100644 --- a/Cocoa/Classes/AtomApp.m +++ b/Atom/Classes/AtomApp.m @@ -17,22 +17,22 @@ } // Overridden -//- (void)sendEvent:(NSEvent *)event { -// if ([event type] == NSKeyDown) { -// BOOL handeled = NO; -// id controller = [[self keyWindow] windowController]; -// -// // The keyWindow could be a Cocoa Dialog or something, ignore that. -// if ([controller isKindOfClass:[AtomController class]]) { -// handeled = [controller handleKeyEvent:event]; -// } -// -// if (!handeled) [super sendEvent:event]; -// } -// else { -// [super sendEvent:event]; -// } -//} +- (void)sendEvent:(NSEvent *)event { + if ([event type] == NSKeyDown) { + BOOL handeled = NO; + id controller = [[self keyWindow] windowController]; + + // The keyWindow could be a Cocoa Dialog or something, ignore that. + if ([controller isKindOfClass:[AtomController class]]) { + handeled = [controller handleKeyEvent:event]; + } + + if (!handeled) [super sendEvent:event]; + } + else { + [super sendEvent:event]; + } +} // AppDelegate - (void)applicationWillFinishLaunching:(NSNotification *)aNotification { diff --git a/Cocoa/Classes/AtomController.h b/Atom/Classes/AtomController.h similarity index 66% rename from Cocoa/Classes/AtomController.h rename to Atom/Classes/AtomController.h index 07c8cc71f..b23cff639 100644 --- a/Cocoa/Classes/AtomController.h +++ b/Atom/Classes/AtomController.h @@ -1,11 +1,3 @@ -// -// AtomWindowController.h -// Atomicity -// -// Created by Chris Wanstrath on 8/22/11. -// Copyright 2011 GitHub. All rights reserved. -// - #import @class JSCocoa; diff --git a/Cocoa/Classes/AtomController.m b/Atom/Classes/AtomController.m similarity index 73% rename from Cocoa/Classes/AtomController.m rename to Atom/Classes/AtomController.m index 8e7003b27..655a0677f 100644 --- a/Cocoa/Classes/AtomController.m +++ b/Atom/Classes/AtomController.m @@ -1,11 +1,3 @@ -// -// AtomWindowController.m -// Atomicity -// -// Created by Chris Wanstrath on 8/22/11. -// Copyright 2011 GitHub. All rights reserved. -//` - #import "AtomController.h" #import "AtomApp.h" @@ -48,19 +40,10 @@ jscocoa = [[JSCocoa alloc] initWithGlobalContext:[[webView mainFrame] globalContext]]; [jscocoa setObject:self withName:@"atomController"]; -// NSString *resourcePath = [[NSBundle mainBundle] resourcePath]; -// NSString *requirePath = [resourcePath stringByAppendingString:@"/src/require.js"]; -// [jscocoa evalJSFile:requirePath]; - NSURL *resourceURL = [[NSBundle mainBundle] resourceURL]; NSURL *indexURL = [resourceURL URLByAppendingPathComponent:@"index.html"]; NSURLRequest *request = [NSURLRequest requestWithURL:indexURL]; - [[webView mainFrame] loadRequest:request]; - - NSString *resourcePath = [[NSBundle mainBundle] resourcePath]; - NSString *requirePath = [resourcePath stringByAppendingString:@"/src/watcher.js"]; - [jscocoa evalJSFile:requirePath]; - + [[webView mainFrame] loadRequest:request]; } } diff --git a/Cocoa/APPL.icns b/Atom/Icon.icns similarity index 100% rename from Cocoa/APPL.icns rename to Atom/Icon.icns diff --git a/Cocoa/JSCocoa/BridgeSupportController.h b/Atom/JSCocoa/BridgeSupportController.h similarity index 100% rename from Cocoa/JSCocoa/BridgeSupportController.h rename to Atom/JSCocoa/BridgeSupportController.h diff --git a/Cocoa/JSCocoa/BridgeSupportController.m b/Atom/JSCocoa/BridgeSupportController.m similarity index 100% rename from Cocoa/JSCocoa/BridgeSupportController.m rename to Atom/JSCocoa/BridgeSupportController.m diff --git a/Cocoa/JSCocoa/JSCocoa.h b/Atom/JSCocoa/JSCocoa.h similarity index 100% rename from Cocoa/JSCocoa/JSCocoa.h rename to Atom/JSCocoa/JSCocoa.h diff --git a/Cocoa/JSCocoa/JSCocoaController.h b/Atom/JSCocoa/JSCocoaController.h similarity index 100% rename from Cocoa/JSCocoa/JSCocoaController.h rename to Atom/JSCocoa/JSCocoaController.h diff --git a/Cocoa/JSCocoa/JSCocoaController.m b/Atom/JSCocoa/JSCocoaController.m similarity index 99% rename from Cocoa/JSCocoa/JSCocoaController.m rename to Atom/JSCocoa/JSCocoaController.m index 7fe5a6341..2e8bab8ef 100644 --- a/Cocoa/JSCocoa/JSCocoaController.m +++ b/Atom/JSCocoa/JSCocoaController.m @@ -261,22 +261,18 @@ const JSClassDefinition kJSClassDefinitionEmpty = { 0, 0, [self setObjectNoRetain:self withName:@"__jsc__" attributes:kJSPropertyAttributeReadOnly|kJSPropertyAttributeDontEnum|kJSPropertyAttributeDontDelete]; // Load class kit - BOOL b; - if (!ctx) { - useJSLint = NO; - id lintPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"jslint-jscocoa" ofType:@"js"]; - if ([[NSFileManager defaultManager] fileExistsAtPath:lintPath]) { - b = [self evalJSFile:lintPath]; - if (!b) - NSLog(@"[JSCocoa initWithGlobalContext:] JSLint not loaded"); - } - id classKitPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"class" ofType:@"js"]; - if ([[NSFileManager defaultManager] fileExistsAtPath:classKitPath]) { - b = [self evalJSFile:classKitPath]; - if (!b) - NSLog(@"[JSCocoa initWithGlobalContext:] class.js not loaded"); - } - } + if (!_ctx) + { + useJSLint = NO; + id lintPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"jslint-jscocoa" ofType:@"js"]; + if ([[NSFileManager defaultManager] fileExistsAtPath:lintPath]) { + BOOL b = [self evalJSFile:lintPath]; + if (!b) + NSLog(@"[JSCocoa initWithGlobalContext:] JSLint not loaded"); + } + id classKitPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"class" ofType:@"js"]; + if ([[NSFileManager defaultManager] fileExistsAtPath:classKitPath]) [self evalJSFile:classKitPath]; + } // Objects can use their own dealloc, normally used up by JSCocoa // JSCocoa registers 'safeDealloc' in place of 'dealloc' and calls it in the next run loop cycle. @@ -490,7 +486,9 @@ static id JSCocoaSingleton = NULL; // Quick eval of strings and functions returning ObjC objects // - (id)eval:(NSString*)script { return [self toObject:[self evalJSString:script]]; } -- (id)callFunction:(NSString*)name { return [self toObject:[self callJSFunctionNamed:name withArgumentsArray:nil]]; } +- (id)callFunction:(NSString*)name { + return [self toObject:[self callJSFunctionNamed:name withArgumentsArray:nil]]; +} - (id)callFunction:(NSString*)name withArguments:(NSArray*)arguments { return [self toObject:[self callJSFunctionNamed:name withArgumentsArray:arguments]]; } - (BOOL)hasFunction:(NSString*)name { return [self hasJSFunctionNamed:name]; } diff --git a/Cocoa/JSCocoa/JSCocoaFFIArgument.h b/Atom/JSCocoa/JSCocoaFFIArgument.h similarity index 100% rename from Cocoa/JSCocoa/JSCocoaFFIArgument.h rename to Atom/JSCocoa/JSCocoaFFIArgument.h diff --git a/Cocoa/JSCocoa/JSCocoaFFIArgument.m b/Atom/JSCocoa/JSCocoaFFIArgument.m similarity index 100% rename from Cocoa/JSCocoa/JSCocoaFFIArgument.m rename to Atom/JSCocoa/JSCocoaFFIArgument.m diff --git a/Cocoa/JSCocoa/JSCocoaFFIClosure.h b/Atom/JSCocoa/JSCocoaFFIClosure.h similarity index 100% rename from Cocoa/JSCocoa/JSCocoaFFIClosure.h rename to Atom/JSCocoa/JSCocoaFFIClosure.h diff --git a/Cocoa/JSCocoa/JSCocoaFFIClosure.m b/Atom/JSCocoa/JSCocoaFFIClosure.m similarity index 100% rename from Cocoa/JSCocoa/JSCocoaFFIClosure.m rename to Atom/JSCocoa/JSCocoaFFIClosure.m diff --git a/Cocoa/JSCocoa/JSCocoaLib.h b/Atom/JSCocoa/JSCocoaLib.h similarity index 100% rename from Cocoa/JSCocoa/JSCocoaLib.h rename to Atom/JSCocoa/JSCocoaLib.h diff --git a/Cocoa/JSCocoa/JSCocoaLib.m b/Atom/JSCocoa/JSCocoaLib.m similarity index 100% rename from Cocoa/JSCocoa/JSCocoaLib.m rename to Atom/JSCocoa/JSCocoaLib.m diff --git a/Cocoa/JSCocoa/JSCocoaPrivateObject.h b/Atom/JSCocoa/JSCocoaPrivateObject.h similarity index 100% rename from Cocoa/JSCocoa/JSCocoaPrivateObject.h rename to Atom/JSCocoa/JSCocoaPrivateObject.h diff --git a/Cocoa/JSCocoa/JSCocoaPrivateObject.m b/Atom/JSCocoa/JSCocoaPrivateObject.m similarity index 100% rename from Cocoa/JSCocoa/JSCocoaPrivateObject.m rename to Atom/JSCocoa/JSCocoaPrivateObject.m diff --git a/Cocoa/UKKQueue/UKFNSubscribeFileWatcher.h b/Atom/UKKQueue/UKFNSubscribeFileWatcher.h similarity index 100% rename from Cocoa/UKKQueue/UKFNSubscribeFileWatcher.h rename to Atom/UKKQueue/UKFNSubscribeFileWatcher.h diff --git a/Cocoa/UKKQueue/UKFNSubscribeFileWatcher.m b/Atom/UKKQueue/UKFNSubscribeFileWatcher.m similarity index 100% rename from Cocoa/UKKQueue/UKFNSubscribeFileWatcher.m rename to Atom/UKKQueue/UKFNSubscribeFileWatcher.m diff --git a/Cocoa/UKKQueue/UKFileWatcher.h b/Atom/UKKQueue/UKFileWatcher.h similarity index 100% rename from Cocoa/UKKQueue/UKFileWatcher.h rename to Atom/UKKQueue/UKFileWatcher.h diff --git a/Cocoa/UKKQueue/UKFileWatcher.m b/Atom/UKKQueue/UKFileWatcher.m similarity index 100% rename from Cocoa/UKKQueue/UKFileWatcher.m rename to Atom/UKKQueue/UKFileWatcher.m diff --git a/Cocoa/UKKQueue/UKKQueue.h b/Atom/UKKQueue/UKKQueue.h similarity index 100% rename from Cocoa/UKKQueue/UKKQueue.h rename to Atom/UKKQueue/UKKQueue.h diff --git a/Cocoa/UKKQueue/UKKQueue.m b/Atom/UKKQueue/UKKQueue.m similarity index 100% rename from Cocoa/UKKQueue/UKKQueue.m rename to Atom/UKKQueue/UKKQueue.m diff --git a/Cocoa/UKKQueue/UKMainThreadProxy.h b/Atom/UKKQueue/UKMainThreadProxy.h similarity index 100% rename from Cocoa/UKKQueue/UKMainThreadProxy.h rename to Atom/UKKQueue/UKMainThreadProxy.h diff --git a/Cocoa/UKKQueue/UKMainThreadProxy.m b/Atom/UKKQueue/UKMainThreadProxy.m similarity index 100% rename from Cocoa/UKKQueue/UKMainThreadProxy.m rename to Atom/UKKQueue/UKMainThreadProxy.m diff --git a/Cocoa/English.lproj/InfoPlist.strings b/Atom/en.lproj/InfoPlist.strings similarity index 100% rename from Cocoa/English.lproj/InfoPlist.strings rename to Atom/en.lproj/InfoPlist.strings diff --git a/Cocoa/English.lproj/MainMenu.xib b/Atom/en.lproj/MainMenu.xib similarity index 53% rename from Cocoa/English.lproj/MainMenu.xib rename to Atom/en.lproj/MainMenu.xib index cdf8c5fb2..5e498d5e1 100644 --- a/Cocoa/English.lproj/MainMenu.xib +++ b/Atom/en.lproj/MainMenu.xib @@ -1,34 +1,28 @@ - + - 1060 - 10K549 - 851 - 1038.36 - 461.00 + 1070 + 11C74 + 1938 + 1138.23 + 567.00 com.apple.InterfaceBuilder.CocoaPlugin - 851 + 1938 - - YES - - - - YES + + NSMenu + NSMenuItem + NSCustomObject + + com.apple.InterfaceBuilder.CocoaPlugin - + - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + - - YES + AtomApp @@ -40,11 +34,10 @@ AMainMenu - - YES + - Atomicity + Atom 1048576 2147483647 @@ -58,12 +51,11 @@ submenuAction: - Atomicity - - YES + Atom + - About Atomicity + About Atom 2147483647 @@ -111,9 +103,7 @@ submenuAction: Services - - YES - + _NSServicesMenu @@ -130,7 +120,7 @@ - Hide Atomicity + Hide Atom h 1048576 2147483647 @@ -168,14 +158,14 @@ - Quit Atomicity + Quit Atom q 1048576 2147483647 - + _NSAppleMenu @@ -190,8 +180,7 @@ submenuAction: File - - YES + New @@ -221,8 +210,7 @@ submenuAction: Open Recent - - YES + Clear Menu @@ -232,7 +220,7 @@ - + _NSRecentDocumentsMenu @@ -250,29 +238,21 @@ Close - + w + 1048576 2147483647 - Save + Save… s 1048576 2147483647 - - - Save As… - S - 1179648 - 2147483647 - - - Revert to Saved @@ -311,7 +291,7 @@ - + @@ -325,8 +305,7 @@ submenuAction: Edit - - YES + Undo @@ -432,8 +411,7 @@ submenuAction: Find - - YES + Find… @@ -444,6 +422,16 @@ 1 + + + Find and Replace… + f + 1572864 + 2147483647 + + + 12 + Find Next @@ -483,7 +471,7 @@ - + @@ -497,8 +485,7 @@ submenuAction: Spelling and Grammar - - YES + Show Spelling and Grammar @@ -553,7 +540,7 @@ - + @@ -567,8 +554,7 @@ submenuAction: Substitutions - - YES + Show Substitutions @@ -633,7 +619,7 @@ - + @@ -646,8 +632,7 @@ submenuAction: Transformations - - YES + Make Upper Case @@ -672,7 +657,7 @@ - + @@ -686,8 +671,7 @@ submenuAction: Speech - - YES + Start Speaking @@ -706,65 +690,10 @@ - + - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu + @@ -777,46 +706,52 @@ submenuAction: Help - - YES + - Atomicity Help + Atom Help ? 1048576 2147483647 - + _NSHelpMenu - + _NSMainMenu NSFontManager - + - - YES + - performMiniaturize: - - + terminate: + + - 37 + 449 - arrangeInFront: - - + orderFrontStandardAboutPanel: + + - 39 + 142 + + + + delegate + + + + 536 @@ -842,14 +777,6 @@ 127 - - - orderFrontStandardAboutPanel: - - - - 142 - performClose: @@ -954,14 +881,6 @@ 235 - - - performZoom: - - - - 240 - performFindPanelAction: @@ -1018,14 +937,6 @@ 362 - - - saveDocumentAs: - - - - 363 - revertDocumentToSaved: @@ -1074,14 +985,6 @@ 374 - - - terminate: - - - - 449 - toggleAutomaticSpellingCorrection: @@ -1179,20 +1082,19 @@ 493 - - delegate - - + + performFindPanelAction: + + 535 - + - - YES + 0 - + @@ -1217,59 +1119,43 @@ 29 - - YES - + - + - - 19 - - - YES - - - - 56 - - YES + - + 217 - - YES + - + 83 - - YES + - + 81 - - YES + - @@ -1279,7 +1165,7 @@ - + @@ -1287,11 +1173,6 @@ - - 80 - - - 78 @@ -1310,10 +1191,9 @@ 124 - - YES + - + @@ -1344,10 +1224,9 @@ 125 - - YES + - + @@ -1358,8 +1237,7 @@ 205 - - YES + @@ -1375,7 +1253,7 @@ - + @@ -1426,33 +1304,30 @@ 218 - - YES + - + 216 - - YES + - + 200 - - YES + - + @@ -1473,14 +1348,14 @@ 220 - - YES + - + + @@ -1511,8 +1386,7 @@ 57 - - YES + @@ -1524,7 +1398,7 @@ - + @@ -1570,10 +1444,9 @@ 131 - - YES + - + @@ -1591,55 +1464,21 @@ - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - 211 - - YES + - + 212 - - YES + - + @@ -1660,17 +1499,15 @@ 348 - - YES + - + 349 - - YES + @@ -1678,7 +1515,7 @@ - + @@ -1704,21 +1541,19 @@ 450 - - YES + - + 451 - - YES + - + @@ -1774,19 +1609,17 @@ 490 - - YES + - + 491 - - YES + - + @@ -1794,997 +1627,163 @@ - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 112.IBPluginDependency - 124.IBPluginDependency - 125.IBPluginDependency - 126.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 195.IBPluginDependency - 196.IBPluginDependency - 197.IBPluginDependency - 198.IBPluginDependency - 199.IBPluginDependency - 200.IBPluginDependency - 201.IBPluginDependency - 202.IBPluginDependency - 203.IBPluginDependency - 204.IBPluginDependency - 205.IBPluginDependency - 206.IBPluginDependency - 207.IBPluginDependency - 208.IBPluginDependency - 209.IBPluginDependency - 210.IBPluginDependency - 211.IBPluginDependency - 212.IBPluginDependency - 213.IBPluginDependency - 214.IBPluginDependency - 215.IBPluginDependency - 216.IBPluginDependency - 217.IBPluginDependency - 218.IBPluginDependency - 219.IBPluginDependency - 220.IBPluginDependency - 221.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBEditorWindowLastContentRect - 24.IBPluginDependency - 29.IBEditorWindowLastContentRect - 29.IBPluginDependency - 346.IBPluginDependency - 348.IBPluginDependency - 349.IBPluginDependency - 350.IBPluginDependency - 351.IBPluginDependency - 354.IBPluginDependency - 420.IBPluginDependency - 450.IBPluginDependency - 451.IBPluginDependency - 452.IBPluginDependency - 453.IBPluginDependency - 454.IBPluginDependency - 457.IBPluginDependency - 459.IBPluginDependency - 460.IBPluginDependency - 462.IBPluginDependency - 465.IBPluginDependency - 466.IBPluginDependency - 485.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 5.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 72.IBPluginDependency - 73.IBPluginDependency - 74.IBPluginDependency - 75.IBPluginDependency - 77.IBPluginDependency - 78.IBPluginDependency - 79.IBPluginDependency - 80.IBPluginDependency - 81.IBPluginDependency - 82.IBPluginDependency - 83.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{514, 752}, {194, 73}} - com.apple.InterfaceBuilder.CocoaPlugin - {{329, 825}, {317, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - YES - + + 534 + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + - - YES - - - YES - - + - 535 + 536 - - YES + AtomApp NSApplication IBProjectSource - Classes/AtomApp.h - - - - NSObject - - IBProjectSource - JSCocoa/JSCocoaController.h - - - - NSObject - - IBProjectSource - JSCocoa/JSCocoaLib.h - - - - - YES - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSBrowser - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSBrowser.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h + ./Classes/AtomApp.h NSDocument - NSObject - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: + + id + id + id + id + id + id + + + + printDocument: + id - - YES - id - id - id - id - id - id + + revertDocumentToSaved: + id - - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: + + runPageLayout: + id - - YES - - printDocument: - id - - - revertDocumentToSaved: - id - - - runPageLayout: - id - - - saveDocument: - id - - - saveDocumentAs: - id - - - saveDocumentTo: - id - + + saveDocument: + id - - - IBFrameworkSource - AppKit.framework/Headers/NSDocument.h - - - - NSDocument - - IBFrameworkSource - AppKit.framework/Headers/NSDocumentScripting.h - - - - NSDocumentController - NSObject - - YES - - YES - clearRecentDocuments: - newDocument: - openDocument: - saveAllDocuments: + + saveDocumentAs: + id - - YES - id - id - id - id + + saveDocumentTo: + id - - - YES - - YES - clearRecentDocuments: - newDocument: - openDocument: - saveAllDocuments: - - - YES - - clearRecentDocuments: - id - - - newDocument: - id - - - openDocument: - id - - - saveAllDocuments: - id - - - + - IBFrameworkSource - AppKit.framework/Headers/NSDocumentController.h + IBProjectSource + ./Classes/NSDocument.h - - NSFontManager - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSMatrix - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSMatrix.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSMenuItem - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSMovieView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMovieView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebEditingDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebFrameLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebJavaPlugIn.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPlugin.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPluginContainer.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPolicyDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebResourceLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebScriptObject.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebUIDelegate.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSTableView - NSControl - - - - NSText - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSText.h - - - - NSTextView - NSText - - IBFrameworkSource - AppKit.framework/Headers/NSTextView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - WebView - NSView - - YES - - YES - goBack: - goForward: - makeTextLarger: - makeTextSmaller: - makeTextStandardSize: - reload: - reloadFromOrigin: - stopLoading: - takeStringURLFrom: - toggleContinuousSpellChecking: - toggleSmartInsertDelete: - - - YES - id - id - id - id - id - id - id - id - id - id - id - - - - YES - - YES - goBack: - goForward: - makeTextLarger: - makeTextSmaller: - makeTextStandardSize: - reload: - reloadFromOrigin: - stopLoading: - takeStringURLFrom: - toggleContinuousSpellChecking: - toggleSmartInsertDelete: - - - YES - - goBack: - id - - - goForward: - id - - - makeTextLarger: - id - - - makeTextSmaller: - id - - - makeTextStandardSize: - id - - - reload: - id - - - reloadFromOrigin: - id - - - stopLoading: - id - - - takeStringURLFrom: - id - - - toggleContinuousSpellChecking: - id - - - toggleSmartInsertDelete: - id - - - - - IBFrameworkSource - WebKit.framework/Headers/WebView.h - - - + 0 IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - + + {9, 8} + {7, 2} + diff --git a/Atom/main.m b/Atom/main.m new file mode 100644 index 000000000..3248f6878 --- /dev/null +++ b/Atom/main.m @@ -0,0 +1,14 @@ +// +// main.m +// Atom +// +// Created by Corey Johnson on 10/25/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/Cocoa/xibs/AtomWindow.xib b/Atom/xibs/AtomWindow.xib similarity index 100% rename from Cocoa/xibs/AtomWindow.xib rename to Atom/xibs/AtomWindow.xib diff --git a/Cocoa/.gitignore b/Cocoa/.gitignore deleted file mode 100644 index 64c810809..000000000 --- a/Cocoa/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -# Xcode -build/* -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -*.xcworkspace -!default.xcworkspace -xcuserdata -profile -*.moved-aside - diff --git a/Cocoa/Atomicity.xcodeproj/project.pbxproj b/Cocoa/Atomicity.xcodeproj/project.pbxproj deleted file mode 100644 index a7f9bfeb1..000000000 --- a/Cocoa/Atomicity.xcodeproj/project.pbxproj +++ /dev/null @@ -1,431 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 45; - objects = { - -/* Begin PBXBuildFile section */ - 045043D31455D51B00BFC3A0 /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 045043CC1455D51B00BFC3A0 /* UKFileWatcher.m */; }; - 045043D41455D51B00BFC3A0 /* UKFNSubscribeFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 045043CE1455D51B00BFC3A0 /* UKFNSubscribeFileWatcher.m */; }; - 045043D51455D51B00BFC3A0 /* UKKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 045043D01455D51B00BFC3A0 /* UKKQueue.m */; }; - 045043D61455D51B00BFC3A0 /* UKMainThreadProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 045043D21455D51B00BFC3A0 /* UKMainThreadProxy.m */; }; - 046973A414145A9500415518 /* AtomApp.m in Sources */ = {isa = PBXBuildFile; fileRef = 046973A314145A9500415518 /* AtomApp.m */; }; - 83599F9B13FE0F8400AC37E3 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83599F9A13FE0F8400AC37E3 /* WebKit.framework */; }; - 8359A6EE13FE26DA00AC37E3 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8359A6ED13FE26DA00AC37E3 /* JavaScriptCore.framework */; }; - 837D8BA91408FAAA009B6DFA /* AtomController.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BA71408FAAA009B6DFA /* AtomController.m */; }; - 837D8BAC1408FAB4009B6DFA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BAB1408FAB4009B6DFA /* main.m */; }; - 837D8BB41408FAC3009B6DFA /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BAD1408FAC3009B6DFA /* APPL.icns */; }; - 837D8BB51408FAC3009B6DFA /* Atomicity-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BAE1408FAC3009B6DFA /* Atomicity-Info.plist */; }; - 837D8BB61408FAC3009B6DFA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BB01408FAC3009B6DFA /* InfoPlist.strings */; }; - 837D8BB71408FAC3009B6DFA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BB21408FAC3009B6DFA /* MainMenu.xib */; }; - 837D8BD51408FAD4009B6DFA /* BridgeSupportController.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BC71408FAD4009B6DFA /* BridgeSupportController.m */; }; - 837D8BD71408FAD4009B6DFA /* JSCocoaController.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BCB1408FAD4009B6DFA /* JSCocoaController.m */; }; - 837D8BD81408FAD4009B6DFA /* JSCocoaFFIArgument.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BCD1408FAD4009B6DFA /* JSCocoaFFIArgument.m */; }; - 837D8BD91408FAD4009B6DFA /* JSCocoaFFIClosure.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BCF1408FAD4009B6DFA /* JSCocoaFFIClosure.m */; }; - 837D8BDA1408FAD4009B6DFA /* JSCocoaLib.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BD11408FAD4009B6DFA /* JSCocoaLib.m */; }; - 837D8BDB1408FAD4009B6DFA /* JSCocoaPrivateObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BD31408FAD4009B6DFA /* JSCocoaPrivateObject.m */; }; - 837D8BE11408FAF5009B6DFA /* AtomWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BE01408FAF5009B6DFA /* AtomWindow.xib */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 045043CB1455D51B00BFC3A0 /* UKFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKFileWatcher.h; sourceTree = ""; }; - 045043CC1455D51B00BFC3A0 /* UKFileWatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKFileWatcher.m; sourceTree = ""; }; - 045043CD1455D51B00BFC3A0 /* UKFNSubscribeFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKFNSubscribeFileWatcher.h; sourceTree = ""; }; - 045043CE1455D51B00BFC3A0 /* UKFNSubscribeFileWatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKFNSubscribeFileWatcher.m; sourceTree = ""; }; - 045043CF1455D51B00BFC3A0 /* UKKQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKKQueue.h; sourceTree = ""; }; - 045043D01455D51B00BFC3A0 /* UKKQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKKQueue.m; sourceTree = ""; }; - 045043D11455D51B00BFC3A0 /* UKMainThreadProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UKMainThreadProxy.h; sourceTree = ""; }; - 045043D21455D51B00BFC3A0 /* UKMainThreadProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UKMainThreadProxy.m; sourceTree = ""; }; - 046973A214145A9500415518 /* AtomApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomApp.h; path = Classes/AtomApp.h; sourceTree = ""; }; - 046973A314145A9500415518 /* AtomApp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AtomApp.m; path = Classes/AtomApp.m; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 83599F9A13FE0F8400AC37E3 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; - 8359A6ED13FE26DA00AC37E3 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - 837D8BA61408FAAA009B6DFA /* AtomController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomController.h; path = Classes/AtomController.h; sourceTree = SOURCE_ROOT; }; - 837D8BA71408FAAA009B6DFA /* AtomController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AtomController.m; path = Classes/AtomController.m; sourceTree = SOURCE_ROOT; }; - 837D8BAA1408FAB4009B6DFA /* Atomicity_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Atomicity_Prefix.pch; path = ../../Atomicity/Cocoa/Atomicity_Prefix.pch; sourceTree = SOURCE_ROOT; }; - 837D8BAB1408FAB4009B6DFA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ../../Atomicity/Cocoa/main.m; sourceTree = SOURCE_ROOT; }; - 837D8BAD1408FAC3009B6DFA /* APPL.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = APPL.icns; path = ../../Atomicity/Cocoa/APPL.icns; sourceTree = SOURCE_ROOT; }; - 837D8BAE1408FAC3009B6DFA /* Atomicity-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Atomicity-Info.plist"; path = "../../Atomicity/Cocoa/Atomicity-Info.plist"; sourceTree = SOURCE_ROOT; }; - 837D8BB11408FAC3009B6DFA /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = InfoPlist.strings; sourceTree = ""; }; - 837D8BB31408FAC3009B6DFA /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = MainMenu.xib; sourceTree = ""; }; - 837D8BC61408FAD4009B6DFA /* BridgeSupportController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgeSupportController.h; sourceTree = ""; }; - 837D8BC71408FAD4009B6DFA /* BridgeSupportController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BridgeSupportController.m; sourceTree = ""; }; - 837D8BC81408FAD4009B6DFA /* class.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = class.js; sourceTree = ""; }; - 837D8BC91408FAD4009B6DFA /* JSCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoa.h; sourceTree = ""; }; - 837D8BCA1408FAD4009B6DFA /* JSCocoaController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaController.h; sourceTree = ""; }; - 837D8BCB1408FAD4009B6DFA /* JSCocoaController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaController.m; sourceTree = ""; }; - 837D8BCC1408FAD4009B6DFA /* JSCocoaFFIArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaFFIArgument.h; sourceTree = ""; }; - 837D8BCD1408FAD4009B6DFA /* JSCocoaFFIArgument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaFFIArgument.m; sourceTree = ""; }; - 837D8BCE1408FAD4009B6DFA /* JSCocoaFFIClosure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaFFIClosure.h; sourceTree = ""; }; - 837D8BCF1408FAD4009B6DFA /* JSCocoaFFIClosure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaFFIClosure.m; sourceTree = ""; }; - 837D8BD01408FAD4009B6DFA /* JSCocoaLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaLib.h; sourceTree = ""; }; - 837D8BD11408FAD4009B6DFA /* JSCocoaLib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaLib.m; sourceTree = ""; }; - 837D8BD21408FAD4009B6DFA /* JSCocoaPrivateObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaPrivateObject.h; sourceTree = ""; }; - 837D8BD31408FAD4009B6DFA /* JSCocoaPrivateObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaPrivateObject.m; sourceTree = ""; }; - 837D8BE01408FAF5009B6DFA /* AtomWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AtomWindow.xib; path = ../../Atomicity/Cocoa/xibs/AtomWindow.xib; sourceTree = SOURCE_ROOT; }; - 8D1107320486CEB800E47090 /* Atomicity.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Atomicity.app; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - 83599F9B13FE0F8400AC37E3 /* WebKit.framework in Frameworks */, - 8359A6EE13FE26DA00AC37E3 /* JavaScriptCore.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 045043CA1455D51B00BFC3A0 /* UKKQueue */ = { - isa = PBXGroup; - children = ( - 045043CB1455D51B00BFC3A0 /* UKFileWatcher.h */, - 045043CC1455D51B00BFC3A0 /* UKFileWatcher.m */, - 045043CD1455D51B00BFC3A0 /* UKFNSubscribeFileWatcher.h */, - 045043CE1455D51B00BFC3A0 /* UKFNSubscribeFileWatcher.m */, - 045043CF1455D51B00BFC3A0 /* UKKQueue.h */, - 045043D01455D51B00BFC3A0 /* UKKQueue.m */, - 045043D11455D51B00BFC3A0 /* UKMainThreadProxy.h */, - 045043D21455D51B00BFC3A0 /* UKMainThreadProxy.m */, - ); - path = UKKQueue; - sourceTree = ""; - }; - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 046973A214145A9500415518 /* AtomApp.h */, - 046973A314145A9500415518 /* AtomApp.m */, - 837D8BA61408FAAA009B6DFA /* AtomController.h */, - 837D8BA71408FAAA009B6DFA /* AtomController.m */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - 83599F9A13FE0F8400AC37E3 /* WebKit.framework */, - 8359A6ED13FE26DA00AC37E3 /* JavaScriptCore.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* Atomicity.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* Atomicity */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 837D8BC51408FAD4009B6DFA /* JSCocoa */, - 045043CA1455D51B00BFC3A0 /* UKKQueue */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = Atomicity; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 837D8BAA1408FAB4009B6DFA /* Atomicity_Prefix.pch */, - 837D8BAB1408FAB4009B6DFA /* main.m */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 837D8BAD1408FAC3009B6DFA /* APPL.icns */, - 837D8BAE1408FAC3009B6DFA /* Atomicity-Info.plist */, - 837D8BB01408FAC3009B6DFA /* InfoPlist.strings */, - 837D8BE01408FAF5009B6DFA /* AtomWindow.xib */, - 837D8BB21408FAC3009B6DFA /* MainMenu.xib */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - 837D8BC51408FAD4009B6DFA /* JSCocoa */ = { - isa = PBXGroup; - children = ( - 837D8BC61408FAD4009B6DFA /* BridgeSupportController.h */, - 837D8BC71408FAD4009B6DFA /* BridgeSupportController.m */, - 837D8BC81408FAD4009B6DFA /* class.js */, - 837D8BC91408FAD4009B6DFA /* JSCocoa.h */, - 837D8BCA1408FAD4009B6DFA /* JSCocoaController.h */, - 837D8BCB1408FAD4009B6DFA /* JSCocoaController.m */, - 837D8BCC1408FAD4009B6DFA /* JSCocoaFFIArgument.h */, - 837D8BCD1408FAD4009B6DFA /* JSCocoaFFIArgument.m */, - 837D8BCE1408FAD4009B6DFA /* JSCocoaFFIClosure.h */, - 837D8BCF1408FAD4009B6DFA /* JSCocoaFFIClosure.m */, - 837D8BD01408FAD4009B6DFA /* JSCocoaLib.h */, - 837D8BD11408FAD4009B6DFA /* JSCocoaLib.m */, - 837D8BD21408FAD4009B6DFA /* JSCocoaPrivateObject.h */, - 837D8BD31408FAD4009B6DFA /* JSCocoaPrivateObject.m */, - ); - name = JSCocoa; - path = ../../Atomicity/Cocoa/JSCocoa; - sourceTree = SOURCE_ROOT; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* Atomicity */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Atomicity" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 8393439613FE480600EF93FB /* Copy HTML folder & compile CoffeeScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Atomicity; - productInstallPath = "$(HOME)/Applications"; - productName = Atomicity; - productReference = 8D1107320486CEB800E47090 /* Atomicity.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Atomicity" */; - compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* Atomicity */; - projectDirPath = ""; - projectRoot = Cocoa; - targets = ( - 8D1107260486CEB800E47090 /* Atomicity */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 837D8BB41408FAC3009B6DFA /* APPL.icns in Resources */, - 837D8BB51408FAC3009B6DFA /* Atomicity-Info.plist in Resources */, - 837D8BB61408FAC3009B6DFA /* InfoPlist.strings in Resources */, - 837D8BB71408FAC3009B6DFA /* MainMenu.xib in Resources */, - 837D8BE11408FAF5009B6DFA /* AtomWindow.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 8393439613FE480600EF93FB /* Copy HTML folder & compile CoffeeScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy HTML folder & compile CoffeeScript"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "rake build"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 837D8BA91408FAAA009B6DFA /* AtomController.m in Sources */, - 837D8BAC1408FAB4009B6DFA /* main.m in Sources */, - 837D8BD51408FAD4009B6DFA /* BridgeSupportController.m in Sources */, - 837D8BD71408FAD4009B6DFA /* JSCocoaController.m in Sources */, - 837D8BD81408FAD4009B6DFA /* JSCocoaFFIArgument.m in Sources */, - 837D8BD91408FAD4009B6DFA /* JSCocoaFFIClosure.m in Sources */, - 837D8BDA1408FAD4009B6DFA /* JSCocoaLib.m in Sources */, - 837D8BDB1408FAD4009B6DFA /* JSCocoaPrivateObject.m in Sources */, - 046973A414145A9500415518 /* AtomApp.m in Sources */, - 045043D31455D51B00BFC3A0 /* UKFileWatcher.m in Sources */, - 045043D41455D51B00BFC3A0 /* UKFNSubscribeFileWatcher.m in Sources */, - 045043D51455D51B00BFC3A0 /* UKKQueue.m in Sources */, - 045043D61455D51B00BFC3A0 /* UKMainThreadProxy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 837D8BB01408FAC3009B6DFA /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 837D8BB11408FAC3009B6DFA /* English */, - ); - name = InfoPlist.strings; - path = ../../Atomicity/Cocoa/English.lproj; - sourceTree = ""; - }; - 837D8BB21408FAC3009B6DFA /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 837D8BB31408FAC3009B6DFA /* English */, - ); - name = MainMenu.xib; - path = ../../Atomicity/Cocoa/English.lproj; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - ); - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Atomicity_Prefix.pch; - INFOPLIST_FILE = "Atomicity-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = Atomicity; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - ); - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Atomicity_Prefix.pch; - INFOPLIST_FILE = "Atomicity-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = Atomicity; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = ""; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-lxml2", - "-lffi", - ); - PREBINDING = NO; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = ""; - OTHER_LDFLAGS = ( - "-lxml2", - "-lffi", - ); - PREBINDING = NO; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Atomicity" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Atomicity" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Cocoa/Atomicity_Prefix.pch b/Cocoa/Atomicity_Prefix.pch deleted file mode 100644 index 60972c3d6..000000000 --- a/Cocoa/Atomicity_Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'Atomicity' target in the 'Atomicity' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/Cocoa/JSCocoa/class.js b/Cocoa/JSCocoa/class.js deleted file mode 100644 index d15adf3cf..000000000 --- a/Cocoa/JSCocoa/class.js +++ /dev/null @@ -1,1055 +0,0 @@ - - // ObjC - var nil = null - var YES = true - var NO = false - - var ctx = this - if ('OSX' in this) - { - ctx = OSX - var NSApp = null - } - - - function log(str) { __jsc__.log_('' + str) } - // This one is because I can't bring myself to not typing alert. - function alert(str) { log('********USE log(), not alert()*********'), log(str) } - - function dumpHash(o) { var str = ''; for (var i in o) str += i + '=' + o[i] + '\n'; return str } - - // - // ObjC type encodings - // http://developer.apple.com/mac/library/documentation/cocoa/conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html - // - // Used to write ObjC methods in Javascript - // - var types = ['char', 'int', 'short', 'long', 'long long', 'unsigned char', 'unsigned int', 'unsigned short', 'unsigned long', - 'unsigned long long', 'float', 'double', 'bool', 'void', 'char*', 'id', 'Class', 'selector', 'BOOL', 'void*', - 'NSInteger', 'NSUInteger', 'CGFloat']; - var encodings = {} - var l = types.length - // Encodings are architecture dependent and were encoded at compile time, retrieve them now - for (var i=0; i item - // -> id item - encoding = encoding.replace(/\s*<\s*\w+\s*>\s*/, '').toString() - - - // Structure arg -// if (encoding.indexOf(' ') != -1 && encoding.indexOf('*') == -1) - if (encoding.match(/struct \w+/)) - { - var structureName = encoding.split(' ')[1] - var structureEncoding = ctx.JSCocoaFFIArgument.structureFullTypeEncodingFromStructureName(structureName) - if (!structureEncoding) throw 'no encoding found for structure ' + structureName - - // - // Remove names of variables to keep only encodings - // - // {_NSPoint="x"f"y"f} - // becomes - // {_NSPoint=ff} - // -// ctx.JSCocoaController.log('*' + structureEncoding + '*' + String(String(structureEncoding).replace(/"[^"]+"/gi, "")) + '*') - return String(String(structureEncoding).replace(/"[^"]+"/gi, "")) - } - else - { - if (!(encoding in encodings)) - { - // Pointer to an ObjC object ? - var match = encoding.match(/^(\w+)\s*(\*+)$/) - if (match) - { - var className = match[1] - - // - // this[className]['class'] == this[className] - // can only work if each object is boxed only once : - // both expressions will return the same object, comparing one object to itself - // -> true - // - // BUT if both expressions each use their own box, comparison will come negative - // - var starCount = match[2].toString().length - if (className in this && this[className]['class'] == this[className]) - { - // ** is a pointer to class - return starCount > 1 ? '^@' : '@' - } - else - if (starCount == 1) - { - var rawEncoding = encoding.replace(/\*/, '') - rawEncoding = encodings[rawEncoding] - if (rawEncoding) return '^' + rawEncoding - } - } - // Structure ? - var structureEncoding = ctx.JSCocoaFFIArgument.structureFullTypeEncodingFromStructureName(encoding) - if (structureEncoding) return String(String(structureEncoding).replace(/"[^"]+"/gi, "")) - throw 'invalid encoding : "' + encoding + '"' - } - return encodings[encoding] - } - } - - function objc_encoding() - { - var encoding = objc_unary_encoding(arguments[0]) - encoding += '@:' - - for (var i=1; i - // - function describeStruct(o, level) - { - if (level == undefined) level = 0 - // Bail if structure contains a cycle - if (level > 100) return '' - - var str = '' - if (typeof(o) == 'object' || typeof(o) == 'function') - { - str += '{' - var elements = [] - for (var i in o) - elements.push(i + ':' + describeStruct(o[i], level+1)) - str += elements.join(', ') - str += '}' - } - else - str += o - - return str - } - - - // - // type o - // - function outArgument() - { - // Derive to store some javascript data in the internal hash - if (!('outArgument2' in this)) - ctx.JSCocoa.createClass_parentClass_('JSCocoaOutArgument2', 'JSCocoaOutArgument') - - var o = ctx.JSCocoaOutArgument2.instance - o.isOutArgument = true - if (arguments.length == 2) o.mateWithMemoryBuffer_atIndex_(arguments[0], arguments[1]) - - return o - } - - - function memoryBuffer(types) - { - var o = ctx.JSCocoaMemoryBuffer.instanceWithTypes(types) - o.isOutArgument = true - return o - } - - - // - // Dump the call stack with arguments.calle.caller (Called from JSCocoa) - // - // Eric Wendelin's Javascript stacktrace in any browser - // http://eriwen.com/javascript/js-stack-trace/ - // - function dumpCallStack() - { - var maxDumpDepth = 100 - var dumpDepth = 0 - var caller = arguments.callee.caller - // Skip ourselves - caller = caller.caller - - // Build call stack - var stack = [] - while (caller && dumpDepth < maxDumpDepth) - { - var fn = caller.toString() - var fname = fn.substring(fn.indexOf("function") + 9, fn.indexOf("(")) || "anonymous"; - var str = fname - if (caller.arguments.length) - { - str += ' (' - for (var i=0; i 0 && leftCount == rightCount) return { left : i, right : matchIndex } - } - return { left : -1, right : -1 } - } - - function trackRightFromOperator(stream, tokenIndex, operator) - { - var right = operator.right - var lastToken - while (right) - { - lastToken = right - right = right.rightParen || right.right - } - if (!lastToken) return -1 - var l = stream.length-1 - for (; tokenIndex' + transformed) - return transformed - } diff --git a/Cocoa/JSCocoa/jslint-jscocoa.js b/Cocoa/JSCocoa/jslint-jscocoa.js deleted file mode 100644 index daa8f8361..000000000 --- a/Cocoa/JSCocoa/jslint-jscocoa.js +++ /dev/null @@ -1,5686 +0,0 @@ -// jslint.js -// 2009-05-06 - - -/* -Copyright (c) 2002 Douglas Crockford (www.JSLint.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -The Software shall be used for Good, not Evil. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -/* - JSLINT is a global function. It takes two parameters. - - var myResult = JSLINT(source, option); - - The first parameter is either a string or an array of strings. If it is a - string, it will be split on '\n' or '\r'. If it is an array of strings, it - is assumed that each string represents one line. The source can be a - JavaScript text, or HTML text, or a Konfabulator text. - - The second parameter is an optional object of options which control the - operation of JSLINT. Most of the options are booleans: They are all are - optional and have a default value of false. - - If it checks out, JSLINT returns true. Otherwise, it returns false. - - If false, you can inspect JSLINT.errors to find out the problems. - JSLINT.errors is an array of objects containing these members: - - { - line : The line (relative to 0) at which the lint was found - character : The character (relative to 0) at which the lint was found - reason : The problem - evidence : The text line in which the problem occurred - raw : The raw message before the details were inserted - a : The first detail - b : The second detail - c : The third detail - d : The fourth detail - } - - If a fatal error was found, a null will be the last element of the - JSLINT.errors array. - - You can request a Function Report, which shows all of the functions - and the parameters and vars that they use. This can be used to find - implied global variables and other problems. The report is in HTML and - can be inserted in an HTML . - - var myReport = JSLINT.report(limited); - - If limited is true, then the report will be limited to only errors. -*/ - -/*jslint - evil: true, nomen: false, onevar: false, regexp: false , strict: true -*/ - -/*global JSLINT*/ - -/*members "\b", "\t", "\n", "\f", "\r", "\"", "%", "(begin)", - "(breakage)", "(context)", "(error)", "(global)", "(identifier)", - "(line)", "(loopage)", "(name)", "(onevar)", "(params)", "(scope)", - "(verb)", ")", "++", "--", "\/", ADSAFE, Array, Boolean, COM, Canvas, - CustomAnimation, Date, Debug, E, Error, EvalError, FadeAnimation, - Flash, FormField, Frame, Function, HotKey, Image, JSON, LN10, LN2, LOG10E, - LOG2E, MAX_VALUE, MIN_VALUE, Math, MenuItem, MoveAnimation, - NEGATIVE_INFINITY, Number, Object, Option, PI, POSITIVE_INFINITY, Point, - RangeError, Rectangle, ReferenceError, RegExp, ResizeAnimation, - RotateAnimation, SQRT1_2, SQRT2, ScrollBar, String, Style, SyntaxError, - System, Text, TextArea, Timer, TypeError, URIError, URL, Web, Window, - XMLDOM, XMLHttpRequest, "\\", "]", a, abbr, acronym, active, address, - adsafe, after, alert, aliceblue, animator, antiquewhite, appleScript, - applet, apply, approved, aqua, aquamarine, area, arguments, arity, - autocomplete, azure, b, background, "background-attachment", - "background-color", "background-image", "background-position", - "background-repeat", base, bdo, beep, before, beige, big, bisque, - bitwise, black, blanchedalmond, block, blockquote, blue, blueviolet, - blur, body, border, "border-bottom", "border-bottom-color", - "border-bottom-style", "border-bottom-width", "border-collapse", - "border-color", "border-left", "border-left-color", "border-left-style", - "border-left-width", "border-right", "border-right-color", - "border-right-style", "border-right-width", "border-spacing", - "border-style", "border-top", "border-top-color", "border-top-style", - "border-top-width", "border-width", bottom, br, brown, browser, - burlywood, button, bytesToUIString, c, cadetblue, call, callee, caller, - canvas, cap, caption, "caption-side", cases, center, charAt, charCodeAt, - character, chartreuse, chocolate, chooseColor, chooseFile, chooseFolder, - cite, clear, clearInterval, clearTimeout, clip, close, closeWidget, - closed, cm, code, col, colgroup, color, comment, condition, confirm, - console, constructor, content, convertPathToHFS, convertPathToPlatform, - coral, cornflowerblue, cornsilk, "counter-increment", "counter-reset", - create, crimson, css, cursor, cyan, d, darkblue, darkcyan, - darkgoldenrod, darkgray, darkgreen, darkkhaki, darkmagenta, - darkolivegreen, darkorange, darkorchid, darkred, darksalmon, - darkseagreen, darkslateblue, darkslategray, darkturquoise, darkviolet, - dd, debug, decodeURI, decodeURIComponent, deeppink, deepskyblue, - defaultStatus, defineClass, del, deserialize, dfn, dimgray, dir, - direction, display, div, dl, document, dodgerblue, dt, edition, else, em, - embed, empty, "empty-cells", encodeURI, encodeURIComponent, entityify, - eqeqeq, errors, escape, eval, event, evidence, evil, ex, exec, exps, - fieldset, filesystem, firebrick, first, "first-child", "first-letter", - "first-line", float, floor, floralwhite, focus, focusWidget, font, - "font-face", "font-family", "font-size", "font-size-adjust", - "font-stretch", "font-style", "font-variant", "font-weight", - forestgreen, forin, form, fragment, frame, frames, frameset, from, - fromCharCode, fuchsia, fud, funct, function, g, gainsboro, gc, - getComputedStyle, ghostwhite, gold, goldenrod, gray, green, greenyellow, - h1, h2, h3, h4, h5, h6, hasOwnProperty, head, height, help, history, - honeydew, hotpink, hover, hr, html, i, iTunes, id, identifier, iframe, - img, immed, import, in, include, indent, indexOf, indianred, indigo, - init, input, ins, isAlpha, isApplicationRunning, isDigit, isFinite, - isNaN, ivory, join, kbd, khaki, konfabulatorVersion, label, labelled, - lang, lavender, lavenderblush, lawngreen, laxbreak, lbp, led, left, - legend, lemonchiffon, length, "letter-spacing", li, lib, lightblue, - lightcoral, lightcyan, lightgoldenrodyellow, lightgreen, lightpink, - lightsalmon, lightseagreen, lightskyblue, lightslategray, - lightsteelblue, lightyellow, lime, limegreen, line, "line-height", - linen, link, "list-style", "list-style-image", "list-style-position", - "list-style-type", load, loadClass, location, log, m, magenta, map, - margin, "margin-bottom", "margin-left", "margin-right", "margin-top", - "marker-offset", maroon, match, "max-height", "max-width", md5, media, - mediumaquamarine, mediumblue, mediumorchid, mediumpurple, - mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, - mediumvioletred, menu, message, meta, midnightblue, "min-height", - "min-width", mintcream, mistyrose, mm, moccasin, moveBy, moveTo, name, - navajowhite, navigator, navy, new, newcap, noframes, nomen, noscript, - nud, object, ol, oldlace, olive, olivedrab, on, onblur, onerror, onevar, - onfocus, onload, onresize, onunload, opacity, open, openURL, opener, - opera, optgroup, option, orange, orangered, orchid, outer, outline, - "outline-color", "outline-style", "outline-width", overflow, p, padding, - "padding-bottom", "padding-left", "padding-right", "padding-top", page, - palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, - param, parent, parseFloat, parseInt, passfail, pc, peachpuff, peru, - pink, play, plum, plusplus, pop, popupMenu, position, powderblue, pre, - predef, preferenceGroups, preferences, print, prompt, prototype, pt, - purple, push, px, q, quit, quotes, random, range, raw, reach, readFile, - readUrl, reason, red, regexp, reloadWidget, replace, report, reserved, - resizeBy, resizeTo, resolvePath, resumeUpdates, rhino, right, rosybrown, - royalblue, runCommand, runCommandInBg, saddlebrown, safe, salmon, samp, - sandybrown, saveAs, savePreferences, screen, script, scroll, scrollBy, - scrollTo, seagreen, seal, search, seashell, select, self, serialize, - setInterval, setTimeout, shift, showWidgetPreferences, sidebar, sienna, - silver, skyblue, slateblue, slategray, sleep, slice, small, snow, sort, - span, spawn, speak, split, springgreen, src, status, steelblue, strict, - strong, style, styleproperty, sub, substr, sup, supplant, - suppressUpdates, sync, system, table, "table-layout", tan, tbody, td, - teal, tellWidget, test, "text-align", "text-decoration", "text-indent", - "text-shadow", "text-transform", textarea, tfoot, th, thead, thistle, - title, toLowerCase, toString, toUpperCase, toint32, token, tomato, top, - tr, tt, turquoise, type, u, ul, undef, unescape, "unicode-bidi", - unwatch, updateNow, value, valueOf, var, version, "vertical-align", - violet, visibility, visited, watch, wheat, white, "white-space", - whitesmoke, widget, width, window, "word-spacing", yahooCheckLogin, - yahooLogin, yahooLogout, yellow, yellowgreen, "z-index" -*/ - -// We build the application inside a function so that we produce only a single -// global variable. The function will be invoked, its return value is the JSLINT -// application itself. - -// http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ -"use strict"; - -function JSLintWithLogs(logs) -{ - var JSLINT - - var fn = function () {} - var logToken = logs.logToken || fn - var logParseStart = logs.logParseStart || fn - var logParseEnd = logs.logParseEnd || fn - var logFunctionStart= logs.logFunctionStart || fn - var logStatement = logs.logStatement || fn - var logFunctionEnd = logs.logFunctionEnd || fn - - // Things we need to replace - var logExtraSyntax = logs.logExtraSyntax || fn - - var logTokenLock = 0 - function disableLogToken() { logTokenLock++ } - function enableLogToken() { logTokenLock-- } - - -JSLINT = (function renamedJSLint () { - - // ## (internal) Guard against inner classes definitions - var parsingClass; - - var adsafe_id, // The widget's ADsafe id. - adsafe_may, // The widget may load approved scripts. - adsafe_went, // ADSAFE.go has been called. - anonname, // The guessed name for anonymous functions. - approved, // ADsafe approved urls. - - atrule = { - 'import' : true, - media : true, - 'font-face': true, - page : true - }, - -// These are members that should not be permitted in third party ads. - - banned = { // the member names that ADsafe prohibits. - apply : true, - 'arguments' : true, - call : true, - callee : true, - caller : true, - constructor : true, - 'eval' : true, - prototype : true, - unwatch : true, - valueOf : true, - watch : true - }, - - -// These are the JSLint boolean options. - - boolOptions = { - adsafe : true, // if ADsafe should be enforced - bitwise : true, // if bitwise operators should not be allowed - browser : true, // if the standard browser globals should be predefined - cap : true, // if upper case HTML should be allowed - css : true, // if CSS workarounds should be tolerated - debug : true, // if debugger statements should be allowed - eqeqeq : true, // if === should be required - evil : true, // if eval should be allowed - forin : true, // if for in statements must filter - fragment : true, // if HTML fragments should be allowed - immed : true, // if immediate invocations must be wrapped in parens - laxbreak : true, // if line breaks should not be checked - newcap : true, // if constructor names must be capitalized - nomen : true, // if names should be checked - on : true, // if HTML event handlers should be allowed - onevar : true, // if only one var statement per function should be allowed - passfail : true, // if the scan should stop on first error - plusplus : true, // if increment/decrement should not be allowed - regexp : true, // if the . should not be allowed in regexp literals - rhino : true, // if the Rhino environment globals should be predefined - undef : true, // if variables should be declared before used - safe : true, // if use of some browser features should be restricted - sidebar : true, // if the System object should be predefined - strict : true, // require the "use strict"; pragma - sub : true, // if all forms of subscript notation are tolerated - white : true, // if strict whitespace rules apply - widget : true // if the Yahoo Widgets globals should be predefined - }, - -// browser contains a set of global names which are commonly provided by a -// web browser environment. - - browser = { - alert : true, - blur : true, - clearInterval : true, - clearTimeout : true, - close : true, - closed : true, - confirm : true, - console : true, - Debug : true, - defaultStatus : true, - document : true, - event : true, - focus : true, - frames : true, - getComputedStyle: true, - history : true, - Image : true, - length : true, - location : true, - moveBy : true, - moveTo : true, - name : true, - navigator : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : true, - opener : true, - opera : true, - Option : true, - parent : true, - print : true, - prompt : true, - resizeBy : true, - resizeTo : true, - screen : true, - scroll : true, - scrollBy : true, - scrollTo : true, - setInterval : true, - setTimeout : true, - status : true, - top : true, - XMLHttpRequest : true - }, - - cssAttributeData, - cssAny, - - cssColorData = { - "aliceblue" : true, - "antiquewhite" : true, - "aqua" : true, - "aquamarine" : true, - "azure" : true, - "beige" : true, - "bisque" : true, - "black" : true, - "blanchedalmond" : true, - "blue" : true, - "blueviolet" : true, - "brown" : true, - "burlywood" : true, - "cadetblue" : true, - "chartreuse" : true, - "chocolate" : true, - "coral" : true, - "cornflowerblue" : true, - "cornsilk" : true, - "crimson" : true, - "cyan" : true, - "darkblue" : true, - "darkcyan" : true, - "darkgoldenrod" : true, - "darkgray" : true, - "darkgreen" : true, - "darkkhaki" : true, - "darkmagenta" : true, - "darkolivegreen" : true, - "darkorange" : true, - "darkorchid" : true, - "darkred" : true, - "darksalmon" : true, - "darkseagreen" : true, - "darkslateblue" : true, - "darkslategray" : true, - "darkturquoise" : true, - "darkviolet" : true, - "deeppink" : true, - "deepskyblue" : true, - "dimgray" : true, - "dodgerblue" : true, - "firebrick" : true, - "floralwhite" : true, - "forestgreen" : true, - "fuchsia" : true, - "gainsboro" : true, - "ghostwhite" : true, - "gold" : true, - "goldenrod" : true, - "gray" : true, - "green" : true, - "greenyellow" : true, - "honeydew" : true, - "hotpink" : true, - "indianred" : true, - "indigo" : true, - "ivory" : true, - "khaki" : true, - "lavender" : true, - "lavenderblush" : true, - "lawngreen" : true, - "lemonchiffon" : true, - "lightblue" : true, - "lightcoral" : true, - "lightcyan" : true, - "lightgoldenrodyellow" : true, - "lightgreen" : true, - "lightpink" : true, - "lightsalmon" : true, - "lightseagreen" : true, - "lightskyblue" : true, - "lightslategray" : true, - "lightsteelblue" : true, - "lightyellow" : true, - "lime" : true, - "limegreen" : true, - "linen" : true, - "magenta" : true, - "maroon" : true, - "mediumaquamarine" : true, - "mediumblue" : true, - "mediumorchid" : true, - "mediumpurple" : true, - "mediumseagreen" : true, - "mediumslateblue" : true, - "mediumspringgreen" : true, - "mediumturquoise" : true, - "mediumvioletred" : true, - "midnightblue" : true, - "mintcream" : true, - "mistyrose" : true, - "moccasin" : true, - "navajowhite" : true, - "navy" : true, - "oldlace" : true, - "olive" : true, - "olivedrab" : true, - "orange" : true, - "orangered" : true, - "orchid" : true, - "palegoldenrod" : true, - "palegreen" : true, - "paleturquoise" : true, - "palevioletred" : true, - "papayawhip" : true, - "peachpuff" : true, - "peru" : true, - "pink" : true, - "plum" : true, - "powderblue" : true, - "purple" : true, - "red" : true, - "rosybrown" : true, - "royalblue" : true, - "saddlebrown" : true, - "salmon" : true, - "sandybrown" : true, - "seagreen" : true, - "seashell" : true, - "sienna" : true, - "silver" : true, - "skyblue" : true, - "slateblue" : true, - "slategray" : true, - "snow" : true, - "springgreen" : true, - "steelblue" : true, - "tan" : true, - "teal" : true, - "thistle" : true, - "tomato" : true, - "turquoise" : true, - "violet" : true, - "wheat" : true, - "white" : true, - "whitesmoke" : true, - "yellow" : true, - "yellowgreen" : true - }, - - cssBorderStyle, - - cssLengthData = { - '%': true, - 'cm': true, - 'em': true, - 'ex': true, - 'in': true, - 'mm': true, - 'pc': true, - 'pt': true, - 'px': true - }, - - escapes = { - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '/' : '\\/', - '\\': '\\\\' - }, - - funct, // The current function - functions, // All of the functions - - global, // The global scope - htmltag = { - a: {}, - abbr: {}, - acronym: {}, - address: {}, - applet: {}, - area: {empty: true, parent: ' map '}, - b: {}, - base: {empty: true, parent: ' head '}, - bdo: {}, - big: {}, - blockquote: {}, - body: {parent: ' html noframes '}, - br: {empty: true}, - button: {}, - canvas: {parent: ' body p div th td '}, - caption: {parent: ' table '}, - center: {}, - cite: {}, - code: {}, - col: {empty: true, parent: ' table colgroup '}, - colgroup: {parent: ' table '}, - dd: {parent: ' dl '}, - del: {}, - dfn: {}, - dir: {}, - div: {}, - dl: {}, - dt: {parent: ' dl '}, - em: {}, - embed: {}, - fieldset: {}, - font: {}, - form: {}, - frame: {empty: true, parent: ' frameset '}, - frameset: {parent: ' html frameset '}, - h1: {}, - h2: {}, - h3: {}, - h4: {}, - h5: {}, - h6: {}, - head: {parent: ' html '}, - html: {parent: '*'}, - hr: {empty: true}, - i: {}, - iframe: {}, - img: {empty: true}, - input: {empty: true}, - ins: {}, - kbd: {}, - label: {}, - legend: {parent: ' fieldset '}, - li: {parent: ' dir menu ol ul '}, - link: {empty: true, parent: ' head '}, - map: {}, - menu: {}, - meta: {empty: true, parent: ' head noframes noscript '}, - noframes: {parent: ' html body '}, - noscript: {parent: ' body head noframes '}, - object: {}, - ol: {}, - optgroup: {parent: ' select '}, - option: {parent: ' optgroup select '}, - p: {}, - param: {empty: true, parent: ' applet object '}, - pre: {}, - q: {}, - samp: {}, - script: {empty: true, parent: ' body div frame head iframe p pre span '}, - select: {}, - small: {}, - span: {}, - strong: {}, - style: {parent: ' head ', empty: true}, - sub: {}, - sup: {}, - table: {}, - tbody: {parent: ' table '}, - td: {parent: ' tr '}, - textarea: {}, - tfoot: {parent: ' table '}, - th: {parent: ' tr '}, - thead: {parent: ' table '}, - title: {parent: ' head '}, - tr: {parent: ' table tbody thead tfoot '}, - tt: {}, - u: {}, - ul: {}, - 'var': {} - }, - - ids, // HTML ids - implied, // Implied globals - inblock, - indent, - jsonmode, - lines, - lookahead, - member, - membersOnly, - nexttoken, - noreach, - option, - predefined, // Global variables defined by option - prereg, - prevtoken, - - pseudorule = { - 'first-child': true, - link : true, - visited : true, - hover : true, - active : true, - focus : true, - lang : true, - 'first-letter' : true, - 'first-line' : true, - before : true, - after : true - }, - - rhino = { - defineClass : true, - deserialize : true, - gc : true, - help : true, - load : true, - loadClass : true, - print : true, - quit : true, - readFile : true, - readUrl : true, - runCommand : true, - seal : true, - serialize : true, - spawn : true, - sync : true, - toint32 : true, - version : true - }, - - scope, // The current scope - - sidebar = { - System : true - }, - - src, - stack, - -// standard contains the global names that are provided by the -// ECMAScript standard. - - standard = { - Array : true, - Boolean : true, - Date : true, - decodeURI : true, - decodeURIComponent : true, - encodeURI : true, - encodeURIComponent : true, - Error : true, - 'eval' : true, - EvalError : true, - Function : true, - isFinite : true, - isNaN : true, - JSON : true, - Math : true, - Number : true, - Object : true, - parseInt : true, - parseFloat : true, - RangeError : true, - ReferenceError : true, - RegExp : true, - String : true, - SyntaxError : true, - TypeError : true, - URIError : true - }, - - standard_member = { - E : true, - LN2 : true, - LN10 : true, - LOG2E : true, - LOG10E : true, - PI : true, - SQRT1_2 : true, - SQRT2 : true, - MAX_VALUE : true, - MIN_VALUE : true, - NEGATIVE_INFINITY : true, - POSITIVE_INFINITY : true - }, - - syntax = {}, - tab, - token, - urls, - warnings, - -// widget contains the global names which are provided to a Yahoo -// (fna Konfabulator) widget. - - widget = { - alert : true, - animator : true, - appleScript : true, - beep : true, - bytesToUIString : true, - Canvas : true, - chooseColor : true, - chooseFile : true, - chooseFolder : true, - closeWidget : true, - COM : true, - convertPathToHFS : true, - convertPathToPlatform : true, - CustomAnimation : true, - escape : true, - FadeAnimation : true, - filesystem : true, - Flash : true, - focusWidget : true, - form : true, - FormField : true, - Frame : true, - HotKey : true, - Image : true, - include : true, - isApplicationRunning : true, - iTunes : true, - konfabulatorVersion : true, - log : true, - md5 : true, - MenuItem : true, - MoveAnimation : true, - openURL : true, - play : true, - Point : true, - popupMenu : true, - preferenceGroups : true, - preferences : true, - print : true, - prompt : true, - random : true, - Rectangle : true, - reloadWidget : true, - ResizeAnimation : true, - resolvePath : true, - resumeUpdates : true, - RotateAnimation : true, - runCommand : true, - runCommandInBg : true, - saveAs : true, - savePreferences : true, - screen : true, - ScrollBar : true, - showWidgetPreferences : true, - sleep : true, - speak : true, - Style : true, - suppressUpdates : true, - system : true, - tellWidget : true, - Text : true, - TextArea : true, - Timer : true, - unescape : true, - updateNow : true, - URL : true, - Web : true, - widget : true, - Window : true, - XMLDOM : true, - XMLHttpRequest : true, - yahooCheckLogin : true, - yahooLogin : true, - yahooLogout : true - }, - -// xmode is used to adapt to the exceptions in html parsing. -// It can have these states: -// false .js script file -// html -// outer -// script -// style -// scriptstring -// styleproperty - - xmode, - xquote, - -// unsafe comment or string - ax = /@cc|<\/?|script|\]*s\]|<\s*!|</i, -// unsafe characters that are silently deleted by one or more browsers - cx = /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/, -// token -// tx = /^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/(\*(global|extern|jslint|member|members)?|=|\/)?|\*[\/=]?|\+[+=]?|-[\-=]?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/, - // ## Allow unicode identifiers as characters having a charcode > 0xc0. - // That's too broad. Maybe check if eval('var supposedIdentifier') throws ? - // added ext >?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z\u00c0-\uffff_$][a-zA-Z0-9\u00c0-\uffff_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/, - - tx = function () - { -// var a = /^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/(\*(global|extern|jslint|member|members)?|=|\/)?|\*[\/=]?|\+[+=]?|-[\-=]?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z\u00c0-\uffff_$][a-zA-Z0-9\u00c0-\uffff_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/ -// var r = "^\\s*([()}.,:;'\"~\\?\\]#@]|\\[\\+\\]|\\[|{\\+}|@implementation|@end|@selector|@|ƒ|{|==?=?|\\/(\\*(global|extern|jslint|member|members)?|=|\\/)?|\\*[\\/=]?|\\+[+=]?|-[\\-=]?|%=?|&[&=]?|\\|[|=]?|>>?>?=?|<([\\/=!]|<=?)?|\\^=?|\\!=?=?|[a-zA-Z\\u00c0-\\uffff_$][a-zA-Z0-9\\u00c0-\\uffff_$]*|[0-9]+([xX][0-9a-fA-F]+|\\.[0-9]*)?([eE][+\\-]?[0-9]+)?)" - var r = "^\\s*([()}.,:;'\"~\\?\\]#]|\\[\\+\\]|\\[|{\\+}|@=|@implementation|@end|@selector|@|ƒ|{|==?=?|\\/(\\*|=|\\/)?|\\*[\\/=]?|\\+[+=]?|-[\\-=]?|%=?|&[&=]?|\\|[|=]?|>>?>?=?|<([\\/=!]|<=?)?|\\^=?|\\!=?=?|[a-zA-Z\\u00c0-\\uffff_$][a-zA-Z0-9\\u00c0-\\uffff_$]*|[0-9]+([xX][0-9a-fA-F]+|\\.[0-9]*)?([eE][+\\-]?[0-9]+)?)" - return new RegExp(r) - - }(), -/* - tx = -^\s*([(){}\[.,:;'"~\?\]#@] -==?=? -\/(\*(global -extern -jslint -member -members)? -= -\/)? -\*[\/=]? -\+[+=]? --[\-=]? -%=? -&[&=]? -\ -[ -=]? ->>?>?=? -<([\/=!] -\!(\[ ---)? -<=?)? -\^=? -\!=?=? -[a-zA-Z\u00c0-\uffff_$][a-zA-Z0-9\u00c0-\uffff_$]* -[0-9]+([xX][0-9a-fA-F]+ -\.[0-9]*)?([eE][+\-]?[0-9]+)?) - -*/ - -// html token - hx = /^\s*(['"=>\/&#]|<(?:\/|\!(?:--)?)?|[a-zA-Z][a-zA-Z0-9_\-]*|[0-9]+|--|.)/, -// characters in strings that need escapement - nx = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/, - nxg = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, -// outer html token - ox = /[>&]|<[\/!]?|--/, -// star slash - lx = /\*\/|\/\*/, -// identifier -// ix = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/, - // ## unicode identifier grossfix - ix = /^([A-Z_$\u00c0-\uffff][a-zA-Z0-9_$]*)$/, -// javascript url - jx = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i, -// url badness - ux = /&|\+|\u00AD|\.\.|\/\*|%[^;]|base64|url|expression|data|mailto/i, -// style - sx = /^\s*([{:#*%.=,>+\[\]@()"';*]|[a-zA-Z0-9_][a-zA-Z0-9_\-]*|<\/|\/\*)/, - ssx = /^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/, -// attributes characters - qx = /[^a-zA-Z0-9-_\/ ]/, -// query characters for ids - dx = /[\[\]\/\\"'*<>.&:(){}+=#]/, - - rx = { - outer: hx, - html: hx, - style: sx, - styleproperty: ssx - }; - - function F() {} - - if (typeof Object.create !== 'function') { - Object.create = function (o) { - F.prototype = o; - return new F(); - }; - } - - function combine(t, o) { - var n; - for (n in o) { - if (o.hasOwnProperty(n)) { - t[n] = o[n]; - } - } - } - - String.prototype.entityify = function () { - return this. - replace(/&/g, '&'). - replace(//g, '>'); - }; - - String.prototype.isAlpha = function () { - return (this >= 'a' && this <= 'z\uffff') || - (this >= 'A' && this <= 'Z\uffff'); - }; - - - String.prototype.isDigit = function () { - return (this >= '0' && this <= '9'); - }; - - - String.prototype.supplant = function (o) { - return this.replace(/\{([^{}]*)\}/g, function (a, b) { - var r = o[b]; - return typeof r === 'string' || typeof r === 'number' ? r : a; - }); - }; - - String.prototype.name = function () { - -// If the string looks like an identifier, then we can return it as is. -// If the string contains no control characters, no quote characters, and no -// backslash characters, then we can simply slap some quotes around it. -// Otherwise we must also replace the offending characters with safe -// sequences. - - if (ix.test(this)) { - return this; - } - if (nx.test(this)) { - return '"' + this.replace(nxg, function (a) { - var c = escapes[a]; - if (c) { - return c; - } - return '\\u' + ('0000' + a.charCodeAt().toString(16)).slice(-4); - }) + '"'; - } - return '"' + this + '"'; - }; - - - function assume() { - if (!option.safe) { - if (option.rhino) { - combine(predefined, rhino); - } - if (option.browser || option.sidebar) { - combine(predefined, browser); - } - if (option.sidebar) { - combine(predefined, sidebar); - } - if (option.widget) { - combine(predefined, widget); - } - } - } - - -// Produce an error warning. - - function quit(m, l, ch) { - throw { - name: 'JSLintError', - line: l, - character: ch, - message: m + " (" + Math.floor((l / lines.length) * 100) + - "% scanned)." - }; - } - - function warning(m, t, a, b, c, d) { - var ch, l, w; - t = t || nexttoken; - if (t.id === '(end)') { // `~ - t = token; - } - l = t.line || 0; - ch = t.from || 0; - w = { - id: '(error)', - raw: m, - evidence: lines[l] || '', - line: l, - character: ch, - a: a, - b: b, - c: c, - d: d - }; - w.reason = m.supplant(w); - JSLINT.errors.push(w); - if (option.passfail) { - quit('Stopping. ', l, ch); - } -/* - warnings += 1; - if (warnings === 50) { - quit("Too many errors.", l, ch); - } -*/ - return w; - } - - function warningAt(m, l, ch, a, b, c, d) { - return warning(m, { - line: l, - from: ch - }, a, b, c, d); - } - - function error(m, t, a, b, c, d) { - var w = warning(m, t, a, b, c, d); - quit("Stopping, unable to continue.", w.line, w.character); - } - - function errorAt(m, l, ch, a, b, c, d) { - return error(m, { - line: l, - from: ch - }, a, b, c, d); - } - - - -// lexical analysis - - var lex = (function lex() { - var character, from, line, s; - -// Private lex methods - - function nextLine() { - var at; - line += 1; - if (line >= lines.length) { - return false; - } - character = 0; - //## keep tabs -// s = lines[line].replace(/\t/g, tab); - s = lines[line] -/* at = s.search(cx); - if (at >= 0) { - warningAt("Unsafe character.", line, at); - }*/ - return true; - } - -// Produce a token object. The token inherits from a syntax symbol. - - function it(type, value) { - var i, t; - if (type === '(color)') { - t = {type: type}; - } else if (type === '(punctuator)' || - (type === '(identifier)' && syntax.hasOwnProperty(value))) { - t = syntax[value] || syntax['(error)']; - -// Mozilla bug workaround. - - if (!t.id) { - t = syntax[type]; - } - } else { - t = syntax[type]; - } - t = Object.create(t); - if (type === '(string)' || type === '(range)') { - if (jx.test(value)) { - warningAt("Script URL.", line, from); - } - } - if (type === '(identifier)') { - t.identifier = true; - if (option.nomen && value.charAt(0) === '_') { - warningAt("Unexpected '_' in '{a}'.", line, from, value); - } - } - t.value = value; - t.line = line; - t.character = character; - t.from = from; -//alert('NEWTOKEN\ntype=' + type + '\nvalue=' + value + '\nfrom=' + t.from + '\ncharacter=' + t.character) - i = t.id; - if (i !== '(endline)') { - prereg = i && - (('(,=:[!&|?{};'.indexOf(i.charAt(i.length - 1)) >= 0) || - i === 'return'); - } - return t; - } - -// Public lex methods - - return { - init: function (source) { - if (typeof source === 'string') { - lines = source. - replace(/\r\n/g, '\n'). - replace(/\r/g, '\n'). - split('\n'); - } else { - lines = source; - } - line = -1; - nextLine(); - from = 0; - }, - - range: function (begin, end) { - var c, value = ''; - from = character; - if (s.charAt(0) !== begin) { - errorAt("Expected '{a}' and instead saw '{b}'.", - line, character, begin, s.charAt(0)); - } - for (;;) { - s = s.slice(1); - character += 1; - c = s.charAt(0); - switch (c) { - case '': - errorAt("Missing '{a}'.", line, character, c); - break; - case end: - s = s.slice(1); - character += 1; - return it('(range)', value); - case xquote: - case '\\': - case '\'': - case '"': - warningAt("Unexpected '{a}'.", line, character, c); - } - value += c; - } - - }, - -// token -- this is called by advance to get the next token. - - token: function () { - var b, c, captures, d, depth, high, i, l, low, q, t; - - function match(x) { - var r = x.exec(s), r1; - if (r) { - l = r[0].length; - r1 = r[1]; - c = r1.charAt(0); - s = s.substr(l); - character += l; - from = character - r1.length; - return r1; - } - } - - function string(x) { - var c, j, r = ''; - - if (jsonmode && x !== '"') { - warningAt("Strings must use doublequote.", - line, character); - } - - if (xquote === x || (xmode === 'scriptstring' && !xquote)) { - return it('(punctuator)', x); - } - - function esc(n) { - var i = parseInt(s.substr(j + 1, n), 16); - j += n; - if (i >= 32 && i <= 126 && - i !== 34 && i !== 92 && i !== 39) { - warningAt("Unnecessary escapement.", line, character); - } - character += n; - c = String.fromCharCode(i); - } - j = 0; - for (;;) { - while (j >= s.length) { - j = 0; - if (xmode !== 'html' || !nextLine()) { - errorAt("Unclosed string.", line, from); - } - } - c = s.charAt(j); - if (c === x) { - character += 1; - s = s.substr(j + 1); - return it('(string)', r, x); - } - if (c < ' ') { -/* -## Why exit on newlines ? - if (c === '\n' || c === '\r') { - break; - } - warningAt("Control character in string: {a}.", - line, character + j, s.slice(0, j)); -*/ - } else if (c === xquote) { - warningAt("Bad HTML string", line, character + j); - } else if (c === '<') { - if (option.safe && xmode === 'html') { - warningAt("ADsafe string violation.", - line, character + j); - } else if (s.charAt(j + 1) === '/' && (xmode || option.safe)) { - warningAt("Expected '<\\/' and instead saw ' 0) { - character += 1; - s = s.slice(i); - break; - } else { - if (!nextLine()) { - return it('(end)', ''); - } - } - } - t = match(rx[xmode] || tx); - if (!t) { - if (xmode === 'html') { - return it('(error)', s.charAt(0)); - } else { - t = ''; - c = ''; - while (s && s < '!') { - s = s.substr(1); - } - if (s) { - errorAt("Unexpected '{a}'.", - line, character, s.substr(0, 1)); - } - } - } else { - - // identifier - - if (c.isAlpha() || c === '_' || c === '$' /* ## unicode identifier grossfix */|| c >= '\u00c0') { - return it('(identifier)', t); - } - - // number - - if (c.isDigit()) { - if (xmode !== 'style' && !isFinite(Number(t))) { - warningAt("Bad number '{a}'.", - line, character, t); - } - if (xmode !== 'styleproperty' && s.substr(0, 1).isAlpha()) { - warningAt("Missing space after '{a}'.", - line, character, t); - } - if (c === '0') { - d = t.substr(1, 1); - if (d.isDigit()) { - if (token.id !== '.' && xmode !== 'styleproperty') { - warningAt("Don't use extra leading zeros '{a}'.", - line, character, t); - } - } else if (jsonmode && (d === 'x' || d === 'X')) { - warningAt("Avoid 0x-. '{a}'.", - line, character, t); - } - } - if (t.substr(t.length - 1) === '.') { - warningAt( - "A trailing decimal point can be confused with a dot '{a}'.", - line, character, t); - } - return it('(number)', t); - } - switch (t) { - - // string - - case '"': - case "'": - return string(t); - // // comment - - case '//': - if (src || (xmode && xmode !== 'script')) { - warningAt("Unexpected comment.", line, character); - } else if (xmode === 'script' && /<\s*\//i.test(s)) { - warningAt("Unexpected <\/ in comment.", line, character); - } else if ((option.safe || xmode === 'script') && ax.test(s)) { - warningAt("Dangerous comment.", line, character); - } - // ## notify of comment token - var v = lines[line].substr(from, s.length) - var c = lines[line].length-1 - if (!s.match(/\n/)) - c++ - if (!logTokenLock) - { - var t = { type : '(comment)', line : line, from : from, value : v, character : c } - t.rawValue = lines[t.line] ? lines[t.line].substr(t.from, t.character-t.from) : '' - logToken(t) - } - s = ''; - token.comment = true; - break; - - // /* comment - - case '/*': - if (src || (xmode && xmode !== 'script' && xmode !== 'style' && xmode !== 'styleproperty')) { - warningAt("Unexpected comment.", line, character); - } - if (option.safe && ax.test(s)) { - warningAt("ADsafe comment violation.", line, character); - } - var commentLineIndex = 0 - var firstCommentPrefix = '/*' - // First line misses '*' in '/*' - for (;;) { - i = s.search(lx); - if (i >= 0) { - // ## notify of comment token - // Last line of comment -// var h = !commentLineIndex ? from : 0 - var v = firstCommentPrefix+s.substr(0, i+2) - if (!logTokenLock) - { - var t = { type : '(comment)', line : line, from : from, value : v, character: from+v.length } - t.rawValue = lines[t.line] ? lines[t.line].substr(t.from, t.character-t.from) : '' - logToken(t) - } - break; - } - else - { - // ## - // All comment lines but the last one go through here - var c = lines[line].substr(from).length - if (commentLineIndex == 0) c += firstCommentPrefix.length - if (!logTokenLock) - { - var t = { type : '(comment)', line : line, from : from, value : firstCommentPrefix + s, character : c+from } - t.rawValue = lines[t.line] ? lines[t.line].substr(t.from, t.character-t.from) : '' - logToken(t) - logToken( { id : '(endline)' } ) - } - from = 0 - } - if (!nextLine()) { - errorAt("Unclosed comment.", line, character); - } else { - if (option.safe && ax.test(s)) { - warningAt("ADsafe comment violation.", line, character); - } - } - commentLineIndex++ - firstCommentPrefix = '' - } - character += i + 2; - if (s.substr(i, 1) === '/') { - errorAt("Nested comment.", line, character); - } - s = s.substr(i + 2); - token.comment = true; - break; - - // /*global /*extern /*members /*jslint */ - - case '/*global': - case '/*extern': - case '/*members': - case '/*member': - case '/*jslint': - case '*/': - return { - value: t, - type: 'special', - line: line, - character: character, - from: from - }; - - case '': - break; - // / - case '/': - if (prereg) { - depth = 0; - captures = 0; - l = 0; - for (;;) { - b = true; - c = s.charAt(l); - l += 1; - switch (c) { - case '': - errorAt("Unclosed regular expression.", line, from); - return; - case '/': - if (depth > 0) { - warningAt("Unescaped '{a}'.", line, from + l, '/'); - } - c = s.substr(0, l - 1); - q = { - g: true, - i: true, - m: true - }; - while (q[s.charAt(l)] === true) { - q[s.charAt(l)] = false; - l += 1; - } - character += l; - s = s.substr(l); - return it('(regexp)', c); - case '\\': - c = s.charAt(l); - if (c < ' ') { - warningAt("Unexpected control character in regular expression.", line, from + l); - } else if (c === '<') { - warningAt("Unexpected escaped character '{a}' in regular expression.", line, from + l, c); - } - l += 1; - break; - case '(': - depth += 1; - b = false; - if (s.charAt(l) === '?') { - l += 1; - switch (s.charAt(l)) { - case ':': - case '=': - case '!': - l += 1; - break; - default: - warningAt("Expected '{a}' and instead saw '{b}'.", line, from + l, ':', s.charAt(l)); - } - } else { - captures += 1; - } - break; - case ')': - if (depth === 0) { - warningAt("Unescaped '{a}'.", line, from + l, ')'); - } else { - depth -= 1; - } - break; - case ' ': - q = 1; - while (s.charAt(l) === ' ') { - l += 1; - q += 1; - } - if (q > 1) { - warningAt("Spaces are hard to count. Use {{a}}.", line, from + l, q); - } - break; - case '[': - if (s.charAt(l) === '^') { - l += 1; - } - q = false; - klass: do { - c = s.charAt(l); - l += 1; - switch (c) { - case '[': - case '^': - warningAt("Unescaped '{a}'.", line, from + l, c); - q = true; - break; - case '-': - if (q) { - q = false; - } else { - warningAt("Unescaped '{a}'.", line, from + l, '-'); - q = true; - } - break; - case ']': - if (!q) { - warningAt("Unescaped '{a}'.", line, from + l - 1, '-'); - } - break klass; - case '\\': - c = s.charAt(l); - if (c < ' ') { - warningAt("Unexpected control character in regular expression.", line, from + l); - } else if (c === '<') { - warningAt("Unexpected escaped character '{a}' in regular expression.", line, from + l, c); - } - l += 1; - q = true; - break; - case '/': - warningAt("Unescaped '{a}'.", line, from + l - 1, '/'); - q = true; - break; - case '<': - if (xmode === 'script') { - c = s.charAt(l); - if (c === '!' || c === '/') { - warningAt("HTML confusion in regular expression '<{a}'.", line, from + l, c); - } - } - q = true; - break; - default: - q = true; - } - } while (c); - break; - case '.': - if (option.regexp) { - warningAt("Unexpected '{a}'.", line, from + l, c); - } - break; - case ']': - case '?': - case '{': - case '}': - case '+': - case '*': - warningAt("Unescaped '{a}'.", line, from + l, c); - break; - case '<': - if (xmode === 'script') { - c = s.charAt(l); - if (c === '!' || c === '/') { - warningAt("HTML confusion in regular expression '<{a}'.", line, from + l, c); - } - } - } - if (b) { - switch (s.charAt(l)) { - case '?': - case '+': - case '*': - l += 1; - if (s.charAt(l) === '?') { - l += 1; - } - break; - case '{': - l += 1; - c = s.charAt(l); - if (c < '0' || c > '9') { - warningAt("Expected a number and instead saw '{a}'.", line, from + l, c); - } - l += 1; - low = +c; - for (;;) { - c = s.charAt(l); - if (c < '0' || c > '9') { - break; - } - l += 1; - low = +c + (low * 10); - } - high = low; - if (c === ',') { - l += 1; - high = Infinity; - c = s.charAt(l); - if (c >= '0' && c <= '9') { - l += 1; - high = +c; - for (;;) { - c = s.charAt(l); - if (c < '0' || c > '9') { - break; - } - l += 1; - high = +c + (high * 10); - } - } - } - if (s.charAt(l) !== '}') { - warningAt("Expected '{a}' and instead saw '{b}'.", line, from + l, '}', c); - } else { - l += 1; - } - if (s.charAt(l) === '?') { - l += 1; - } - if (low > high) { - warningAt("'{a}' should not be greater than '{b}'.", line, from + l, low, high); - } - } - } - } - c = s.substr(0, l - 1); - character += l; - s = s.substr(l); - return it('(regexp)', c); - } - return it('(punctuator)', t); - - // punctuator - - case '#': - if (xmode === 'html' || xmode === 'styleproperty') { - for (;;) { - c = s.charAt(0); - if ((c < '0' || c > '9') && - (c < 'a' || c > 'f') && - (c < 'A' || c > 'F')) { - break; - } - character += 1; - s = s.substr(1); - t += c; - } - if (t.length !== 4 && t.length !== 7) { - warningAt("Bad hex color '{a}'.", line, - from + l, t); - } - return it('(color)', t); - } - return it('(punctuator)', t); - default: - if (xmode === 'outer' && c === '&') { - character += 1; - s = s.substr(1); - for (;;) { - c = s.charAt(0); - character += 1; - s = s.substr(1); - if (c === ';') { - break; - } - if (!((c >= '0' && c <= '9') || - (c >= 'a' && c <= 'z') || - c === '#')) { - errorAt("Bad entity", line, from + l, - character); - } - } - break; - } - return it('(punctuator)', t); - } - } - } - } - }; - }()); - - - function addlabel(t, type) { - - if (t === 'hasOwnProperty') { - error("'hasOwnProperty' is a really bad name."); - } - if (option.safe && funct['(global)']) { - warning('ADsafe global: ' + t + '.', token); - } - -// Define t in the current function in the current scope. -/* - // ## disabled. I like my redefining. - if (funct.hasOwnProperty(t)) { - warning(funct[t] === true ? - "'{a}' was used before it was defined." : - "'{a}' is already defined.", - nexttoken, t); - } -*/ - funct[t] = type; - if (type === 'label') { - scope[t] = funct; - } else if (funct['(global)']) { - global[t] = funct; -/* - // ## commented out - if (implied.hasOwnProperty(t)) { - // This one won't allow - // Define a function Fn1, use global var SomeVar - // define someVar - // call Fn1 - warning("'{a}' was used before it was defined.", nexttoken, t); - delete implied[t]; - } -*/ - } else { - funct['(scope)'][t] = funct; - } - } - - - function doOption() { - var b, obj, filter, o = nexttoken.value, t, v; - switch (o) { - case '*/': - error("Unbegun comment."); - break; - case '/*global': - case '/*extern': - if (option.safe) { - warning("ADsafe restriction."); - } - obj = predefined; - break; - case '/*members': - case '/*member': - o = '/*members'; - if (!membersOnly) { - membersOnly = {}; - } - obj = membersOnly; - break; - case '/*jslint': - if (option.safe) { - warning("ADsafe restriction."); - } - obj = option; - filter = boolOptions; - } - for (;;) { - t = lex.token(); - if (t.id === ',') { - t = lex.token(); - } - while (t.id === '(endline)') { - t = lex.token(); - } - if (t.type === 'special' && t.value === '*/') { - break; - } - if (t.type !== '(string)' && t.type !== '(identifier)' && - o !== '/*members') { - error("Bad option.", t); - } - if (filter) { - if (filter[t.value] !== true && t.value !== 'indent') { - error("Bad option.", t); - } - v = lex.token(); - if (v.id !== ':') { - error("Expected '{a}' and instead saw '{b}'.", - t, ':', t.value); - } - v = lex.token(); - if (t.value === 'indent') { - b = +v.value; - if (typeof b !== 'number' || !isFinite(b) || b <= 0 || - Math.floor(b) !== b) { - error("Expected a small integer and instead saw '{a}'.", - v, v.value); - } - obj.white = true; - } else if (v.value === 'true') { - b = true; - } else if (v.value === 'false') { - b = false; - } else { - error("Expected '{a}' and instead saw '{b}'.", - t, 'true', t.value); - } - } else { - b = true; - } - obj[t.value] = b; - } - if (filter) { - assume(); - } - } - - -// We need a peek function. If it has an argument, it peeks that much farther -// ahead. It is used to distinguish -// for ( var i in ... -// from -// for ( var i = ... - - function peek(p) { - var i = p || 0, j = 0, t; - - while (j <= i) { - t = lookahead[j]; - if (!t) { - t = lookahead[j] = lex.token(); - } - j += 1; - } - return t; - } - - - -// Produce the next token. It looks for programming errors. - - function advance(id, t) { - switch (token.id) { - case '(number)': - if (nexttoken.id === '.') { - warning("A dot following a number can be confused with a decimal point.", token); - } - break; - case '-': - if (nexttoken.id === '-' || nexttoken.id === '--') { - warning("Confusing minusses."); - } - break; - case '+': - if (nexttoken.id === '+' || nexttoken.id === '++') { - warning("Confusing plusses."); - } - break; - } - if (token.type === '(string)' || token.identifier) { - anonname = token.value; - } - - if (id && nexttoken.id !== id) { - if (t) { - if (nexttoken.id === '(end)') { - warning("Unmatched '{a}'.", t, t.id); - } else { - warning("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - nexttoken, id, t.id, t.line + 1, nexttoken.value); - } - } else if (nexttoken.type !== '(identifier)' || - nexttoken.value !== id) { - warning("Expected '{a}' and instead saw '{b}'.", - nexttoken, id, nexttoken.value); - } - } - prevtoken = token; - token = nexttoken; - for (;;) { - nexttoken = lookahead.shift() || lex.token(); - // ## notify of new token - if (!logTokenLock) - { - nexttoken.rawValue = lines[nexttoken.line] ? lines[nexttoken.line].substr(nexttoken.from, nexttoken.character-nexttoken.from) : '' - logToken(nexttoken) - } - if (nexttoken.id === '(end)' || nexttoken.id === '(error)') { - return; - } - if (nexttoken.type === 'special') { - doOption(); - } else { - if (nexttoken.id !== '(endline)') { - break; - } - } - } - if (!option.evil && nexttoken.value === 'eval') { - warning("eval is evil.", nexttoken); - } - } - -// This is the heart of JSLINT, the Pratt parser. In addition to parsing, it -// is looking for ad hoc lint patterns. We add to Pratt's model .fud, which is -// like nud except that it is only used on the first token of a statement. -// Having .fud makes it much easier to define JavaScript. I retained Pratt's -// nomenclature. - -// .nud Null denotation -// .fud First null denotation -// .led Left denotation -// lbp Left binding power -// rbp Right binding power - -// They are key to the parsing method called Top Down Operator Precedence. -/* -// http://javascript.crockford.com/tdop/tdop.html -;; NUD -- NUll left Denotation (op has nothing to its left (prefix)) -;; LED -- LEft Denotation (op has something to left (postfix or infix)) - -;; LBP -- Left Binding Power (the stickiness to the left) -;; RBP -- Right Binding Power (the stickiness to the right) - -*/ - function parse(rbp, initial) { - var left, o; - - // ## Allow return a, b - function maybeParseCommas() - { - if (rbp > 20 || skipCommas) return - while (nexttoken.value == ',') - { - advance(',') - parse(rbp) - } - } - var skipCommas = initial == 'singleExpression' - if (skipCommas) initial = undefined - - // ## notify of expression parsing start - logParseStart(rbp, initial) - if (nexttoken.id === '(end)') { - error("Unexpected early end of program.", token); - } - advance(); - if (option.safe && predefined[token.value] === true && - (nexttoken.id !== '(' && nexttoken.id !== '.')) { - warning('ADsafe violation.', token); - } - if (initial) { - anonname = 'anonymous'; - funct['(verb)'] = token.value; - } - if (initial === true && token.fud) { - left = token.fud(); - } else { - if (token.nud) { - o = token.exps; - left = token.nud(); - } else { - if (nexttoken.type === '(number)' && token.id === '.') { - warning( -"A leading decimal point can be confused with a dot: '.{a}'.", - token, nexttoken.value); - advance(); - // ## - maybeParseCommas() - // ## notify of expression parsing end - logParseEnd(rbp, initial) - return token; - } else { - error("Expected an identifier and instead saw '{a}'.", - token, token.id); - } - } - - while (rbp < nexttoken.lbp) { - // Don't allow [ on a next line as it might start an ObjC call - if (token.line != nexttoken.line && nexttoken.id == '[') break; - - o = nexttoken.exps; - // ## As we don't force lines to end with a semi colon, break if we encounter a reserved word - if (nexttoken.reserved && nexttoken.line != token.line) break - advance(); - if (token.led) { - left = token.led(left); - } else { -// if (token.line == prevtoken.line) - error("Expected an operator and instead saw '{a}'.", - token, token.id); - } - } - // ## .exps is transfered to o, to check if expression can stand on its own : assignment, ++ (postinc), delete, ... - // Disabled because o.release is a valid call in JSCocoa (when autocall is on) -/* - if (initial && !o && !token.exps) { -//## - warning("Expected an assignment or function call and instead saw an expression.", token); - } -*/ - } - - // ## - maybeParseCommas() - - // ## notify of expression parsing end - logParseEnd(rbp, initial) - - - return left; - } - - -// Functions for conformance of style. - - function abut(left, right) { - left = left || token; - right = right || nexttoken; - if (left.line !== right.line || left.character !== right.from) { - warning("Unexpected space after '{a}'.", right, left.value); - } - } - - - function adjacent(left, right) { - left = left || token; - right = right || nexttoken; - if (option.white || xmode === 'styleproperty' || xmode === 'style') { - if (left.character !== right.from && left.line === right.line) { - warning("Unexpected space after '{a}'.", right, left.value); - } - } - } - - function nospace(left, right) { - left = left || token; - right = right || nexttoken; - if (option.white && !left.comment) { - if (left.line === right.line) { - adjacent(left, right); - } - } - } - - - function nonadjacent(left, right) { - if (option.white) { - left = left || token; - right = right || nexttoken; - if (left.character === right.from) { - warning("Missing space after '{a}'.", - nexttoken, left.value); - } - } - } - - function nobreaknonadjacent(left, right) { - left = left || token; - right = right || nexttoken; - if (!option.laxbreak && left.line !== right.line) { - warning("Bad line breaking before '{a}'.", right, right.id); - } else if (option.white) { - left = left || token; - right = right || nexttoken; - if (left.character === right.from) { - warning("Missing space after '{a}'.", - nexttoken, left.value); - } - } - } - - function indentation(bias) { - var i; - if (option.white && nexttoken.id !== '(end)') { - i = indent + (bias || 0); - if (nexttoken.from !== i) { - warning("Expected '{a}' to have an indentation of {b} instead of {c}.", - nexttoken, nexttoken.value, i, nexttoken.from); - } - } - } - - function nolinebreak(t) { - if (t.line !== nexttoken.line) { - warning("Line breaking error '{a}'.", t, t.value); - } - } - - - function comma() { - if (token.line !== nexttoken.line) { - if (!option.laxbreak) { - warning("Bad line breaking before '{a}'.", token, nexttoken.id); - } - } else if (token.character !== nexttoken.from && option.white) { - warning("Unexpected space after '{a}'.", nexttoken, token.value); - } - advance(','); - nonadjacent(token, nexttoken); - } - - -// Functional constructors for making the symbols that will be inherited by -// tokens. - - function symbol(s, p) { - var x = syntax[s]; - if (!x || typeof x !== 'object') { - syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - - function delim(s) { - return symbol(s, 0); - } - - - function stmt(s, f) { - var x = delim(s); - x.identifier = x.reserved = true; - x.fud = f; - return x; - } - - - function blockstmt(s, f) { - var x = stmt(s, f); - x.block = true; - return x; - } - - - function reserveName(x) { - var c = x.id.charAt(0); - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { - x.identifier = x.reserved = true; - } - return x; - } - - - function prefix(s, f) { - var x = symbol(s, 150); - reserveName(x); - x.nud = (typeof f === 'function') ? f : function () { - if (option.plusplus && (this.id === '++' || this.id === '--')) { - warning("Unexpected use of '{a}'.", this, this.id); - } - this.right = parse(150); - this.arity = 'unary'; - return this; - }; - return x; - } - - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - - function reserve(s, f) { - var x = type(s, f); - x.identifier = x.reserved = true; - return x; - } - - - function reservevar(s, v) { - return reserve(s, function () { - if (this.id === 'this') { - if (option.safe) { - warning("ADsafe violation.", this); - } - } - return this; - }); - } - - - function infix(s, f, p, w) { - var x = symbol(s, p); - reserveName(x); - x.led = function (left) { - if (!w) { - nobreaknonadjacent(prevtoken, token); - nonadjacent(token, nexttoken); - } - if (typeof f === 'function') { - return f(left, this); - } else { - this.left = left; - this.right = parse(p); - return this; - } - }; - return x; - } - - - function relation(s, f) { - var x = symbol(s, 100); - x.led = function (left) { - nobreaknonadjacent(prevtoken, token); - nonadjacent(token, nexttoken); - var right = parse(100); - if ((left && left.id === 'NaN') || (right && right.id === 'NaN')) { - warning("Use the isNaN function to compare with NaN.", this); - } else if (f) { - f.apply(this, [left, right]); - } - this.left = left; - this.right = right; - return this; - }; - return x; - } - - - function isPoorRelation(node) { - return (node.type === '(number)' && !+node.value) || - (node.type === '(string)' && !node.value) || - node.type === 'true' || - node.type === 'false' || - node.type === 'undefined' || - node.type === 'null'; - } - - - function assignop(s, f) { - symbol(s, 20).exps = true; - return infix(s, function (left, that) { - var l; - that.left = left; - if (option.safe) { - l = left; - do { - if (predefined[l.value] === true) { - warning('ADsafe violation.', l); - } - l = l.left; - } while (l); - } - if (left) { - if (left.id === '.' || left.id === '[') { - if (left.left.value === 'arguments') { - warning('Bad assignment.', that); - } - that.right = parse(19); - return that; - } else if (left.identifier && !left.reserved) { - if (funct[left.value] === 'exception') { - warning("Do not assign to the exception parameter.", left); - } - that.right = parse(19); - return that; - } - if (left === syntax['function']) { - warning( -"Expected an identifier in an assignment and instead saw a function invocation.", - token); - } - } - error("Bad assignment.", that); - }, 20); - } - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === 'function') ? f : function (left) { - if (option.bitwise) { - warning("Unexpected use of '{a}'.", this, this.id); - } - this.left = left; - this.right = parse(p); - return this; - }; - return x; - } - - function bitwiseassignop(s) { - symbol(s, 20).exps = true; - return infix(s, function (left, that) { - if (option.bitwise) { - warning("Unexpected use of '{a}'.", that, that.id); - } - nonadjacent(prevtoken, token); - nonadjacent(token, nexttoken); - if (left) { - if (left.id === '.' || left.id === '[' || - (left.identifier && !left.reserved)) { - parse(19); - return left; - } - if (left === syntax['function']) { - warning( -"Expected an identifier in an assignment, and instead saw a function invocation.", - token); - } - } - error("Bad assignment.", that); - }, 20); - } - - - function suffix(s, f) { - var x = symbol(s, 150); - x.led = function (left) { - if (option.plusplus) { - warning("Unexpected use of '{a}'.", this, this.id); - } - this.left = left; - return this; - }; - return x; - } - - - function optionalidentifier() { - if (nexttoken.reserved && nexttoken.value !== 'arguments') { - warning("Expected an identifier and instead saw '{a}' (a reserved word).", - nexttoken, nexttoken.id); - } - if (nexttoken.identifier) { - advance(); - return token.value; - } - } - - - function identifier() { - var i = optionalidentifier(); - if (i) { - return i; - } - if (token.id === 'function' && nexttoken.id === '(') { - warning("Missing name in function statement."); - } else { - error("Expected an identifier and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - } - - function reachable(s) { - var i = 0, t; - if (nexttoken.id !== ';' || noreach) { - return; - } - for (;;) { - t = peek(i); - if (t.reach) { - return; - } - if (t.id !== '(endline)') { - if (t.id === 'function') { - warning( -"Inner functions should be listed at the top of the outer function.", t); - break; - } - warning("Unreachable '{a}' after '{b}'.", t, t.value, s); - break; - } - i += 1; - } - } - - - function statement(noindent) { - var i = indent, r, s = scope, t = nexttoken; - -// We don't like the empty statement. - - if (t.id === ';') { - warning("Unnecessary semicolon.", t); - advance(';'); - return; - } - -// Is this a labelled statement? - - if (t.identifier && !t.reserved && peek().id === ':') { - advance(); - advance(':'); - scope = Object.create(s); - addlabel(t.value, 'label'); - if (!nexttoken.labelled) { - warning("Label '{a}' on {b} statement.", - nexttoken, t.value, nexttoken.value); - } - if (jx.test(t.value + ':')) { - warning("Label '{a}' looks like a javascript url.", - t, t.value); - } - nexttoken.label = t.value; - t = nexttoken; - } - -// Parse the statement. - - if (!noindent) { - indentation(); - } - r = parse(0, true); - -// Look for the final semicolon. - if (!t.block) { - // ## Only warn about missing semicolons when next token is on same line and not a closing brace (like in one line closures) - if (nexttoken.id !== ';') { - if (token.line == nexttoken.line && nexttoken.id != '}') - warningAt("Missing semicolon.", token.line, token.from + token.value.length); -//## -// warningAt("Missing semicolon.", token.line, -// token.from + token.value.length); - } else { - abut(token, nexttoken); - advance(';'); - nonadjacent(token, nexttoken); - } - } - -// Restore the indentation. - - indent = i; - scope = s; - return r; - } - - function use_strict() { - if (nexttoken.type === '(string)' && - /^use +strict(?:,.+)?$/.test(nexttoken.value)) { - advance(); - advance(';'); - return true; - } else { - return false; - } - } - - - function statements(begin) { - var a = [], f, p; - if (begin && !use_strict() && option.strict) { - warning('Missing "use strict" statement.', nexttoken); - } - if (option.adsafe) { - switch (begin) { - case 'script': - if (!adsafe_may) { - if (nexttoken.value !== 'ADSAFE' || - peek(0).id !== '.' || - (peek(1).value !== 'id' && - peek(1).value !== 'go')) { - error('ADsafe violation: Missing ADSAFE.id or ADSAFE.go.', - nexttoken); - } - } - if (nexttoken.value === 'ADSAFE' && - peek(0).id === '.' && - peek(1).value === 'id') { - if (adsafe_may) { - error('ADsafe violation.', nexttoken); - } - advance('ADSAFE'); - advance('.'); - advance('id'); - advance('('); - if (nexttoken.value !== adsafe_id) { - error('ADsafe violation: id does not match.', nexttoken); - } - advance('(string)'); - advance(')'); - advance(';'); - adsafe_may = true; - } - break; - case 'lib': - if (nexttoken.value === 'ADSAFE') { - advance('ADSAFE'); - advance('.'); - advance('lib'); - advance('('); - advance('(string)'); - comma(); - f = parse(0); - if (f.id !== 'function') { - error('The second argument to lib must be a function.', f); - } - p = f.funct['(params)']; - if (p && p !== 'lib') { - error("Expected '{a}' and instead saw '{b}'.", - f, 'lib', p); - } - advance(')'); - advance(';'); - return a; - } else { - error("ADsafe lib violation."); - } - } - } - while (!nexttoken.reach && nexttoken.id !== '(end)') { - if (nexttoken.id === ';') { - warning("Unnecessary semicolon."); - advance(';'); - } else { - var s = statement() -// logStatement(s) - a.push(s); - } - } - return a; - } - - - function block(f) { - var a, b = inblock, s = scope, t; - inblock = f; - if (f) { - scope = Object.create(scope); - } - nonadjacent(token, nexttoken); - t = nexttoken; - if (nexttoken.id === '{') { - advance('{'); - if (nexttoken.id !== '}' || token.line !== nexttoken.line) { - indent += option.indent; - if (!f && nexttoken.from === indent + option.indent) { - indent += option.indent; - } - if (!f) { - use_strict(); - } - a = statements(); - indent -= option.indent; - indentation(); - } - advance('}', t); - } else { -//## -// warning("Expected '{a}' and instead saw '{b}'.", -// nexttoken, '{', nexttoken.value); - noreach = true; - a = [statement()]; - noreach = false; - } - funct['(verb)'] = null; - scope = s; - inblock = b; - return a; - } - - -// An identity function, used by string and number tokens. - - function idValue() { - return this; - } - - - function countMember(m) { - // ## Causing errors while linting jslint. Disabled for now. - - if (0 && membersOnly && membersOnly[m] !== true) { - warning("Unexpected /*member '{a}'.", nexttoken, m); - } - if (typeof member[m] === 'number') { - member[m] += 1; - } else { - member[m] = 1; - } - } - - function note_implied(token) { - var name = token.value, line = token.line + 1, a = implied[name]; - if (typeof a === 'function') { - a = false; - } - if (!a) { - a = [line]; - implied[name] = a; - } else if (a[a.length - 1] !== line) { - a.push(line); - } - } - -// CSS parsing. -/* - - function cssName() { - if (nexttoken.identifier) { - advance(); - return true; - } - } - - function cssNumber() { - if (nexttoken.id === '-') { - advance('-'); - advance('(number)'); - } - if (nexttoken.type === '(number)') { - advance(); - return true; - } - } - - function cssString() { - if (nexttoken.type === '(string)') { - advance(); - return true; - } - } - - function cssColor() { - var i, number; - if (nexttoken.identifier) { - if (nexttoken.value === 'rgb') { - advance(); - advance('('); - for (i = 0; i < 3; i += 1) { - number = nexttoken.value; - if (nexttoken.type !== '(number)' || number < 0) { - warning("Expected a positive number and instead saw '{a}'", - nexttoken, number); - advance(); - } else { - advance(); - if (nexttoken.id === '%') { - advance('%'); - if (number > 100) { - warning("Expected a percentage and instead saw '{a}'", - token, number); - } - } else { - if (number > 255) { - warning("Expected a small number and instead saw '{a}'", - token, number); - } - } - } - } - advance(')'); - return true; - } else if (cssColorData[nexttoken.value] === true) { - advance(); - return true; - } - } else if (nexttoken.type === '(color)') { - advance(); - return true; - } - return false; - } - - function cssLength() { - if (nexttoken.id === '-') { - advance('-'); - adjacent(); - } - if (nexttoken.type === '(number)') { - advance(); - if (nexttoken.type !== '(string)' && - cssLengthData[nexttoken.value] === true) { - adjacent(); - advance(); - } else if (+token.value !== 0) { - warning("Expected a linear unit and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - return true; - } - return false; - } - - function cssLineHeight() { - if (nexttoken.id === '-') { - advance('-'); - adjacent(); - } - if (nexttoken.type === '(number)') { - advance(); - if (nexttoken.type !== '(string)' && - cssLengthData[nexttoken.value] === true) { - adjacent(); - advance(); - } - return true; - } - return false; - } - - function cssWidth() { - if (nexttoken.identifier) { - switch (nexttoken.value) { - case 'thin': - case 'medium': - case 'thick': - advance(); - return true; - } - } else { - return cssLength(); - } - } - - function cssMargin() { - if (nexttoken.identifier) { - if (nexttoken.value === 'auto') { - advance(); - return true; - } - } else { - return cssLength(); - } - } - - function cssAttr() { - if (nexttoken.identifier && nexttoken.value === 'attr') { - advance(); - advance('('); - if (!nexttoken.identifier) { - warning("Expected a name and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - advance(); - advance(')'); - return true; - } - return false; - } - - function cssCommaList() { - while (nexttoken.id !== ';') { - if (!cssName() && !cssString()) { - warning("Expected a name and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - if (nexttoken.id !== ',') { - return true; - } - comma(); - } - } - - function cssCounter() { - if (nexttoken.identifier && nexttoken.value === 'counter') { - advance(); - advance('('); - if (!nexttoken.identifier) { - } - advance(); - if (nexttoken.id === ',') { - comma(); - if (nexttoken.type !== '(string)') { - warning("Expected a string and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - advance(); - } - advance(')'); - return true; - } - if (nexttoken.identifier && nexttoken.value === 'counters') { - advance(); - advance('('); - if (!nexttoken.identifier) { - warning("Expected a name and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - advance(); - if (nexttoken.id === ',') { - comma(); - if (nexttoken.type !== '(string)') { - warning("Expected a string and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - advance(); - } - if (nexttoken.id === ',') { - comma(); - if (nexttoken.type !== '(string)') { - warning("Expected a string and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - advance(); - } - advance(')'); - return true; - } - return false; - } - - - function cssShape() { - var i; - if (nexttoken.identifier && nexttoken.value === 'rect') { - advance(); - advance('('); - for (i = 0; i < 4; i += 1) { - if (!cssLength()) { - warning("Expected a number and instead saw '{a}'.", - nexttoken, nexttoken.value); - break; - } - } - advance(')'); - return true; - } - return false; - } - - function cssUrl() { - var url; - if (nexttoken.identifier && nexttoken.value === 'url') { - nexttoken = lex.range('(', ')'); - url = nexttoken.value; - advance(); - if (option.safe && ux.test(url)) { - error("ADsafe URL violation."); - } - urls.push(url); - return true; - } - return false; - } - - cssAny = [cssUrl, function () { - for (;;) { - if (nexttoken.identifier) { - switch (nexttoken.value.toLowerCase()) { - case 'url': - cssUrl(); - break; - case 'expression': - warning("Unexpected expression '{a}'.", - nexttoken, nexttoken.value); - advance(); - break; - default: - advance(); - } - } else { - if (nexttoken.id === ';' || nexttoken.id === '!' || - nexttoken.id === '(end)' || nexttoken.id === '}') { - return true; - } - advance(); - } - } - }]; - - cssBorderStyle = [ - 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'ridge', - 'inset', 'outset' - ]; - - cssAttributeData = { - background: [ - true, 'background-attachment', 'background-color', - 'background-image', 'background-position', 'background-repeat' - ], - 'background-attachment': ['scroll', 'fixed'], - 'background-color': ['transparent', cssColor], - 'background-image': ['none', cssUrl], - 'background-position': [ - 2, [cssLength, 'top', 'bottom', 'left', 'right', 'center'] - ], - 'background-repeat': [ - 'repeat', 'repeat-x', 'repeat-y', 'no-repeat' - ], - 'border': [true, 'border-color', 'border-style', 'border-width'], - 'border-bottom': [true, 'border-bottom-color', 'border-bottom-style', 'border-bottom-width'], - 'border-bottom-color': cssColor, - 'border-bottom-style': cssBorderStyle, - 'border-bottom-width': cssWidth, - 'border-collapse': ['collapse', 'separate'], - 'border-color': ['transparent', 4, cssColor], - 'border-left': [ - true, 'border-left-color', 'border-left-style', 'border-left-width' - ], - 'border-left-color': cssColor, - 'border-left-style': cssBorderStyle, - 'border-left-width': cssWidth, - 'border-right': [ - true, 'border-right-color', 'border-right-style', 'border-right-width' - ], - 'border-right-color': cssColor, - 'border-right-style': cssBorderStyle, - 'border-right-width': cssWidth, - 'border-spacing': [2, cssLength], - 'border-style': [4, cssBorderStyle], - 'border-top': [ - true, 'border-top-color', 'border-top-style', 'border-top-width' - ], - 'border-top-color': cssColor, - 'border-top-style': cssBorderStyle, - 'border-top-width': cssWidth, - 'border-width': [4, cssWidth], - bottom: [cssLength, 'auto'], - 'caption-side' : ['bottom', 'left', 'right', 'top'], - clear: ['both', 'left', 'none', 'right'], - clip: [cssShape, 'auto'], - color: cssColor, - content: [ - 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', - cssString, cssUrl, cssCounter, cssAttr - ], - 'counter-increment': [ - cssName, 'none' - ], - 'counter-reset': [ - cssName, 'none' - ], - cursor: [ - cssUrl, 'auto', 'crosshair', 'default', 'e-resize', 'help', 'move', - 'n-resize', 'ne-resize', 'nw-resize', 'pointer', 's-resize', - 'se-resize', 'sw-resize', 'w-resize', 'text', 'wait' - ], - direction: ['ltr', 'rtl'], - display: [ - 'block', 'compact', 'inline', 'inline-block', 'inline-table', - 'list-item', 'marker', 'none', 'run-in', 'table', 'table-caption', - 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', - 'table-header-group', 'table-row', 'table-row-group' - ], - 'empty-cells': ['show', 'hide'], - 'float': ['left', 'none', 'right'], - font: [ - 'caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar', - true, 'font-size', 'font-style', 'font-weight', 'font-family' - ], - 'font-family': cssCommaList, - 'font-size': [ - 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', - 'xx-large', 'larger', 'smaller', cssLength - ], - 'font-size-adjust': ['none', cssNumber], - 'font-stretch': [ - 'normal', 'wider', 'narrower', 'ultra-condensed', - 'extra-condensed', 'condensed', 'semi-condensed', - 'semi-expanded', 'expanded', 'extra-expanded' - ], - 'font-style': [ - 'normal', 'italic', 'oblique' - ], - 'font-variant': [ - 'normal', 'small-caps' - ], - 'font-weight': [ - 'normal', 'bold', 'bolder', 'lighter', cssNumber - ], - height: [cssLength, 'auto'], - left: [cssLength, 'auto'], - 'letter-spacing': ['normal', cssLength], - 'line-height': ['normal', cssLineHeight], - 'list-style': [ - true, 'list-style-image', 'list-style-position', 'list-style-type' - ], - 'list-style-image': ['none', cssUrl], - 'list-style-position': ['inside', 'outside'], - 'list-style-type': [ - 'circle', 'disc', 'square', 'decimal', 'decimal-leading-zero', - 'lower-roman', 'upper-roman', 'lower-greek', 'lower-alpha', - 'lower-latin', 'upper-alpha', 'upper-latin', 'hebrew', 'katakana', - 'hiragana-iroha', 'katakana-oroha', 'none' - ], - margin: [4, cssMargin], - 'margin-bottom': cssMargin, - 'margin-left': cssMargin, - 'margin-right': cssMargin, - 'margin-top': cssMargin, - 'marker-offset': [cssLength, 'auto'], - 'max-height': [cssLength, 'none'], - 'max-width': [cssLength, 'none'], - 'min-height': cssLength, - 'min-width': cssLength, - opacity: cssNumber, - outline: [true, 'outline-color', 'outline-style', 'outline-width'], - 'outline-color': ['invert', cssColor], - 'outline-style': [ - 'dashed', 'dotted', 'double', 'groove', 'inset', 'none', - 'outset', 'ridge', 'solid' - ], - 'outline-width': cssWidth, - overflow: ['auto', 'hidden', 'scroll', 'visible'], - padding: [4, cssLength], - 'padding-bottom': cssLength, - 'padding-left': cssLength, - 'padding-right': cssLength, - 'padding-top': cssLength, - position: ['absolute', 'fixed', 'relative', 'static'], - quotes: [8, cssString], - right: [cssLength, 'auto'], - 'table-layout': ['auto', 'fixed'], - 'text-align': ['center', 'justify', 'left', 'right'], - 'text-decoration': ['none', 'underline', 'overline', 'line-through', 'blink'], - 'text-indent': cssLength, - 'text-shadow': ['none', 4, [cssColor, cssLength]], - 'text-transform': ['capitalize', 'uppercase', 'lowercase', 'none'], - top: [cssLength, 'auto'], - 'unicode-bidi': ['normal', 'embed', 'bidi-override'], - 'vertical-align': [ - 'baseline', 'bottom', 'sub', 'super', 'top', 'text-top', 'middle', - 'text-bottom', cssLength - ], - visibility: ['visible', 'hidden', 'collapse'], - 'white-space': ['normal', 'pre', 'nowrap'], - width: [cssLength, 'auto'], - 'word-spacing': ['normal', cssLength], - 'z-index': ['auto', cssNumber] - }; - - function styleAttribute() { - var v; - while (nexttoken.id === '*' || nexttoken.id === '#' || nexttoken.value === '_') { - if (!option.css) { - warning("Unexpected '{a}'.", nexttoken, nexttoken.value); - } - advance(); - } - if (nexttoken.id === '-') { - if (!option.css) { - warning("Unexpected '{a}'.", nexttoken, nexttoken.value); - } - advance('-'); - if (!nexttoken.identifier) { - warning("Expected a non-standard style attribute and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - advance(); - return cssAny; - } else { - if (!nexttoken.identifier) { - warning("Excepted a style attribute, and instead saw '{a}'.", - nexttoken, nexttoken.value); - } else { - if (cssAttributeData.hasOwnProperty(nexttoken.value)) { - v = cssAttributeData[nexttoken.value]; - } else { - v = cssAny; - if (!option.css) { - warning("Unrecognized style attribute '{a}'.", - nexttoken, nexttoken.value); - } - } - } - advance(); - return v; - } - } - - function styleValue(v) { - var i = 0, - n, - once, - match, - round, - start = 0, - vi; - switch (typeof v) { - case 'function': - return v(); - case 'string': - if (nexttoken.identifier && nexttoken.value === v) { - advance(); - return true; - } - return false; - } - for (;;) { - if (i >= v.length) { - return false; - } - vi = v[i]; - i += 1; - if (vi === true) { - break; - } else if (typeof vi === 'number') { - n = vi; - vi = v[i]; - i += 1; - } else { - n = 1; - } - match = false; - while (n > 0) { - if (styleValue(vi)) { - match = true; - n -= 1; - } else { - break; - } - } - if (match) { - return true; - } - } - start = i; - once = []; - for (;;) { - round = false; - for (i = start; i < v.length; i += 1) { - if (!once[i]) { - if (styleValue(cssAttributeData[v[i]])) { - match = true; - round = true; - once[i] = true; - break; - } - } - } - if (!round) { - return match; - } - } - } - - function substyle() { - var v; - for (;;) { - if (nexttoken.id === '}' || nexttoken.id === '(end)' || - xquote && nexttoken.id === xquote) { - return; - } - while (nexttoken.id === ';') { - warning("Misplaced ';'."); - advance(';'); - } - v = styleAttribute(); - advance(':'); - if (nexttoken.identifier && nexttoken.value === 'inherit') { - advance(); - } else { - styleValue(v); - } - while (nexttoken.id !== ';' && nexttoken.id !== '!' && - nexttoken.id !== '}' && nexttoken.id !== '(end)' && - nexttoken.id !== xquote) { - warning("Unexpected token '{a}'.", nexttoken, nexttoken.value); - advance(); - } - if (nexttoken.id === '!') { - advance('!'); - adjacent(); - if (nexttoken.identifier && nexttoken.value === 'important') { - advance(); - } else { - warning("Expected '{a}' and instead saw '{b}'.", - nexttoken, 'important', nexttoken.value); - } - } - if (nexttoken.id === '}' || nexttoken.id === xquote) { - warning("Missing '{a}'.", nexttoken, ';'); - } else { - advance(';'); - } - } - } - - function stylePattern() { - var name; - if (nexttoken.id === '{') { - warning("Expected a style pattern, and instead saw '{a}'.", nexttoken, - nexttoken.id); - } else if (nexttoken.id === '@') { - advance('@'); - name = nexttoken.value; - if (nexttoken.identifier && atrule[name] === true) { - advance(); - return name; - } - warning("Expected an at-rule, and instead saw @{a}.", nexttoken, name); - } - for (;;) { - if (nexttoken.identifier) { - if (!htmltag.hasOwnProperty(nexttoken.value)) { - warning("Expected a tagName, and instead saw {a}.", - nexttoken, nexttoken.value); - } - advance(); - } else { - switch (nexttoken.id) { - case '>': - case '+': - advance(); - if (!nexttoken.identifier || - !htmltag.hasOwnProperty(nexttoken.value)) { - warning("Expected a tagName, and instead saw {a}.", - nexttoken, nexttoken.value); - } - advance(); - break; - case ':': - advance(':'); - if (pseudorule[nexttoken.value] !== true) { - warning("Expected a pseudo, and instead saw :{a}.", - nexttoken, nexttoken.value); - } - advance(); - if (nexttoken.value === 'lang') { - advance('('); - if (!nexttoken.identifier) { - warning("Expected a lang code, and instead saw :{a}.", - nexttoken, nexttoken.value); - } - advance(')'); - } - break; - case '#': - advance('#'); - if (!nexttoken.identifier) { - warning("Expected an id, and instead saw #{a}.", - nexttoken, nexttoken.value); - } - advance(); - break; - case '*': - advance('*'); - break; - case '.': - advance('.'); - if (!nexttoken.identifier) { - warning("Expected a class, and instead saw #.{a}.", - nexttoken, nexttoken.value); - } - advance(); - break; - case '[': - advance('['); - if (!nexttoken.identifier) { - warning("Expected an attribute, and instead saw [{a}].", - nexttoken, nexttoken.value); - } - advance(); - if (nexttoken.id === '=' || nexttoken.id === '~=' || - nexttoken.id === '|=') { - advance(); - if (nexttoken.type !== '(string)') { - warning("Expected a string, and instead saw {a}.", - nexttoken, nexttoken.value); - } - advance(); - } - advance(']'); - break; - default: - error("Expected a CSS selector, and instead saw {a}.", - nexttoken, nexttoken.value); - } - } - if (nexttoken.id === ' fragments and .js files.", token); - } - if (option.fragment) { - if (n !== 'div') { - error("ADsafe violation: Wrap the widget in a div.", token); - } - } else { - error("Use the fragment option.", token); - } - } - option.browser = true; - assume(); - } - - function doAttribute(n, a, v) { - var u, x; - if (a === 'id') { - u = typeof v === 'string' ? v.toUpperCase() : ''; - if (ids[u] === true) { - warning("Duplicate id='{a}'.", nexttoken, v); - } - if (option.adsafe) { - if (adsafe_id) { - if (v.slice(0, adsafe_id.length) !== adsafe_id) { - warning("ADsafe violation: An id must have a '{a}' prefix", - nexttoken, adsafe_id); - } else if (!/^[A-Z]+_[A-Z]+$/.test(v)) { - warning("ADSAFE violation: bad id."); - } - } else { - adsafe_id = v; - if (!/^[A-Z]+_$/.test(v)) { - warning("ADSAFE violation: bad id."); - } - } - } - x = v.search(dx); - if (x >= 0) { - warning("Unexpected character '{a}' in {b}.", token, v.charAt(x), a); - } - ids[u] = true; - } else if (a === 'class' || a === 'type' || a === 'name') { - x = v.search(qx); - if (x >= 0) { - warning("Unexpected character '{a}' in {b}.", token, v.charAt(x), a); - } - ids[u] = true; - } else if (a === 'href' || a === 'background' || - a === 'content' || a === 'data' || - a.indexOf('src') >= 0 || a.indexOf('url') >= 0) { - if (option.safe && ux.test(v)) { - error("ADsafe URL violation."); - } - urls.push(v); - } else if (a === 'for') { - if (option.adsafe) { - if (adsafe_id) { - if (v.slice(0, adsafe_id.length) !== adsafe_id) { - warning("ADsafe violation: An id must have a '{a}' prefix", - nexttoken, adsafe_id); - } else if (!/^[A-Z]+_[A-Z]+$/.test(v)) { - warning("ADSAFE violation: bad id."); - } - } else { - warning("ADSAFE violation: bad id."); - } - } - } else if (a === 'name') { - if (option.adsafe && v.indexOf('_') >= 0) { - warning("ADsafe name violation."); - } - } - } - - function doTag(n, a) { - var i, t = htmltag[n], x; - src = false; - if (!t) { - error("Unrecognized tag '<{a}>'.", - nexttoken, - n === n.toLowerCase() ? n : - n + ' (capitalization error)'); - } - if (stack.length > 0) { - if (n === 'html') { - error("Too many tags.", token); - } - x = t.parent; - if (x) { - if (x.indexOf(' ' + stack[stack.length - 1].name + ' ') < 0) { - error("A '<{a}>' must be within '<{b}>'.", - token, n, x); - } - } else if (!option.adsafe && !option.fragment) { - i = stack.length; - do { - if (i <= 0) { - error("A '<{a}>' must be within '<{b}>'.", - token, n, 'body'); - } - i -= 1; - } while (stack[i].name !== 'body'); - } - } - switch (n) { - case 'div': - if (option.adsafe && stack.length === 1 && !adsafe_id) { - warning("ADSAFE violation: missing ID_."); - } - break; - case 'script': - xmode = 'script'; - advance('>'); - indent = nexttoken.from; - if (a.lang) { - warning("lang is deprecated.", token); - } - if (option.adsafe && stack.length !== 1) { - warning("ADsafe script placement violation.", token); - } - if (a.src) { - if (option.adsafe && (!adsafe_may || !approved[a.src])) { - warning("ADsafe unapproved script source.", token); - } - if (a.type) { - warning("type is unnecessary.", token); - } - } else { - if (adsafe_went) { - error("ADsafe script violation.", token); - } - statements('script'); - } - xmode = 'html'; - advance(''); - styles(); - xmode = 'html'; - advance(''; - } - - function html() { - var a, attributes, e, n, q, t, v, w = option.white, wmode; - xmode = 'html'; - xquote = ''; - stack = null; - for (;;) { - switch (nexttoken.value) { - case '<': - xmode = 'html'; - advance('<'); - attributes = {}; - t = nexttoken; - if (!t.identifier) { - warning("Bad identifier {a}.", t, t.value); - } - n = t.value; - if (option.cap) { - n = n.toLowerCase(); - } - t.name = n; - advance(); - if (!stack) { - stack = []; - doBegin(n); - } - v = htmltag[n]; - if (typeof v !== 'object') { - error("Unrecognized tag '<{a}>'.", t, n); - } - e = v.empty; - t.type = n; - for (;;) { - if (nexttoken.id === '/') { - advance('/'); - if (nexttoken.id !== '>') { - warning("Expected '{a}' and instead saw '{b}'.", - nexttoken, '>', nexttoken.value); - } - break; - } - if (nexttoken.id && nexttoken.id.substr(0, 1) === '>') { - break; - } - if (!nexttoken.identifier) { - if (nexttoken.id === '(end)' || nexttoken.id === '(error)') { - error("Missing '>'.", nexttoken); - } - warning("Bad identifier."); - } - option.white = true; - nonadjacent(token, nexttoken); - a = nexttoken.value; - option.white = w; - advance(); - if (!option.cap && a !== a.toLowerCase()) { - warning("Attribute '{a}' not all lower case.", nexttoken, a); - } - a = a.toLowerCase(); - xquote = ''; - if (attributes.hasOwnProperty(a)) { - warning("Attribute '{a}' repeated.", nexttoken, a); - } - if (a.slice(0, 2) === 'on') { - if (!option.on) { - warning("Avoid HTML event handlers."); - } - xmode = 'scriptstring'; - advance('='); - q = nexttoken.id; - if (q !== '"' && q !== "'") { - error("Missing quote."); - } - xquote = q; - wmode = option.white; - option.white = false; - advance(q); - statements('on'); - option.white = wmode; - if (nexttoken.id !== q) { - error("Missing close quote on script attribute."); - } - xmode = 'html'; - xquote = ''; - advance(q); - v = false; - } else if (a === 'style') { - xmode = 'scriptstring'; - advance('='); - q = nexttoken.id; - if (q !== '"' && q !== "'") { - error("Missing quote."); - } - xmode = 'styleproperty'; - xquote = q; - advance(q); - substyle(); - xmode = 'html'; - xquote = ''; - advance(q); - v = false; - } else { - if (nexttoken.id === '=') { - advance('='); - v = nexttoken.value; - if (!nexttoken.identifier && - nexttoken.id !== '"' && - nexttoken.id !== '\'' && - nexttoken.type !== '(string)' && - nexttoken.type !== '(number)' && - nexttoken.type !== '(color)') { - warning("Expected an attribute value and instead saw '{a}'.", token, a); - } - advance(); - } else { - v = true; - } - } - attributes[a] = v; - doAttribute(n, a, v); - } - doTag(n, attributes); - if (!e) { - stack.push(t); - } - xmode = 'outer'; - advance('>'); - break; - case '') { - error("Missing '{a}'.", nexttoken, '>'); - } - xmode = 'outer'; - advance('>'); - break; - case '' || nexttoken.id === '(end)') { - break; - } - if (nexttoken.id === '--') { - warning("Unexpected --."); - } - } - xmode = 'outer'; - advance('>'); - break; - case ''."); - } - if (nexttoken.id === ''); - break; - case '(end)': - return; - default: - if (nexttoken.id === '(end)') { - error("Missing '{a}'.", nexttoken, - ''); - } else { - advance(); - } - } - if (stack && stack.length === 0 && (option.adsafe || - !option.fragment || nexttoken.id === '(end)')) { - break; - } - } - if (nexttoken.id !== '(end)') { - error("Unexpected material after the end."); - } - } -*/ - -// Build the syntax table by declaring the syntactic elements of the language. - - type('(number)', idValue); - type('(string)', idValue); - - syntax['(identifier)'] = { - type: '(identifier)', - lbp: 0, - identifier: true, - nud: function () { - var v = this.value, - s = scope[v]; - if (typeof s === 'function') { - s = false; - } - -// The name is in scope and defined in the current function. - - if (s && (s === funct || s === funct['(global)'])) { - -// If we are not also in the global scope, change 'unused' to 'var', -// and reject labels. - - if (!funct['(global)']) { - switch (funct[v]) { - case 'unused': - funct[v] = 'var'; - break; - case 'label': - warning("'{a}' is a statement label.", token, v); - break; - } - } - -// The name is not defined in the function. If we are in the global scope, -// then we have an undefined variable. - - } else if (funct['(global)']) { - if (option.undef) { - warning("'{a}' is not defined.", token, v); - } - note_implied(token); - -// If the name is already defined in the current -// function, but not as outer, then there is a scope error. - - } else { - switch (funct[v]) { - case 'closure': - case 'function': - case 'var': - case 'unused': - warning("'{a}' used out of scope.", token, v); - break; - case 'label': - warning("'{a}' is a statement label.", token, v); - break; - case 'outer': - case true: - break; - default: - -// If the name is defined in an outer function, make an outer entry, and if -// it was unused, make it var. - - if (s === true) { - funct[v] = true; - } else if (typeof s !== 'object') { - if (option.undef) { - warning("'{a}' is not defined.", token, v); - } else { - funct[v] = true; - } - note_implied(token); - } else { - switch (s[v]) { - case 'function': - case 'var': - case 'unused': - s[v] = 'closure'; - funct[v] = 'outer'; - break; - case 'closure': - case 'parameter': - funct[v] = 'outer'; - break; - case 'label': - warning("'{a}' is a statement label.", token, v); - } - } - } - } - return this; - }, - led: function () { - error("Expected an operator and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - }; - - type('(regexp)', function () { - return this; - }); - - delim('(endline)'); - delim('(begin)'); - delim('(end)').reach = true; - delim(''); - delim('(error)').reach = true; - delim('}').reach = true; - delim(')'); - delim(']'); - delim('"').reach = true; - delim("'").reach = true; - delim(';'); - delim(':').reach = true; - delim(','); - delim('#'); -// delim('@'); - reserve('else'); - reserve('case').reach = true; - reserve('catch'); - reserve('default').reach = true; - reserve('finally'); - reservevar('arguments'); - reservevar('eval'); - reservevar('false'); - reservevar('Infinity'); - reservevar('NaN'); - reservevar('null'); - reservevar('this'); - reservevar('true'); - reservevar('undefined'); - - - assignop('=', 'assign', 20); - assignop('+=', 'assignadd', 20); - assignop('-=', 'assignsub', 20); - assignop('*=', 'assignmult', 20); - assignop('/=', 'assigndiv', 20).nud = function () { - error("A regular expression literal can be confused with '/='."); - }; - assignop('%=', 'assignmod', 20); - bitwiseassignop('&=', 'assignbitand', 20); - bitwiseassignop('|=', 'assignbitor', 20); - bitwiseassignop('^=', 'assignbitxor', 20); - bitwiseassignop('<<=', 'assignshiftleft', 20); - bitwiseassignop('>>=', 'assignshiftright', 20); - bitwiseassignop('>>>=', 'assignshiftrightunsigned', 20); - - assignop('@=', 'objCSetValueForKey', 20); - - infix('?', function (left, that) { - that.left = left; - that.right = parse(10); - advance(':'); - that['else'] = parse(10); - return that; - }, 30); - - infix('||', 'or', 40); - infix('&&', 'and', 50); - bitwise('|', 'bitor', 70); - bitwise('^', 'bitxor', 80); - bitwise('&', 'bitand', 90); - relation('==', function (left, right) { -/* // ## I don't understand these. - if (option.eqeqeq) { - warning("Expected '{a}' and instead saw '{b}'.", - this, '===', '=='); - } else if (isPoorRelation(left)) { - warning("Use '{a}' to compare with '{b}'.", - this, '===', left.value); - } else if (isPoorRelation(right)) { - warning("Use '{a}' to compare with '{b}'.", - this, '===', right.value); - } -*/ - return this; - }); - relation('==='); - relation('!=', function (left, right) { -/* // ## I don't understand these. -// if (b != true) will throw this error. Why ? - if (option.eqeqeq) { - warning("Expected '{a}' and instead saw '{b}'.", - this, '!==', '!='); - } else if (isPoorRelation(left)) { - warning("Use '{a}' to compare with '{b}'.", - this, '!==', left.value); - } else if (isPoorRelation(right)) { - warning("Use '{a}' to compare with '{b}'.", - this, '!==', right.value); - } -*/ - return this; - }); - relation('!=='); - relation('<'); - relation('>'); - relation('<='); - relation('>='); - bitwise('<<', 'shiftleft', 120); - bitwise('>>', 'shiftright', 120); - bitwise('>>>', 'shiftrightunsigned', 120); - infix('in', 'in', 120); - infix('instanceof', 'instanceof', 120); - infix('+', function (left, that) { - var right = parse(130); -/* -## String constant folding messes up token stream : logToken outputs token stream on the fly. -## Disabled. - if (left && right && left.id === '(string)' && right.id === '(string)') { - left.value += right.value; - left.character = right.character; - if (jx.test(left.value)) { - warning("JavaScript URL.", left); - } - return left; - } -*/ - that.left = left; - that.right = right; - return that; - }, 130); - prefix('+', 'num'); - infix('-', 'sub', 130); - -//## - infix('[+]', 'arrayAdd', 120); - infix('{+}', 'hashAdd', 120); - - // Handle @ prefix for NSStrings - prefix('@', function () - { - advance() - var c = token - if (token.id != '(string)') - warningAt('ObjC string immediate : Expected a Javascript string here', token.line, token.from) - - }) - - // Handle @selector - prefix('@selector', function () - { - var c = token - logExtraSyntax('@selector', token) - token.id = token.value - disableLogToken() - advance('(') - var from = nexttoken.from - var line = nexttoken.line - var selector = '' - while (nexttoken && nexttoken.value != ')' && line == nexttoken.line) - { - advance() - selector += token.value - } - // Wrong but better than nothing -// if (!selector.match(/^[\w:]+/)) -// warningAt('Invalid selector', line, from ) - - var t = { value : selector, type : '(string)', from : from, character : token.character, line : line } - t.rawValue = lines[t.line] ? lines[t.line].substr(t.from, t.character-t.from) : '' - logToken(t) - nexttoken.rawValue = lines[nexttoken.line] ? lines[nexttoken.line].substr(nexttoken.from, nexttoken.character-nexttoken.from) : '' - logToken(nexttoken) - - enableLogToken() - advance(')') - }) - - - prefix('-', 'neg'); - infix('*', 'mult', 140); - infix('/', 'div', 140); - infix('%', 'mod', 140); - - suffix('++', 'postinc'); - prefix('++', 'preinc'); - syntax['++'].exps = true; - - suffix('--', 'postdec'); - prefix('--', 'predec'); - syntax['--'].exps = true; - prefix('delete', function () { - var p = parse(0); - if (!p || (p.id !== '.' && p.id !== '[')) { - warning("Expected '{a}' and instead saw '{b}'.", - nexttoken, '.', nexttoken.value); - } - }).exps = true; - - - prefix('~', function () { - if (option.bitwise) { - warning("Unexpected '{a}'.", this, '~'); - } - parse(150); - return this; - }); - prefix('!', 'not'); - prefix('typeof', 'typeof'); - prefix('new', function () { - var c = parse(155), i; - if (c && c.id !== 'function') { - if (c.identifier) { - c['new'] = true; - switch (c.value) { - case 'Object': - warning("Use the object literal notation {}.", token); - break; - case 'Array': - warning("Use the array literal notation [].", token); - break; - case 'Number': - case 'String': - case 'Boolean': - case 'Math': - warning("Do not use {a} as a constructor.", token, c.value); - break; - case 'Function': - if (!option.evil) { - warning("The Function constructor is eval."); - } - break; - case 'Date': - case 'RegExp': - break; - default: - if (c.id !== 'function') { - i = c.value.substr(0, 1); - if (option.newcap && (i < 'A' || i > 'Z')) { - warning( - "A constructor name should start with an uppercase letter.", - token); - } - } - } - } else { - if (c.id !== '.' && c.id !== '[' && c.id !== '(') { - warning("Bad constructor.", token); - } - } - } else { - warning("Weird construction. Delete 'new'.", this); - } - adjacent(token, nexttoken); -/* - // ## Allow paramless constructors - if (nexttoken.id !== '(') { - warning("Missing '()' invoking a constructor."); - } -*/ - this.first = c; - return this; - }); - syntax['new'].exps = true; - - infix('.', function (left, that) { - adjacent(prevtoken, token); - var m = identifier(); - if (typeof m === 'string') { - countMember(m); - } - that.left = left; - that.right = m; - if (!option.evil && left && left.value === 'document' && - (m === 'write' || m === 'writeln')) { - warning("document.write can be a form of eval.", left); - } - if (option.adsafe) { - if (left && left.value === 'ADSAFE') { - if (m === 'id' || m === 'lib') { - warning("ADsafe violation.", that); - } else if (m === 'go') { - if (xmode !== 'script') { - warning("ADsafe violation.", that); - } else if (adsafe_went || nexttoken.id !== '(' || - peek(0).id !== '(string)' || - peek(0).value !== adsafe_id || - peek(1).id !== ',') { - error("ADsafe violation: go.", that); - } - adsafe_went = true; - adsafe_may = false; - } - } - } - if (option.safe) { - for (;;) { - if (banned[m] === true) { - warning("ADsafe restricted word '{a}'.", token, m); - } - if (predefined[left.value] !== true || - nexttoken.id === '(') { - break; - } - if (standard_member[m] === true) { - if (nexttoken.id === '.') { - warning("ADsafe violation.", that); - } - break; - } - if (nexttoken.id !== '.') { - warning("ADsafe violation.", that); - break; - } - advance('.'); - token.left = that; - token.right = m; - that = token; - m = identifier(); - if (typeof m === 'string') { - countMember(m); - } - } - } - return that; - }, 160, true); - - infix('(', function (left, that) { - var left = token - abut(prevtoken, token); - nospace(); - var n = 0, - p = []; - if (left) { - if (left.type === '(identifier)') { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if (left.value !== 'Number' && left.value !== 'String' && - left.value !== 'Boolean' && left.value !== 'Date') { - if (left.value === 'Math') { - warning("Math is not a function.", left); - } else if (option.newcap) { - warning("Missing 'new' prefix when invoking a constructor.", - left); - } - } - } - } else if (left.id === '.') { - if (option.safe && left.left.value === 'Math' && - left.right === 'random') { - warning("ADsafe violation.", left); - } - } - } - if (nexttoken.id !== ')') { - for (;;) { - // ## singleExpression - p[p.length] = parse(10, 'singleExpression'); - n += 1; - if (nexttoken.id !== ',') { - break; - } - comma(); - } - } - var lasttoken = token - advance(')'); - - // ## - var right = token - left.right = right - right.left = left - lasttoken.rightParen = right - - if (option.immed && left.id === 'function' && nexttoken.id !== ')') { - warning("Wrap the entire immediate function invocation in parens.", - that); - } - nospace(prevtoken, token); - if (typeof left === 'object') { - if (left.value === 'parseInt' && n === 1) { - warning("Missing radix parameter.", left); - } - if (!option.evil) { - if (left.value === 'eval' || left.value === 'Function' || - left.value === 'execScript') { - warning("eval is evil.", left); - } else if (p[0] && p[0].id === '(string)' && - (left.value === 'setTimeout' || - left.value === 'setInterval')) { - warning( - "Implied eval is evil. Pass a function instead of a string.", left); - } - } - if (!left.identifier && left.id !== '.' && left.id !== '[' && - left.id !== '(' && left.id !== '&&' && left.id !== '||' && - left.id !== '?') { - warning("Bad invocation.", left); - } - - } - that.left = left; - return that; - }, 155, true).exps = true; - - prefix('(', function () { - var left = token - nospace(); - var v = parse(0); - var lasttoken = token - advance(')', this); - // ## - var right = token - left.right = right - right.left = left - lasttoken.rightParen = right - - nospace(prevtoken, token); - if (option.immed && v.id === 'function') { - if (nexttoken.id === '(') { - warning( -"Move the invocation into the parens that contain the function.", nexttoken); - } else { - warning( -"Do not wrap function literals in parens unless they are to be immediately invoked.", - this); - } - } - return v; - }); - - - // - // ## ObjC call handling - // - function ObjCParams(firstToken) - { - logExtraSyntax('objc', token) -// if (token.value != ']') - - token.isObjCFirstCall = true - token.isObjCCall = true - nexttoken.isObjCCall = true - nexttoken.isObjCFirstParam = true - firstToken.isObjCCallOpener = true - firstToken.isObjCCall = true - - var isObjCSuperCall = (token.value == 'original' || token.value == 'super') - token.isObjCSuperCall = isObjCSuperCall - nexttoken.isObjCSuperCall = isObjCSuperCall - - function advanceParameterName() - { - advance() -// if (!token.value.match(/^[a-zA-Z_]\w*/)) warningAt('Invalid selector name "' + token.value + '"', token.line, token.from) - } - - var instanceToken = token - var firstMessagePart = nexttoken - - var parameterCount = 0 - // Advance parameter name - advanceParameterName() - // Parameter(s) - var jsselector = token.value - if (nexttoken.id == ':') - { - nexttoken.isObjCParameterSeparator = true - parameterCount++ - advance(':') - jsselector += '_' - // Parameter value : any javascript expression, including anon functions - parse(0) - // Remaining parameters - while (nexttoken && nexttoken.value != ']') - { - if (nexttoken.id === '(end)') return warningAt('Unexpected end of ObjC call "' + token.value + '"', token.line, token.from) - // Handle variadic calls : must be comma list, last values before ] - if (nexttoken.value == ',') - { - while (nexttoken.value == ',') - { - advance(',') - parse(0) - } - // We're done for this message - continue - } - parameterCount++ - jsselector += nexttoken.value + '_' - nexttoken.isObjCCall = true - nexttoken.isObjCMultiCall = true - advanceParameterName() - // Next token must be a semicolon - if (nexttoken.id != ':') warning("ObjC message missing last paramater") - nexttoken.isObjCParameterSeparator = true - advance(':') - // Parameter value - parse(0) - } - } - - if (parameterCount) - firstMessagePart.objCJSSelector = jsselector - - if (nexttoken.value != ']') warning('ObjC call not closed') - nexttoken.isObjCCallCloser = true - nexttoken.isObjCCall = true - nexttoken.isObjCSuperCall = isObjCSuperCall - instanceToken.objCParameterCountOpener = parameterCount - nexttoken.objCParameterCountCloser = parameterCount - // Mark expression as valid standalone (skip warning in parse(), 'Expected an assignment or function call and instead saw an expression') - nexttoken.exps = true - } - - infix('[', function (left, that) { - var firstToken = token - nospace(); - var e = parse(0), s; - if (e && e.type === '(string)') { - if (option.safe && banned[e.value] === true) { - warning("ADsafe restricted word '{a}'.", that, e.value); - } - countMember(e.value); - if (!option.sub && ix.test(e.value)) { - s = syntax[e.value]; - if (!s || !s.reserved) { - warning("['{a}'] is better written in dot notation.", - e, e.value); - } - } - } else if (!e || (e.type !== '(number)' && - (e.id !== '+' || e.arity !== 'unary'))) { - if (option.safe) { - warning('ADsafe subscripting.'); - } - } - - // ## Parse an ObjC message (as a statement) - if (nexttoken.value != ']') - ObjCParams(firstToken) - advance(']', that); - - // Mark each token as siblings of each other - token.left = firstToken - firstToken.right = token - - nospace(prevtoken, token); - that.left = left; - that.right = e; - return that; - }, 160, true); - - prefix('[', function () { - var firstToken = token - // Doesn't seem to be used - this.first = []; - // Empty array - if (nexttoken.id === ']') { - advance(']'); - return; - } - var b = token.line !== nexttoken.line; - // Indentation check - if (b) { - indent += option.indent; - if (nexttoken.from === indent + option.indent) { - indent += option.indent; - } - } - for (;;) { - // Indentation check - if (b && token.line !== nexttoken.line) { - indentation(); - } - parse(10); - if (nexttoken.id === ',') { - comma(); - if (nexttoken.id === ',') { - warning("Extra comma.", token); - } else if (nexttoken.id === ']') { - warning("Extra comma.", token); - break; - } - } else { - if (b) { - indent -= option.indent; - indentation(); - } - break; - } - } - - -//alert(dumpHashNoFunction(token) + '\n*****************\n' + dumpHashNoFunction(nexttoken)) - // ## Parse an ObjC message (as an assign expression) - if (nexttoken.value != ']') - ObjCParams(firstToken) - advance(']', this); - - // Mark each token as siblings of each other - token.left = firstToken - firstToken.right = token - - // ## as [+] can push an array immediate : a [+] ['b'] - return this; - }, 160); - - (function (x) { - x.nud = function () { - - // ## firstToken - var firstToken = token - - var b, i, s, seen = {}; - b = token.line !== nexttoken.line; - if (b) { - indent += option.indent; - if (nexttoken.from === indent + option.indent) { - indent += option.indent; - } - } - for (;;) { - if (nexttoken.id === '}') { - break; - } - if (b) { - indentation(); - } - i = optionalidentifier(true); - if (!i) { - if (nexttoken.id === '(string)') { - i = nexttoken.value; - if (ix.test(i)) { - s = syntax[i]; - } - advance(); - } else if (nexttoken.id === '(number)') { - i = nexttoken.value.toString(); - advance(); - } else { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, '}', nexttoken.value); - } - } - if (seen[i] === true) { - warning("Duplicate member '{a}'.", nexttoken, i); - } - seen[i] = true; - countMember(i); - advance(':'); - nonadjacent(token, nexttoken); - // ## Don't allow comma expressions (a, b, c) - parse(10, 'singleExpression'); - if (nexttoken.id === ',') { - comma(); - if (nexttoken.id === ',' || nexttoken.id === '}') { - warning("Extra comma.", token); - } - } else { - break; - } - } - if (b) { - indent -= option.indent; - indentation(); - } - advance('}', this); - - // ## - token.left = firstToken - firstToken.right = token - return this - - return; - }; - x.fud = function () { - error("Expected to see a statement and instead saw a block.", token); - }; - }(delim('{'))); - - - function varstatement(prefix) { - -// JavaScript does not have block scope. It only has function scope. So, -// declaring a variable in a block can have unexpected consequences. - - var name, value; - - if (funct['(onevar)'] && option.onevar) { - warning("Too many var statements."); - } else if (!funct['(global)']) { - funct['(onevar)'] = true; - } - this.first = []; - for (;;) { - nonadjacent(token, nexttoken); - addlabel(identifier(), 'unused'); - if (prefix) { - break; - } - name = token; - this.first.push(token); - if (nexttoken.id === '=') { - nonadjacent(token, nexttoken); - advance('='); - nonadjacent(token, nexttoken); - if (peek(0).id === '=' && nexttoken.identifier) { - error("Variable {a} was not declared correctly.", - nexttoken, nexttoken.value); - } - // ## 'var' - value = parse(0, 'singleExpression'); - name.first = value; - } - if (nexttoken.id !== ',') { - break; - } - comma(); - } - return this; - } - - - stmt('var', varstatement); - - stmt('new', function () { - warning("'new' should not be used as a statement."); - }); - - - function functionparams() { - var i, t = nexttoken, p = []; - advance('('); - nospace(); - if (nexttoken.id === ')') { - advance(')'); - nospace(prevtoken, token); - return; - } - for (;;) { - i = identifier(); - p.push(i); - addlabel(i, 'parameter'); - if (nexttoken.id === ',') { - comma(); - } else { - advance(')', t); - nospace(prevtoken, token); - return p.join(', '); - } - } - } - - function doFunction(i) { - var s = scope; - scope = Object.create(s); - funct = { - '(name)' : i || '"' + anonname + '"', - '(line)' : nexttoken.line + 1, - '(context)' : funct, - '(breakage)': 0, - '(loopage)' : 0, - '(scope)' : scope - }; - token.funct = funct; - - // ## - var startToken = token - logFunctionStart(token) - - functions.push(funct); - if (i) { - addlabel(i, 'function'); - } - // ## May omit params - if (nexttoken.value == '(') - funct['(params)'] = functionparams(); - block(false); - scope = s; - funct = funct['(context)']; - // ## - logFunctionEnd(startToken, token) - } - - - // ## - var functionBlockFunction = function () { - if (inblock) { - // ## Allowed ! -// warning("Function statements cannot be placed in blocks. Use a function expression or move the statement to the top of the outer function.", token); - } - var i = identifier(); - adjacent(token, nexttoken); - addlabel(i, 'unused'); - doFunction(i); - if (nexttoken.id === '(' && nexttoken.line === token.line) { - error( -"Function statements are not invocable. Wrap the whole function invocation in parens."); - } - } - blockstmt('function', functionBlockFunction); - blockstmt('ƒ', functionBlockFunction); - - // ## - var functionPrefixFunction = function () { - var i = optionalidentifier(); - if (i) { - adjacent(token, nexttoken); - } else { - nonadjacent(token, nexttoken); - } - doFunction(i); - if (funct['(loopage)'] && nexttoken.id !== '(') { - warning("Be careful when making functions within a loop. Consider putting the function in a closure."); - } - return this; - } - - prefix('function', functionPrefixFunction); - prefix('ƒ', functionPrefixFunction); - - blockstmt('if', function () { - var t = nexttoken; - advance('('); - nonadjacent(this, t); - nospace(); - parse(20); - if (nexttoken.id === '=') { - warning("Expected a conditional expression and instead saw an assignment."); - advance('='); - parse(20); - } - advance(')', t); - nospace(prevtoken, token); - block(true); - if (nexttoken.id === 'else') { - nonadjacent(token, nexttoken); - advance('else'); - if (nexttoken.id === 'if' || nexttoken.id === 'switch') { - statement(true); - } else { - block(true); - } - } - return this; - }); - - blockstmt('try', function () { - var b, e, s; - if (option.adsafe) { - warning("ADsafe try violation.", this); - } - block(false); - if (nexttoken.id === 'catch') { - advance('catch'); - nonadjacent(token, nexttoken); - advance('('); - s = scope; - scope = Object.create(s); - e = nexttoken.value; - if (nexttoken.type !== '(identifier)') { - warning("Expected an identifier and instead saw '{a}'.", - nexttoken, e); - } else { - addlabel(e, 'exception'); - } - advance(); - advance(')'); - block(false); - b = true; - scope = s; - } - if (nexttoken.id === 'finally') { - advance('finally'); - block(false); - return; - } else if (!b) { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, 'catch', nexttoken.value); - } - }); - - blockstmt('while', function () { - var t = nexttoken; - funct['(breakage)'] += 1; - funct['(loopage)'] += 1; - advance('('); - nonadjacent(this, t); - nospace(); - parse(20); - if (nexttoken.id === '=') { - warning("Expected a conditional expression and instead saw an assignment."); - advance('='); - parse(20); - } - advance(')', t); - nospace(prevtoken, token); - block(true); - funct['(breakage)'] -= 1; - funct['(loopage)'] -= 1; - }).labelled = true; - - reserve('with'); - - blockstmt('switch', function () { - var t = nexttoken, - g = false; - funct['(breakage)'] += 1; - advance('('); - nonadjacent(this, t); - nospace(); - this.condition = parse(20); - advance(')', t); - nospace(prevtoken, token); - nonadjacent(token, nexttoken); - t = nexttoken; - advance('{'); - nonadjacent(token, nexttoken); - indent += option.indent; - this.cases = []; - for (;;) { - switch (nexttoken.id) { - case 'case': - switch (funct['(verb)']) { - case 'break': - case 'case': - case 'continue': - case 'return': - case 'switch': - case 'throw': - break; - default: - warning( - "Expected a 'break' statement before 'case'.", - token); - } - indentation(-option.indent); - advance('case'); - this.cases.push(parse(20)); - g = true; - advance(':'); - funct['(verb)'] = 'case'; - break; - case 'default': - switch (funct['(verb)']) { - case 'break': - case 'continue': - case 'return': - case 'throw': - break; - default: - warning( - "Expected a 'break' statement before 'default'.", - token); - } - indentation(-option.indent); - advance('default'); - g = true; - advance(':'); - break; - case '}': - indent -= option.indent; - indentation(); - advance('}', t); - if (this.cases.length === 1 || this.condition.id === 'true' || - this.condition.id === 'false') { - warning("This 'switch' should be an 'if'.", this); - } - funct['(breakage)'] -= 1; - funct['(verb)'] = undefined; - return; - case '(end)': - error("Missing '{a}'.", nexttoken, '}'); - return; - default: - if (g) { - switch (token.id) { - case ',': - error("Each value should have its own case label."); - return; - case ':': - statements(); - break; - default: - error("Missing ':' on a case clause.", token); - } - } else { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, 'case', nexttoken.value); - } - } - } - }).labelled = true; - - stmt('debugger', function () { - if (!option.debug) { - warning("All 'debugger' statements should be removed."); - } - }); - - stmt('do', function () { - funct['(breakage)'] += 1; - funct['(loopage)'] += 1; - block(true); - advance('while'); - var t = nexttoken; - nonadjacent(token, t); - advance('('); - nospace(); - parse(20); - if (nexttoken.id === '=') { - warning("Expected a conditional expression and instead saw an assignment."); - advance('='); - parse(20); - } - advance(')', t); - nospace(prevtoken, token); - funct['(breakage)'] -= 1; - funct['(loopage)'] -= 1; - }).labelled = true; - - blockstmt('for', function () { - var s, t = nexttoken; - funct['(breakage)'] += 1; - funct['(loopage)'] += 1; - advance('('); - nonadjacent(this, t); - nospace(); - if (peek(nexttoken.id === 'var' ? 1 : 0).id === 'in') { - if (nexttoken.id === 'var') { - advance('var'); - varstatement(true); - } else { - switch (funct[nexttoken.value]) { - case 'unused': - funct[nexttoken.value] = 'var'; - break; - case 'var': - break; - default: - warning("Bad for in variable '{a}'.", - nexttoken, nexttoken.value); - } - advance(); - } - advance('in'); - parse(20); - advance(')', t); - s = block(true); - if (!option.forin && (s.length > 1 || typeof s[0] !== 'object' || - s[0].value !== 'if')) { - warning("The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.", this); - } - funct['(breakage)'] -= 1; - funct['(loopage)'] -= 1; - return this; - } else { - if (nexttoken.id !== ';') { - if (nexttoken.id === 'var') { - advance('var'); - varstatement(); - } else { - for (;;) { - parse(0, 'for'); - if (nexttoken.id !== ',') { - break; - } - comma(); - } - } - } - nolinebreak(token); - advance(';'); - if (nexttoken.id !== ';') { - parse(20); - if (nexttoken.id === '=') { - warning("Expected a conditional expression and instead saw an assignment."); - advance('='); - parse(20); - } - } - nolinebreak(token); - advance(';'); - if (nexttoken.id === ';') { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, ')', ';'); - } - if (nexttoken.id !== ')') { - for (;;) { - parse(0, 'for'); - if (nexttoken.id !== ',') { - break; - } - comma(); - } - } - advance(')', t); - nospace(prevtoken, token); - block(true); - funct['(breakage)'] -= 1; - funct['(loopage)'] -= 1; - } - }).labelled = true; - - - stmt('break', function () { - var v = nexttoken.value; - if (funct['(breakage)'] === 0) { - warning("Unexpected '{a}'.", nexttoken, this.value); - } - // ## Allow missing semicolon - if (this.line !== nexttoken.line) return - nolinebreak(this); - if (nexttoken.id !== ';') { - if (token.line === nexttoken.line) { - if (funct[v] !== 'label') { - warning("'{a}' is not a statement label.", nexttoken, v); - } else if (scope[v] !== funct) { - warning("'{a}' is out of scope.", nexttoken, v); - } - advance(); - } - } - reachable('break'); - }); - - - stmt('continue', function () { - var v = nexttoken.value; - if (funct['(breakage)'] === 0) { - warning("Unexpected '{a}'.", nexttoken, this.value); - } - // ## Allow missing semicolon - if (this.line !== nexttoken.line) return - nolinebreak(this); - if (nexttoken.id !== ';') { - if (token.line === nexttoken.line) { - if (funct[v] !== 'label') { - warning("'{a}' is not a statement label.", nexttoken, v); - } else if (scope[v] !== funct) { - warning("'{a}' is out of scope.", nexttoken, v); - } - advance(); - } - } - reachable('continue'); - }); - - - stmt('return', function () { - // ## Allow 'return' without semicolon -// nolinebreak(this); - - if (nexttoken.id === '(regexp)') { - warning("Wrap the /regexp/ literal in parens to disambiguate the slash operator."); - } - - // Ruby-like if return : everything must fit on the line - // return exp if (exp) - // return exp unless (exp) - function isIfReturn() - { - var b = (nexttoken.id == 'if' || nexttoken.value == 'unless') && token.line == nexttoken.line - returnToken.isIfReturn = b - return b - } - function parseIfReturn() - { - logExtraSyntax('ifReturn', token) - if (nexttoken.id == 'if') advance('if') - else advance('unless') - token.isIfReturnOpener = token - // Manually mark unless as reserved - token.reserved = true - advance('(') - parse(20) - advance(')') - token.isIfReturnCloser = token - } - - var returnToken = token - // Maybe if return - if (isIfReturn()) { - parseIfReturn() - } - else - if (nexttoken.id !== ';' && !nexttoken.reach /*## only parse what's on current line */ && token.line == nexttoken.line) { - nonadjacent(token, nexttoken); - parse(20); -/* - // ## Allow multiple expression return - // return a(), b(), 'hello' - while (nexttoken.value == ',') - { - advance(',') - parse(20) - } -*/ - // ## Maybe if return - if (isIfReturn()) parseIfReturn() - } - - reachable('return'); - }); - - - stmt('throw', function () { - nolinebreak(this); - nonadjacent(token, nexttoken); - parse(20); - reachable('throw'); - }); - - // ## JSCocoa class syntax - function parseObjJClass(style) { - // Protect against inner definitions - if (parsingClass) return warningAt('Inner classes are not of this world', token.line, token.from) - parsingClass = true - - logExtraSyntax('class', token) - token.isObjCClassStart = true - advance() - var className = token - if (className.type != '(identifier)') warningAt('Class name must be an identifier', token.line, token.from) - // If we have a '<', we're deriving from the following class. - // If not, we're just adding methods to the class. - if (nexttoken.value == '<' || nexttoken.value == ':') - { - if (style == '@implementation') advance(':') - else advance('<') - var parentClassName = token - advance() - if (token.type != '(identifier)') warningAt('Parent class name must be an identifier', token.line, token.from) - } - else - // Category - if (nexttoken.value == '(') - { - advance('(') - token.isObjCCategory = true - advance() - if (token.type != '(identifier)') warningAt('Category name must be an identifier', token.line, token.from) - advance(')') - } - // Parse class params - if (style == '@implementation' && nexttoken.value == '{') - { - advance('{') - token.isObjCVarList = true - // Pretty basic for now : skipping everything - while (nexttoken && nexttoken.value != '}') - { - if (nexttoken.id === '(end)') return warningAt('Unexpected end of ObjC call "' + token.value + '"', token.line, token.from) - advance() - } - advance('}') - } - - if (style != '@implementation') advance('{') - - var validTokens = { '-' : true, '+' : true, 'IBOutlet' : true, 'IBAction' : true, 'swizzle' : true, 'Swizzle' : true, 'Key' : true, 'function' : true, 'ƒ' : true } - var parsingClassDefinition = true - - - function type() - { - var line = nexttoken.line - advance('(') - var type = '' - var typeTokenCount = 0 - var startToken = nexttoken - while (nexttoken && nexttoken.value != ')' && nexttoken.line == line) - { - advance() - type += token.value - typeTokenCount++ - } - if (!typeTokenCount) warningAt('Missing parameter type', token.line, token.from) - var endToken = token - if (endToken.line != token.line) warningAt('Parameter must be defined on one line', token.line, token.from) - type = lines[startToken.line].substr(startToken.from, endToken.character-startToken.from) - encodings.push("'" + type + "'") - advance(')') - } - - while (validTokens[nexttoken.value] && parsingClassDefinition) - { - nexttoken.isObjCClassItemStart = true - var dataHolder = nexttoken - - // Advance type - advance() - // Advance method swizzler - if (token.value.toLowerCase() == 'swizzle') token.reserved = true, advance() - - // Method - if (token.value == '-' || token.value == '+') - { - var methodName = '' - var encodings = [] - var paramNames = [] - // Advance return type - type() - - nexttoken.isObjCCall = true - advance() - methodName += token.value - - var needToParseNameAndType = false - while (nexttoken && (nexttoken.value == ':' || needToParseNameAndType)) - { - advance(':') - methodName += ':' - type() - // param name - advance() - paramNames.push(token.value) - needToParseNameAndType = false - if (nexttoken.type == '(identifier)') - { - needToParseNameAndType = true - nexttoken.isObjCCall = true - advance() - methodName += token.value - } - } - dataHolder.objCMethodName = methodName - dataHolder.objCMethodEncodings = encodings - dataHolder.objCMethodParamNames = paramNames - - block(false) - } - // Outlet - else if (token.value == 'IBOutlet') - { - token.reserved = true - // Outlet name - advance() - // Outlet setter name may have been redefined - if (nexttoken.value == '(') - { - advance('(') - advance() - if (token.type != '(identifier)') warningAt('Outlet param must be an identifier', token.line, token.from) - advance(')') - block(0) - } - } - // Action : name + possible parameter name - else if (token.value == 'IBAction') - { - token.reserved = true - // Action name - advance() - // Param name may have been redefined - if (nexttoken.value == '(') - { - advance('(') - advance() - if (token.type != '(identifier)') warningAt('Outlet param must be an identifier', token.line, token.from) - advance(')') - } - block(0) - } - // Key - else if (token.value == 'Key') - { - token.reserved = true - // Key name - advance() - if (token.type != '(identifier)') warningAt('Key param must be an identifier', token.line, token.from) - } - // Javascript function - else if (token.value == 'function' || token.value == 'ƒ') - { - var jsfn = token - jsfn.isClassJSFunction = true - var i = identifier() - jsfn.jsFunctionName = token - doFunction(i) - } - else - { - warningAt('missing valid token handler for "' + token.value + '" while parsing JSCocoa class', token.line, token.from) - parsingClassDefinition = false - } - } - - if (style == '@implementation') - { - // Advance only checks token.id, @end is stored in token.value - if (nexttoken.value == '@end') nexttoken.id = nexttoken.value - advance('@end') - } - else advance('}') - parsingClass = false - } - stmt('class', parseObjJClass); - - stmt('@implementation', function () { - parseObjJClass('@implementation') - }) - - - reserve('void'); - -// Superfluous reserved words - -// reserve('class'); - reserve('const'); - reserve('enum'); - reserve('export'); - reserve('extends'); - reserve('float'); - reserve('goto'); - reserve('import'); - reserve('let'); - // ## We use this for ObjJ super call -// reserve('super'); - - function jsonValue() { - function jsonObject() { - var o = {}, t = nexttoken; - advance('{'); - if (nexttoken.id !== '}') { - for (;;) { - if (nexttoken.id === '(end)') { - error("Missing '}' to match '{' from line {a}.", - nexttoken, t.line + 1); - } else if (nexttoken.id === '}') { - warning("Unexpected comma.", token); - break; - } else if (nexttoken.id === ',') { - error("Unexpected comma.", nexttoken); - } else if (nexttoken.id !== '(string)') { - warning("Expected a string and instead saw {a}.", - nexttoken, nexttoken.value); - } - if (o[nexttoken.value] === true) { - warning("Duplicate key '{a}'.", - nexttoken, nexttoken.value); - } else if (nexttoken.value === '__proto__') { - warning("Stupid key '{a}'.", - nexttoken, nexttoken.value); - } else { - o[nexttoken.value] = true; - } - advance(); -//## - advance(':'); - jsonValue(); - if (nexttoken.id !== ',') { - break; - } - advance(','); - } - } - advance('}'); - } - - function jsonArray() { - var t = nexttoken; - advance('['); - - if (nexttoken.id !== ']') { - for (;;) { - if (nexttoken.id === '(end)') { - error("Missing ']' to match '[' from line {a}.", - nexttoken, t.line + 1); - } else if (nexttoken.id === ']') { - warning("Unexpected comma.", token); - break; - } else if (nexttoken.id === ',') { - error("Unexpected comma.", nexttoken); - } - jsonValue(); - if (nexttoken.id !== ',') { - break; - } - advance(','); - } - } - advance(']'); - } - switch (nexttoken.id) { - case '{': - jsonObject(); - break; - case '[': - jsonArray(); - break; - case 'true': - case 'false': - case 'null': - case '(number)': - case '(string)': - advance(); - break; - case '-': - advance('-'); - if (token.character !== nexttoken.from) { - warning("Unexpected space after '-'.", token); - } - adjacent(token, nexttoken); - advance('(number)'); - break; - default: - error("Expected a JSON value.", nexttoken); - } - } - - -// The actual JSLINT function itself. - - var itself = function (s, o) { - var a, i; - JSLINT.errors = []; - predefined = Object.create(standard); - if (o) { - a = o.predef; - if (a instanceof Array) { - for (i = 0; i < a.length; i += 1) { - predefined[a[i]] = true; - } - } - if (o.adsafe) { - o.safe = true; - } - if (o.safe) { - o.browser = false; - o.css = false; - o.debug = false; - o.eqeqeq = true; - o.evil = false; - o.forin = false; - o.nomen = true; - o.on = false; - o.rhino = false; - o.safe = true; - o.sidebar = false; - o.strict = true; - o.sub = false; - o.undef = true; - o.widget = false; - predefined.Date = false; - predefined['eval'] = false; - predefined.Function = false; - predefined.Object = false; - predefined.ADSAFE = true; - predefined.lib = true; - } - option = o; - } else { - option = {}; - } - option.indent = option.indent || 4; - adsafe_id = ''; - adsafe_may = false; - adsafe_went = false; - approved = {}; - if (option.approved) { - for (i = 0; i < option.approved.length; i += 1) { - approved[option.approved[i]] = option.approved[i]; - } - } else { - approved.test = 'test'; - } - tab = ''; - for (i = 0; i < option.indent; i += 1) { - tab += ' '; - } - indent = 0; - global = Object.create(predefined); - scope = global; - funct = { - '(global)': true, - '(name)': '(global)', - '(scope)': scope, - '(breakage)': 0, - '(loopage)': 0 - }; - functions = []; - ids = {}; - urls = []; - src = false; - xmode = false; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - jsonmode = false; - warnings = 0; - lex.init(s); - prereg = true; - - // ## (internal) Guard against Inner class - parsingClass = false - - prevtoken = token = nexttoken = syntax['(begin)']; - assume(); - - try { - advance(); - if (nexttoken.value.charAt(0) === '<') { - html(); - if (option.adsafe && !adsafe_went) { - warning("ADsafe violation: Missing ADSAFE.go.", this); - } - } else { - switch (nexttoken.id) { -/* - // ## Don't handle json values as they interfere with ObjC messaging - case '{': - case '[': - option.laxbreak = true; - jsonmode = true; - jsonValue(); - break;*/ -/* - // ## Don't handle css classes as @implementation is valid ObjJ syntax - case '@': - case '*': - case '#': - case '.': - case ':': - xmode = 'style'; - advance(); - if (token.id !== '@' || !nexttoken.identifier || - nexttoken.value !== 'charset') { - error('A css file should begin with @charset "UTF-8";'); - } - advance(); - if (nexttoken.type !== '(string)' && - nexttoken.value !== 'UTF-8') { - error('A css file should begin with @charset "UTF-8";'); - } - advance(); - advance(';'); - styles(); - break; -*/ - default: - if (option.adsafe && option.fragment) { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, '
', nexttoken.value); - } - statements('lib'); - } - } - advance('(end)'); - } catch (e) { - if (e) { - JSLINT.errors.push({ - reason : e.message, - line : e.line || nexttoken.line, - // ## fails on alert(' - character : e.character || (nexttoken ? nexttoken.from : 0) - }, null); - } - } - return JSLINT.errors.length === 0; - }; - - function to_array(o) { - var a = [], k; - for (k in o) { - if (o.hasOwnProperty(k)) { - a.push(k); - } - } - return a; - } - -// Report generator. - - itself.report = function (option, sep) { - var a = [], c, e, f, i, k, l, m = '', n, o = [], s, v, - cl, ex, va, un, ou, gl, la; - - function detail(h, s, sep) { - if (s.length) { - o.push('
' + h + ' ' + - s.sort().join(sep || ', ') + '
'); - } - } - - s = to_array(implied); - - k = JSLINT.errors.length; - if (k || s.length > 0) { - o.push('
Error:'); - if (s.length > 0) { - s.sort(); - for (i = 0; i < s.length; i += 1) { - s[i] = '' + s[i] + ' ' + - implied[s[i]].join(' ') + - ''; - } - o.push('

Implied global: ' + s.join(', ') + '

'); - c = true; - } - for (i = 0; i < k; i += 1) { - c = JSLINT.errors[i]; - if (c) { - e = c.evidence || ''; - o.push('

Problem' + (isFinite(c.line) ? ' at line ' + (c.line + 1) + - ' character ' + (c.character + 1) : '') + - ': ' + c.reason.entityify() + - '

' + - (e && (e.length > 80 ? e.slice(0, 77) + '...' : - e).entityify()) + '

'); - } - } - o.push('
'); - if (!c) { - return o.join(''); - } - } - - if (!option) { - - o.push('
'); - - if (urls.length > 0) { - detail("URLs
", urls, '
'); - } - - s = to_array(scope); - if (s.length === 0) { - if (jsonmode) { - if (k === 0) { - o.push('

JSON: good.

'); - } else { - o.push('

JSON: bad.

'); - } - } else { - o.push('
No new global variables introduced.
'); - } - } else { - o.push('
Global ' + s.sort().join(', ') + '
'); - } - - for (i = 0; i < functions.length; i += 1) { - f = functions[i]; - cl = []; - ex = []; - va = []; - un = []; - ou = []; - gl = []; - la = []; - for (k in f) { - if (f.hasOwnProperty(k) && k.charAt(0) !== '(') { - v = f[k]; - switch (v) { - case 'closure': - cl.push(k); - break; - case 'exception': - ex.push(k); - break; - case 'var': - va.push(k); - break; - case 'unused': - un.push(k); - break; - case 'label': - la.push(k); - break; - case 'outer': - ou.push(k); - break; - case true: - gl.push(k); - break; - } - } - } - o.push('
' + f['(line)'] + ' ' + - (f['(name)'] || '') + '(' + - (f['(params)'] || '') + ')
'); - detail('Closure', cl); - detail('Variable', va); - detail('Exception', ex); - detail('Outer', ou); - detail('Global', gl); - detail('Unused', un); - detail('Label', la); - } - a = []; - for (k in member) { - if (typeof member[k] === 'number') { - a.push(k); - } - } - if (a.length) { - a = a.sort(); - m = '
/*members ';
-                l = 10;
-                for (i = 0; i < a.length; i += 1) {
-                    k = a[i];
-                    n = k.name();
-                    if (l + n.length > 72) {
-                        o.push(m + '
'); - m = ' '; - l = 1; - } - l += n.length + 2; - if (member[k] === 1) { - n = '' + n + ''; - } - if (i < a.length - 1) { - n += ', '; - } - m += n; - } - o.push(m + '
*/
'); - } - o.push('
'); - } - return o.join(''); - }; - - itself.edition = '2009-05-06'; - - var JSLINTGLOBALS = {} - var _varstatement = varstatement - varstatement = function () { - return _varstatement.apply(JSLINTGLOBALS, arguments) - } - return itself; - -}); - - return JSLINT -} \ No newline at end of file diff --git a/Cocoa/main.m b/Cocoa/main.m deleted file mode 100644 index 39a150df6..000000000 --- a/Cocoa/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// Atomicity -// -// Created by Chris Wanstrath on 8/18/11. -// Copyright 2011 GitHub. All rights reserved. -// - -#import -#import -#import "JSCocoa.h" - -int main(int argc, char *argv[]) -{ - return NSApplicationMain(argc, (const char **) argv); -} diff --git a/README-CHRIS.md b/README-CHRIS.md deleted file mode 100644 index 0f0a8028b..000000000 --- a/README-CHRIS.md +++ /dev/null @@ -1,145 +0,0 @@ -![](https://img.skitch.com/20110828-e6a2sk5mqewpfnxb3eeuef112d.png) - -# Futuristic Text Editing - -Atomicity is a highly extensible OS X text editor. It is written in CoffeeScript, HTML, and CSS utilizing the power of JSCocoa and the elegance of Ajax.org's Ace editor. - -## Atomicity Startup - -When Atomicity starts, AtomApp (the application delegate) immediately loads require.coffee and app.coffee using JSCocoa. - -app.coffee exports the following two functions: - -- `startup: ->` - -Called right away in a global JSCocoa context for the app. Different than a browser environment - there is no `window` global, no `document`, etc. Just Atomicity's standard library: require, underscore, etc. - -In here we setup the app's menu structure using the AtomMenu class, bind basic app-wide keyboard events with the Keybinder, load our core UI files, load extensions using the ExtensionManager module, and load your `~/.atomicity` module. - -Loading core UI files and extensions is important because it gives those modules a chance to register for app events. - -After all that's done we check `localStorage` for saved AtomWindow bounds & URLs and recreate them if they exist. If they don't exist we create a fresh AtomWindow. At this point we're done starting up. - -- `shutdown: ->` - -Called before shutting down. The app doesn't finish quitting until this function returns. - -Here is where we save the window positions in localStorage and do any other global cleanup, which is probably nothing. - -## Events - -Atomicity has a jQuery/Backbone-style event system using the `on` and `off` functions of the `AtomEvent` module. Events should be in the format of: `namespace:event`, for example `window:load` for onLoad or `plugin:install` for when a plugin is installed. - -```coffee -AtomEvent.on 'window:load', (window) -> - myCode() -``` - -Individual events can be uninstalled using `off`: - -```coffee -AtomEvent.off 'window:load' -``` - -As well as entire namespaces: - -```coffee -AtomEvent.off 'window:' -``` - -## AtomWindow Creation - -Every AtomWindow represents a URL. If we don't pass in a URL when creating an AtomWindow, it'll set its URL to something random in /tmp. - -When we instantiate an AtomWindow it creates a WebView and sets itself as the delegate then loads `index.html`. When the WebView finishes loading the AtomWindow fires a `window:load` event, passing itself as the sole argument. - -Extensions will probably listen for the `window:load` event, as will core Atomicity UI code. - -## Atomicity UI Code - -Atomicity has a few classes in addition to AtomWindow strictly for UI. Each UI class is a "View" while the HTML it represents is a "Template". - -- View - -Generic class that represents a chunk of HTML, or template. Like Backbone it has a `el` property (a string selector) and a `render` method, which inserts the template into the DOM. Also has a `remove` method. - -- Pane - -Special view. Has a position. - -- Modal - -Facebox. - -## Extensions - -Extensions are directories with a package.json file based on npm's: https://github.com/isaacs/npm/blob/master/doc/cli/json.md - -`name`, `version`, `description`, `homepage`, and `author` are probably the only ones that matter most right now. - -Extensions also have an index.coffee (or `main` in the package.json) file that exports the following functions: - -- `install: ->` - -Called the very first time your extension is loaded, before `startup`. - -- `uninstall: ->` - -Called when your extension is being uninstalled. This is where you should delete any saved data. - -- `startup: ->` - -Called when the extension is first loaded during the app's startup or an in-process loading of the extension. - -Here you'd hand Keybinder a keymap for your extension, add items to AtomMenu, add items to AtomContextMenu, and attach a callback to `window:load` that creates & renders AtomViews if necessary. - -- `shutdown: ->` - -Called when the app shuts down or your extension is disabled. Different than `window:close`. Make sure to clean up after yourself here by using `AtomEvent.off` and whatever else. - -## ExtensionManager - -The ExtensionManager module loads, installs, uninstalls, and keeps track of extensions. All extensions are global to the whole app, and enabled/disabled on an app-wide basis. - -It fires the following events on AtomEvent, passing the Extension module to each: - -- `extension:install` -- `extension:uninstall` -- `extension:startup` -- `extension:shutdown` - -## Keybinder - -Module with a single public function: - -- `bind: (scope, map) ->` - -`scope` should be one of: - -- `'app'` -- `'window'` -- A Pane object - -While `map` should be a key/value object in this format: `shortcut: callback`. - -- `shortcut` should be a string like `cmd+w` or `ctrl+shift+o` -- `callback` should be a function - -For example: - -```coffee -Keybinder.bind 'app', - 'cmd+o': openFile - 'cmd+s': saveFile - -# Called inside a View -Keybinder.bind this, - 'cmd+shift+r': => @reload() - 'cmd+shift+o': => @openURL() -``` - -Needs more thought. - -## AtomMenu - -Used by core app classes and extensions to add menu items to the app. Needs more thought. diff --git a/README-COREY.md b/README-COREY.md deleted file mode 100644 index de6fbeb30..000000000 --- a/README-COREY.md +++ /dev/null @@ -1,165 +0,0 @@ -## Dogma - -- Objective-C classes start with **RF** and JS classes start with **Atom** for disambiguation. *NOTE:* I'm not a huge fan of the **RF** prefix -- AtomApp **only** contains keybindings and a list of AtomWindows. Since it is in a seperate JSCocoa context, all communication must be done via AtomEvent. -- Each AtomWindow has an instance of every extensions. - -## Atomicity Startup - -When Atomicity starts, RFApp (the NSApplication instance and delegate) immediately loads require.coffee and `atom-app.coffee` using JSCocoa. - -atom-app.coffee exports the following two functions: - -- `startup: ->` - -Called right away in a global JSCocoa context for the app. Different than a browser environment - there is no `window` global, no `document`, etc. Just Atomicity's standard library: require, underscore, etc. - -In here we setup the app's menu structure using the AtomMenu class, bind app-wide keyboard events, and load your `~/.atomicity/index.coffee` module. - -After all that's done we check `localStorage` for saved AtomWindow URLs and recreate them if they exist. If they don't exist we create a fresh RFWindow. At this point we're done starting up. - -- `shutdown: ->` - -Called before shutting down. The app doesn't finish quitting until this function returns. - -Here is where we store AtomWindow URLS info in localStorage and close all windows. and do any other global cleanup, which is probably nothing. - -## RFWindow Creation - -AtomApp instantiates an RFWindow with an optional URL. RFWindow contains a WebView and sets itself as the delegate, creates a JSCocoa context and loads `index.html`. `atom-window.coffee` is required by `index.html`. An instance of AtomWindow is created with the URL and window bounds. - -## AtomWindow -Every AtomWindow represents a URL. If we don't pass in a URL when creating an AtomWindow, it'll set its URL to something random in /tmp. - -`atom-window.coffee` exports the following two functions: - -- `startup: ->` - -Loads our core UI files, extensions using the ExtensionManager module, and keybindings. - -Finally fires a `window:load` event, passing itself as the sole argument. Loading core UI files and extensions first is important because it gives those modules a chance to register for app events. - -- `shutdown: ->` - -Makes sure files are saved and window placement is remembered. - -## Events - -Atomicity has a jQuery/Backbone-style event system using the `on`, `off` and `trigger` functions of the `AtomEvent` module. Events should be in the format of: `namespace:event`, for example `window:load` for onLoad or `plugin:install` for when a plugin is installed. - -The only way AtomApp and AtomWindows can communicate is via Events. - -```coffee -AtomEvent.on 'window:load', (window) -> - myCode() -``` - -Trigger the event: - -```coffee -AtomEvent.trigger 'window:load', @ -``` - -Individual events can be uninstalled using `off`: - -```coffee -AtomEvent.off 'window:load', optional-event-or-function-or-something -``` - -As well as entire namespaces: - -```coffee -AtomEvent.off 'window:' -``` - -## Atomicity UI Code - -Atomicity has a few classes in addition to AtomWindow strictly for UI. Each UI class is a "View" while the HTML it represents is a "Template". - -- View - -Generic class that represents a chunk of HTML, or template. Like Backbone it has a `el` property (a string selector) and a `render` method, which inserts the template into the DOM. Also has a `remove` method. - -- Pane - -Special view. Has a position. - -- Modal - -Facebox. - -## Extensions - -Extensions are directories with a package.json file based on npm's: https://github.com/isaacs/npm/blob/master/doc/cli/json.md - -`name`, `version`, `description`, `homepage`, and `author` are probably the only ones that matter most right now. - -Extensions also have an index.coffee (or `main` in the package.json) file that exports the following functions: - -- `install: ->` - -Called the very first time your extension is loaded, before AtomWindow's `startup`. - -- `uninstall: ->` - -Called when your extension is being uninstalled. This is where you should delete any saved data. - -- `startup: ->` - -Called when the extension is first loaded during the AtomWindow's startup or an in-process loading of the extension. - -Here you'd hand Keybinder a keymap for your extension, add items to AtomMenu, add items to AtomContextMenu, and attach a callback to `window:load` that creates & renders AtomViews if necessary. - -- `shutdown: ->` - -Called when the AtomWindow closes or your extension is disabled. Make sure to clean up after yourself here by using `AtomEvent.off` and whatever else. - -## ExtensionManager - -The ExtensionManager module loads, installs, uninstalls, and keeps track of extensions. All extensions are local to an AtomWindow. - -It fires the following events on AtomEvent, passing the Extension module to each: - -- `extension:install` -- `extension:uninstall` -- `extension:startup` -- `extension:shutdown` - -## Keybinder - -**IDEA**: bindings are just events? - -Module with a single public function: - -- `bind: (scope, map) ->` - -`scope` should be one of: - -- `'app'` -- `'window'` -- A Pane object - -While `map` should be a key/value object in this format: `shortcut: callback`. - -- `shortcut` should be a string like `cmd+w` or `ctrl+shift+o` -- `callback` should be a function - -For example: - -```coffee -Keybinder.bind 'app', - 'cmd+o': openFile - 'cmd+s': saveFile - -# Called inside a View -Keybinder.bind this, - 'cmd+shift+r': => @reload() - 'cmd+shift+o': => @openURL() -``` - -Needs more thought. - -## AtomMenu - -Used by core app classes and extensions to add menu items to the app. Needs more thought. - diff --git a/Rakefile b/Rakefile index 9ec17853e..f9abe37e3 100644 --- a/Rakefile +++ b/Rakefile @@ -8,7 +8,7 @@ task :build do dest = File.join(built_dir, contents_dir, "Resources") - %w(index.html src docs static plugins test vendor ).each do |dir| + %w( index.html src docs static plugins test vendor ).each do |dir| rm_rf File.join(dest, dir) cp_r dir, File.join(dest, dir) end diff --git a/index.html b/index.html index c617b573b..f264f50c3 100644 --- a/index.html +++ b/index.html @@ -64,13 +64,9 @@
+ diff --git a/src/key-binder.coffee b/src/key-binder.coffee index c2d18a427..0fa4e9ac9 100644 --- a/src/key-binder.coffee +++ b/src/key-binder.coffee @@ -14,9 +14,9 @@ class KeyBinder @load: (path) -> try - Watcher.watch path, -> + Watcher.watch path, => # Should we keep track of which file bindings are associated with? That - # way we could clear bindings when the file is changed or deleted. I + # way we could clear bindings when the file is changed or deleted. I # think the answer is yes, but I don't want to do this right now. console.log "#{@name}: Reloading #{path}" @load path @@ -25,12 +25,12 @@ class KeyBinder for scopeName, bindings of json @create scopeName, binding, method for binding, method of bindings catch error - console.error "#{@class}: Could not load key bindings at `#{path}`. #{error}" + console.error "#{@name}: Could not load key bindings at `#{path}`. #{error}" @create: (scope, binding, method) -> if typeof scope is "string" throw "#{@name}: Unknown scope `#{scope}`" unless @scopes[scope] - scope = @scopes[scope] + scope = @scopes[scope] callback = if _.isFunction method -> method scope diff --git a/src/require.coffee b/src/require.coffee index 533a80d54..c32fdf0f1 100644 --- a/src/require.coffee +++ b/src/require.coffee @@ -1,15 +1,6 @@ resourcePath = OSX.NSBundle.mainBundle.resourcePath paths = [ - "/Users/chris/Code/Atomicity/src" - "/Users/chris/Code/Atomicity/plugins" - "/Users/chris/Code/Atomicity/test" - - "/Users/corey/code/mine/Atomicity/src" - "/Users/corey/code/mine/Atomicity/plugins" - "/Users/corey/code/mine/Atomicity/test" - "/Users/corey/code/mine/Atomicity/vendor" - "#{resourcePath}/src" "#{resourcePath}/plugins" "#{resourcePath}/vendor" diff --git a/src/watcher.coffee b/src/watcher.coffee index f0e5aa1d6..07070c7fc 100644 --- a/src/watcher.coffee +++ b/src/watcher.coffee @@ -1,4 +1,4 @@ -#module.exports = +module.exports = class Watcher @watchedPaths: {} @@ -44,7 +44,3 @@ class Watcher # Just ignore this else console.error "I HAVE NO IDEA WHEN #{notification} IS TRIGGERED" - -Watcher.watch "~/tmp/what.txt", -> - OSX.NSLog "HI" - diff --git a/src/window.coffee b/src/window.coffee index 729fbaf66..b3ca38c44 100644 --- a/src/window.coffee +++ b/src/window.coffee @@ -1,6 +1,8 @@ File = require 'fs' KeyBinder = require 'key-binder' +# This file is a weirdo. We don't create a Window class, we just add stuff to +# the DOM window. windowAdditions = extensions: [] diff --git a/static/key-bindings.coffee b/static/key-bindings.coffee index ba487a448..88b6d078e 100644 --- a/static/key-bindings.coffee +++ b/static/key-bindings.coffee @@ -1,2 +1,6 @@ app: "cmd-q": (app) -> app.quit() + "cmd-j": (app) -> console.log "OMG YOU TOUCHED THE LETTER J!" + +window: + "cmd-shift-i": (window) -> window.showConsole()