make hollywooMethod macro usable in hollywoo implementation dsls

This commit is contained in:
2024-07-13 18:47:57 -06:00
parent 6b12109d07
commit 98ba861d9c

View File

@@ -1022,6 +1022,7 @@
(,mode ,@body)
(otherwise (cc))))
(defMacroVar avoidDuplicateDefinition true)
// Some real magic happens here. This macro defines a method, AND a reader macro
// for calling it with skipping and cc passed automatically if cc is an argument.
// GOTCHA: DO NOT use (method) directly in this file outside of the above #unless subclass block!!
@@ -1053,7 +1054,7 @@
(b.callSymbol "b.symbol" [(b.str "null")])
])))))]
methodCall))
(#unless subclass @:keep (method ,nameAndType ,argList ,@body))
(#when (or !subclass !avoidDuplicateDefinition) @:keep (method ,nameAndType ,argList ,@body))
}))
(hollywooMethod :Void restorePlayMode [:Continuation cc]
@@ -1612,4 +1613,7 @@
creditsTSV
(makeCC
(stopSong skipping cc))
(director.getSongLength (dictGet songs songKey))))
(director.getSongLength (dictGet songs songKey))))
// This redefinition allows you to call (hollywooMethod) in your hollywoo implementation dsls and movie scripts:
(defMacroVar avoidDuplicateDefinition false)