mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 16:29:21 +00:00
tweak
This commit is contained in:
parent
d6abd72e55
commit
960b60cd2d
@ -378,6 +378,11 @@ internal class StatementReorderer(val program: Program,
|
||||
}
|
||||
|
||||
private fun replaceCallSubStatementWithGosub(function: Subroutine, call: FunctionCallStatement, parent: Node): Iterable<IAstModification> {
|
||||
if(function.parameters.isEmpty()) {
|
||||
// 0 params -> just GoSub
|
||||
return listOf(IAstModification.ReplaceNode(call, GoSub(null, call.target, null, call.position), parent))
|
||||
}
|
||||
|
||||
val assignParams =
|
||||
function.parameters.zip(call.args).map {
|
||||
var argumentValue = it.second
|
||||
|
@ -307,12 +307,10 @@ class GlobalNamespace(val modules: Iterable<Module>): Node, INameScope {
|
||||
}
|
||||
}
|
||||
|
||||
object BuiltinFunctionScopePlaceholder : INameScope {
|
||||
internal object BuiltinFunctionScopePlaceholder : INameScope {
|
||||
override val name = "<<builtin-functions-scope-placeholder>>"
|
||||
override val position = Position("<<placeholder>>", 0, 0, 0)
|
||||
override var statements = mutableListOf<Statement>()
|
||||
override var parent: Node = ParentSentinel
|
||||
override fun linkParents(parent: Node) {}
|
||||
}
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@ main {
|
||||
word @shared ww
|
||||
byte @shared bb
|
||||
|
||||
push(-bb)
|
||||
push(ub+1)
|
||||
pop(ub)
|
||||
txt.print_ub(ub)
|
||||
txt.nl()
|
||||
@ -25,6 +25,8 @@ main {
|
||||
txt.print_uw(uw)
|
||||
txt.nl()
|
||||
|
||||
single(ub+1)
|
||||
|
||||
; uw=10000
|
||||
; routines(44,uw+123)
|
||||
; routines2(44,uw+123)
|
||||
@ -39,6 +41,10 @@ main {
|
||||
|
||||
}
|
||||
|
||||
sub single(ubyte num) {
|
||||
num++
|
||||
}
|
||||
|
||||
sub routine(uword num, ubyte a1, ubyte a2, ubyte switch, byte a3) {
|
||||
txt.print_uw(num)
|
||||
txt.spc()
|
||||
|
Loading…
Reference in New Issue
Block a user