1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

uiold fixes

This commit is contained in:
Alexander Medvednikov 2020-01-01 13:27:21 +01:00
parent e8bbb00bde
commit 807c16dd1b
2 changed files with 6 additions and 4 deletions

View File

@ -439,7 +439,7 @@ fn (p mut Parser) parse(pass Pass) {
}
p.fgen_nl()
p.builtin_mod = p.mod == 'builtin'
p.can_chash = p.mod in ['ui', 'darwin', 'clipboard', 'webview'] // TODO tmp remove
p.can_chash = p.mod in ['ui', 'uiold', 'darwin', 'clipboard', 'webview'] // TODO tmp remove
// Import pass - the first and the smallest pass that only analyzes imports
// if we are a building module get the full module name from v.mod
fq_mod := if p.pref.build_mode == .build_module && p.v.mod.ends_with(p.mod) { p.v.mod }
@ -525,7 +525,9 @@ fn (p mut Parser) parse(pass Pass) {
p.comp_time()
}
.key_global {
if !p.pref.translated && !p.pref.is_live && !p.builtin_mod && !p.pref.building_v && p.mod != 'ui' && !os.getwd().contains('/volt') && !p.pref.enable_globals {
if !p.pref.translated && !p.pref.is_live && !p.builtin_mod && !p.pref.building_v &&
p.mod != 'ui' && p.mod != 'uiold' && !os.getwd().contains('/volt') &&
!p.pref.enable_globals {
p.error('use `v --enable-globals ...` to enable globals')
// p.error('__global is only allowed in translated code')
}

View File

@ -1,4 +1,4 @@
module ui
module uiold
#flag -framework Carbon
#flag -framework Cocoa
@ -24,7 +24,7 @@ pub fn reg_key_vid() {
#EventTypeSpec eventType;
#eventType.eventClass = kEventClassKeyboard;
#eventType.eventKind = kEventHotKeyPressed;
#InstallApplicationEventHandler(&ui__focus_app, 1, &eventType, NULL, NULL);
#InstallApplicationEventHandler(&uiold__focus_app, 1, &eventType, NULL, NULL);
#gMyHotKeyID.signature = 'rml1';
#gMyHotKeyID.id = 1;
#RegisterEventHotKey(kVK_ANSI_1, cmdKey, gMyHotKeyID,