- Timestamp:
- 02/13/04 21:01:06 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/F-Script Anywhere/Source/FSAViewAssociationController.m
r19 r153 31 31 #import <FScript/FSInterpreter.h> 32 32 #import <FScript/System.h> 33 34 // XXX workaround for lack of identifier validation; should go away when F-Script adds (promised) direct support for this35 @interface Compiler36 + (BOOL)isValidIndentifier:(NSString *)str;37 @end38 33 39 34 @implementation FSAViewAssociationController … … 77 72 [statusField setStringValue: @""]; 78 73 if ([variableName length] != 0) { 79 if (![ Compiler isValidIndentifier: variableName]) {74 if (![FSInterpreter validateSyntaxForIdentifier: variableName]) { 80 75 [statusField setStringValue: @"Invalid name: contains spaces, punctuation or non-ASCII characters"]; 81 76 } else if (selectedElement != nil) { … … 102 97 } 103 98 104 - (void)_addElement:(id)element withLabel:(NSString *)label toSubmenuForItem:( NSMenuItem *)item;99 - (void)_addElement:(id)element withLabel:(NSString *)label toSubmenuForItem:(id<NSMenuItem>)item; 105 100 { 106 101 NSMenu *submenu = [item submenu]; 107 NSMenuItem *subItem;102 id<NSMenuItem> subItem; 108 103 if (submenu == nil) { 109 104 id superElement = [item representedObject]; … … 127 122 } 128 123 129 - (void)_addValueForSelector:(SEL)sel withLabel:(NSString *)label toSubmenuForItem:( NSMenuItem *)item;124 - (void)_addValueForSelector:(SEL)sel withLabel:(NSString *)label toSubmenuForItem:(id<NSMenuItem>)item; 130 125 { 131 126 id obj = [item representedObject]; … … 139 134 - (void)_addElementToMenu:(id)element; 140 135 { 141 NSMenuItem *item;136 id<NSMenuItem> item; 142 137 if (element == nil) return; 143 138 item = [viewHierarchyMenu addItemWithTitle: [@" " … … 271 266 - (IBAction)defineVariable:(id)sender; 272 267 { 273 #warning this should change when F-Script supports a public API for identifier validation274 268 NS_DURING 275 269 NSString *variableName = [variableNameField stringValue];
Note:
See TracChangeset
for help on using the changeset viewer.