• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Script Language Aligner (Jass, vJass, Zinc)

@ first: This resource IS mine! I coded it and everything inside is made by me, The_Witcher!

Script Language Aligner

Have you ever hade a code with a bad indenting??
Moderators always complain about your lack of white space??
it's very difficult to look through a code that looks bad and it's very difficult to review one too!

Simply press the customizable hotkey and all code in the active window gets indented perfectly!
Of course you can always retrieve the original unindented code!

example:
JASS:
library DoorSystem initializer Init
    // Door system by The_Witcher
    //
// this system opens every instance of the registered doortypes when a units comes close
// if the unit moves away from the door it will close again

    globals
        //if this is true doors will only close on leave if there are no units in their range
        public boolean CLOSE_ONLY_WHEN_EMPTY = true
         // These are the standart animations for the doors in your map
        private constant string STANDART_OPEN_ANIMATION = "Death Alternate"
                private constant string STANDART_STAND_OPEN_ANIMATION = "Stand Alternate"
        private constant string STANDART_CLOSE_ANIMATION = "Birth"
            private constant string STANDART_STAND_CLOSE_ANIMATION = "stand"
    endglobals

    //Doors will only be triggered when the entering unit matches these conditions
            private function DoorEventConditions takes nothing returns boolean
        return not (IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD) or GetUnitTypeId(GetFilterUnit()) == 0 )
            endfunction

    //-----------Don't modify anything below this line---------

            globals
                private integer array doors
        private real array range
               private integer total
        private hashtable h
                private boolexpr filt
                    private boolexpr enter
        private integer i
        private group g
        private timer tim
    endglobals

            private function FilterFunc takes nothing returns boolean
        return GetDestructableTypeId(GetFilterDestructable()) == doors[i] and LoadBoolean(h,GetHandleId(GetFilterDestructable()),1) != true and LoadBoolean(h,GetHandleId(GetFilterDestructable()),2) != true
    endfunction
        
    private function DoorActions takes nothing returns nothing
                    local destructable d = LoadDestructableHandle(h,GetHandleId(GetTriggeringTrigger()),0)  
        if GetTriggerEventId()==EVENT_GAME_ENTER_REGION and not LoadBoolean(h,GetHandleId(d),0) then
    call KillDestructable(d)
call SaveBoolean(h,GetHandleId(d),0,true)
            call SetDestructableAnimation(d,LoadStr(h,GetDestructableTypeId(d),4))
    call QueueDestructableAnimation(d,LoadStr(h,GetDestructableTypeId(d),5))
        elseif GetTriggerEventId()==EVENT_GAME_LEAVE_REGION and LoadBoolean(h,GetHandleId(d),0) then
            if not CLOSE_ONLY_WHEN_EMPTY then
                call DestructableRestoreLife(d,GetDestructableMaxLife(d),true)
                call SaveBoolean(h,GetHandleId(d),0,false)
      call SetDestructableAnimation(d, LoadStr(h,GetDestructableTypeId(d),6))
                call QueueDestructableAnimation(d, LoadStr(h,GetDestructableTypeId(d),7))
            else
          call GroupClear(g)
                call GroupEnumUnitsInRect(g, LoadRectHandle(h,GetHandleId(d),3), enter)
                if FirstOfGroup(g) == null then
        call DestructableRestoreLife(d,GetDestructableMaxLife(d),true)
                    call SaveBoolean(h,GetHandleId(d),0,false)
               call SetDestructableAnimation(d, LoadStr(h,GetDestructableTypeId(d),6))
             call QueueDestructableAnimation(d, LoadStr(h,GetDestructableTypeId(d),7))
                endif
            endif
endif
set d = null
    endfunction

private function RegisterEvents takes nothing returns nothing
local destructable d = GetEnumDestructable()
local trigger t = CreateTrigger()
local region g = CreateRegion()
local real x = GetDestructableX(d)
local real y = GetDestructableY(d)
local rect r = Rect(x-range[i], y-range[i], x+range[i], y+range[i])
call RegionAddRect(g,r)
call SaveBoolean(h,GetHandleId(d),0,false)
call SaveDestructableHandle(h,GetHandleId(t),0,d)
call SaveRectHandle(h,GetHandleId(d),3,r)
call SaveBoolean(h,GetHandleId(d),1,true)
call SaveStr(h,GetDestructableTypeId(d),4,STANDART_OPEN_ANIMATION)
call SaveStr(h,GetDestructableTypeId(d),5,STANDART_STAND_OPEN_ANIMATION)
call SaveStr(h,GetDestructableTypeId(d),6,STANDART_CLOSE_ANIMATION)
call SaveStr(h,GetDestructableTypeId(d),7,STANDART_STAND_CLOSE_ANIMATION)
call TriggerRegisterEnterRegion(t,g,enter)
call TriggerRegisterLeaveRegion(t,g,enter)
call TriggerAddAction(t,function DoorActions)
set t = null
set d = null
set r = null
set g = null
endfunction

            private function RescanAll takes nothing returns nothing
        set i = 0
        loop
    exitwhen i >= total
       call EnumDestructablesInRect(bj_mapInitialPlayableArea, filt, function RegisterEvents)
     set i = i + 1
        endloop
    endfunction

function OpenDoor takes destructable d, boolean flag returns nothing
call SaveBoolean(h,GetHandleId(h),0,flag)
endfunction

function ExcludeDoor takes destructable d, boolean flag returns nothing
call SaveBoolean(h,GetHandleId(h),2,flag)
endfunction
    
        function ChangeDoorTypeAnimations takes integer id, string openAnimation, string standOpenAnimation, string closeAnimation, string standCloseAnimation returns nothing
      call SaveStr(h,id,4,openAnimation)
        call SaveStr(h,id,5,standOpenAnimation)
    call SaveStr(h,id,6,closeAnimation)
        call SaveStr(h,id,7,standCloseAnimation)
    endfunction

        function AddDoorType takes integer id, real enterRange returns nothing
            set doors[total] = id
        set range[total] = enterRange
                    call SaveStr(h,id,4,STANDART_OPEN_ANIMATION)
        call SaveStr(h,id,5,STANDART_STAND_OPEN_ANIMATION)
            call SaveStr(h,id,6,STANDART_CLOSE_ANIMATION)
                call SaveStr(h,id,7,STANDART_STAND_CLOSE_ANIMATION)
            set total = total + 1
        call RescanAll()
        endfunction

  private function Init takes nothing returns nothing
                set h = InitHashtable()
        set total = 0
                set filt = Condition(function FilterFunc)
            set enter = Condition(function DoorEventConditions)
        set g = CreateGroup()
        set tim = CreateTimer()
        endfunction
        
            private function CatchNewDoors takes integer objectid, real x, real y, real face, real scale, integer variation returns nothing
                call TimerStart(tim,0.01,false,function RescanAll)
            endfunction
    
            private function CatchNewDoors2 takes integer objectid, real x, real y, real z, real face, real scale, integer variation returns nothing
                call TimerStart(tim,0.01,false,function RescanAll)
        endfunction
    
hook CreateDestructable CatchNewDoors
  hook CreateDestructableZ CatchNewDoors2

    endlibrary

Now i use my tool and this is what comes out (all options enabled):

JASS:
library DoorSystem initializer Init
    // Door system by The_Witcher
    //
// this system opens every instance of the registered doortypes when a units comes close
// if the unit moves away from the door it will close again

    globals
        //if this is true doors will only close on leave if there are no units in their range
        public boolean CLOSE_ONLY_WHEN_EMPTY = true
         // These are the standart animations for the doors in your map
        private constant string STANDART_OPEN_ANIMATION = "Death Alternate"
        private constant string STANDART_STAND_OPEN_ANIMATION = "Stand Alternate"
        private constant string STANDART_CLOSE_ANIMATION = "Birth"
        private constant string STANDART_STAND_CLOSE_ANIMATION = "stand"
    endglobals

    //Doors will only be triggered when the entering unit matches these conditions
    private function DoorEventConditions takes nothing returns boolean
        return not (IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) or GetUnitTypeId(GetFilterUnit()) == 0 )
    endfunction

    //-----------Don't modify anything below this line---------

    globals
        private integer array doors
        private real array range
        private integer total
        private hashtable h
        private boolexpr filt
        private boolexpr enter
        private integer i
        private group g
        private timer tim
    endglobals

    private function FilterFunc takes nothing returns boolean
        return GetDestructableTypeId(GetFilterDestructable()) == doors[i] and LoadBoolean(h, GetHandleId(GetFilterDestructable()), 1) != true and LoadBoolean(h, GetHandleId(GetFilterDestructable()), 2) != true
    endfunction
        
    private function DoorActions takes nothing returns nothing
        local destructable d = LoadDestructableHandle(h, GetHandleId(GetTriggeringTrigger()), 0)
        if GetTriggerEventId() == EVENT_GAME_ENTER_REGION and not LoadBoolean(h, GetHandleId(d), 0) then
            call KillDestructable(d)
            call SaveBoolean(h, GetHandleId(d), 0, true)
            call SetDestructableAnimation(d, LoadStr(h, GetDestructableTypeId(d), 4))
            call QueueDestructableAnimation(d, LoadStr(h, GetDestructableTypeId(d), 5))
        elseif GetTriggerEventId() == EVENT_GAME_LEAVE_REGION and LoadBoolean(h, GetHandleId(d), 0) then
            if not CLOSE_ONLY_WHEN_EMPTY then
                call DestructableRestoreLife(d, GetDestructableMaxLife(d), true)
                call SaveBoolean(h, GetHandleId(d), 0, false)
                call SetDestructableAnimation(d, LoadStr(h, GetDestructableTypeId(d), 6))
                call QueueDestructableAnimation(d, LoadStr(h, GetDestructableTypeId(d), 7))
            else
                call GroupClear(g)
                call GroupEnumUnitsInRect(g, LoadRectHandle(h, GetHandleId(d), 3), enter)
                if FirstOfGroup(g) == null then
                    call DestructableRestoreLife(d, GetDestructableMaxLife(d), true)
                    call SaveBoolean(h, GetHandleId(d), 0, false)
                    call SetDestructableAnimation(d, LoadStr(h, GetDestructableTypeId(d), 6))
                    call QueueDestructableAnimation(d, LoadStr(h, GetDestructableTypeId(d), 7))
                endif
            endif
        endif
        set d = null
    endfunction

    private function RegisterEvents takes nothing returns nothing
        local destructable d = GetEnumDestructable()
        local trigger t = CreateTrigger()
        local region g = CreateRegion()
        local real x = GetDestructableX(d)
        local real y = GetDestructableY(d)
        local rect r = Rect(x - range[i], y - range[i], x + range[i], y + range[i])
        call RegionAddRect(g, r)
        call SaveBoolean(h, GetHandleId(d), 0, false)
        call SaveDestructableHandle(h, GetHandleId(t), 0, d)
        call SaveRectHandle(h, GetHandleId(d), 3, r)
        call SaveBoolean(h, GetHandleId(d), 1, true)
        call SaveStr(h, GetDestructableTypeId(d), 4, STANDART_OPEN_ANIMATION)
        call SaveStr(h, GetDestructableTypeId(d), 5, STANDART_STAND_OPEN_ANIMATION)
        call SaveStr(h, GetDestructableTypeId(d), 6, STANDART_CLOSE_ANIMATION)
        call SaveStr(h, GetDestructableTypeId(d), 7, STANDART_STAND_CLOSE_ANIMATION)
        call TriggerRegisterEnterRegion(t, g, enter)
        call TriggerRegisterLeaveRegion(t, g, enter)
        call TriggerAddAction(t, function DoorActions)
        set t = null
        set d = null
        set r = null
        set g = null
    endfunction

    private function RescanAll takes nothing returns nothing
        set i = 0
        loop
            exitwhen i >= total
            call EnumDestructablesInRect(bj_mapInitialPlayableArea, filt, function RegisterEvents)
            set i = i + 1
        endloop
    endfunction

    function OpenDoor takes destructable d, boolean flag returns nothing
        call SaveBoolean(h, GetHandleId(h), 0, flag)
    endfunction

    function ExcludeDoor takes destructable d, boolean flag returns nothing
        call SaveBoolean(h, GetHandleId(h), 2, flag)
    endfunction
    
    function ChangeDoorTypeAnimations takes integer id, string openAnimation, string standOpenAnimation, string closeAnimation, string standCloseAnimation returns nothing
        call SaveStr(h, id, 4, openAnimation)
        call SaveStr(h, id, 5, standOpenAnimation)
        call SaveStr(h, id, 6, closeAnimation)
        call SaveStr(h, id, 7, standCloseAnimation)
    endfunction

    function AddDoorType takes integer id, real enterRange returns nothing
        set doors[total] = id
        set range[total] = enterRange
        call SaveStr(h, id, 4, STANDART_OPEN_ANIMATION)
        call SaveStr(h, id, 5, STANDART_STAND_OPEN_ANIMATION)
        call SaveStr(h, id, 6, STANDART_CLOSE_ANIMATION)
        call SaveStr(h, id, 7, STANDART_STAND_CLOSE_ANIMATION)
        set total = total + 1
        call RescanAll()
    endfunction

    private function Init takes nothing returns nothing
        set h = InitHashtable()
        set total = 0
        set filt = Condition(function FilterFunc)
        set enter = Condition(function DoorEventConditions)
        set g = CreateGroup()
        set tim = CreateTimer()
    endfunction
        
    private function CatchNewDoors takes integer objectid, real x, real y, real face, real scale, integer variation returns nothing
        call TimerStart(tim, 0.01, false, function RescanAll)
    endfunction
    
    private function CatchNewDoors2 takes integer objectid, real x, real y, real z, real face, real scale, integer variation returns nothing
        call TimerStart(tim, 0.01, false, function RescanAll)
    endfunction
    
    hook CreateDestructable CatchNewDoors
    hook CreateDestructableZ CatchNewDoors2

endlibrary


//Code indented using The_Witcher's Script language Aligner
//Download the newest version and report bugs at www.hiveworkshop.com

NOTE: works for the languages Jass, vJass and Zinc.

v.1.1: added support for static ifs, changed UI
v.1.2: major code changes, removed pascal support (since it has its own aligner), support for constant functions and crap code without spaces like ' if(s==2)then'
v.1.3: added support for modules
v.2.0: rewrote the whole code: no more bugs regardin static, private, constant etc. prefixes, option to recover old code (in case the program fails), option to format spaces
v.2.1: added support for strings like "-n" which became " - n" before, added support for /* and */, fixed a bug regarding the "private" and "static" combination, changed default options
v.3.0: rewrote a lot of the code! added zinc support and fixed "operator x=" bug
v.3.1: fixed a small bug, fixed interface bug, fixed "i = - 1" bug so it becomes "i = -1" now
v.3.2: added hotkey ctrl + [yourHotkey] to automatically indent


Keywords:
script, code, language, vJass, jass, zinc, delphi, help, structure, align, warcraft, indent
Contents

Script Language Aligner (Jass, vJass, Zinc) (Binary)

Reviews
18:51 October 1, 2012: Magtheridon96: Approved. 4/5 for being a life-saver when I find someone with terrible code indentation.

Moderator

M

Moderator

18:51 October 1, 2012:
Magtheridon96:

Approved.
4/5 for being a life-saver when I find someone with terrible code indentation.
 
Level 11
Joined
Feb 14, 2009
Messages
884
A handy tool. Could really help those too lazy to indent their their code, as Adictuz said :)
 
Level 14
Joined
Jul 28, 2009
Messages
1,085
▄██████████████▄▐█▄▄▄▄█▌
██████▌▄▌▄▐▐▌███▌▀▀██▀▀
████▄█▌▄▌▄▐▐▌▀███▄▄█▌
▄▄▄▄▄██████████████▀

Noooo, jkjk.
Could be Very useful for alot of people.
Nice one!
 
Level 11
Joined
Sep 30, 2009
Messages
697
I tested this out and it can become really useful especially if you want to add another if and would need to align 50 lines :p I found 1 single bug until now: If you have a function interface it indents everything below it what does kind of suck :(
 
Level 14
Joined
Nov 23, 2008
Messages
512
Would it work if the code you want to align looked like this:

JASS:
function bla takes nothing returns booleanif x=y thenreturn trueendifendfunction

This is the kind of code you would find in the war3map.j of any map (protected or not i think ;p)

no i also tryed to do some kind of that but it's not that easy (and also not fast) because you have (i think) to make a loop of num of chars ^ 2 or even more

Edit: btw: HAAAAAX :D
 
Level 13
Joined
May 11, 2008
Messages
1,198
Nope... static if are useful for reducing the amount of codes... resulting to lower file size...

you can replace with comment and make user manually change what is being used, as that is all static if is used for, to determine what is used and what isn't. the difference between using them and using comments is the static if is automatic and the comments are manual.

i agree if static if is part of vjass, it should be respected. i'm merely pointing out a way around them if you had no other choice, which is the case if you use cjass at the moment.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
you can replace with comment and make user manually change what is being used, as that is all static if is used for, to determine what is used and what isn't. the difference between using them and using comments is the static if is automatic and the comments are manual.

i agree if static if is part of vjass, it should be respected. i'm merely pointing out a way around them if you had no other choice, which is the case if you use cjass at the moment.

It's way harder to go through whole code, especially if it's long, and put /* wherever you want code not to compile than using static ifs and constant booleans at configurable section of code. Also if other people use your resources, they might not know which part of code does what they don't want to compile.
Though if you don't think they're useful, just don't use them. I think they are useful, though.
 
Level 2
Joined
Feb 8, 2011
Messages
31
Bug (btw, LOVE this tool):

Starting Script
JASS:
library IntegerProtection
globals
constant string SJWKCI = ""
constant string PWLSIF = ""
constant string MEKDJF = ""
constant string EKDIJN = ""
constant string DUXINS = ""
constant string FKAHSU = ""
constant string DIWKCO = ""
constant string ZSKNDM = ""
constant string AJSHKD = ""
constant string TFJLSD = ""
endglobals
constant function SS0 takes nothing returns string
return 0
endfunction
constant function SS1 takes nothing returns string
return 1
endfunction
constant function SS2 takes nothing returns string
return 2
endfunction
constant function SS3 takes nothing returns string
return 3
endfunction
constant function SS4 takes nothing returns string
return 4
endfunction
constant function SS5 takes nothing returns string
return 5
endfunction
constant function SS6 takes nothing returns string
return 6
endfunction
constant function SS7 takes nothing returns string
return 7
endfunction
constant function SS8 takes nothing returns string
return 8
endfunction
constant function SS9 takes nothing returns string
return 9
endfunction
endlibrary

Result
JASS:
library IntegerProtection
    globals
        constant string SJWKCI = ""
        constant string PWLSIF = ""
        constant string MEKDJF = ""
        constant string EKDIJN = ""
        constant string DUXINS = ""
        constant string FKAHSU = ""
        constant string DIWKCO = ""
        constant string ZSKNDM = ""
        constant string AJSHKD = ""
        constant string TFJLSD = ""
    endglobals
    constant function SS0 takes nothing returns string
    return 0
endfunction
constant function SS1 takes nothing returns string
return 1
endfunction
constant function SS2 takes nothing returns string
return 2
endfunction
constant function SS3 takes nothing returns string
return 3
endfunction
constant function SS4 takes nothing returns string
return 4
endfunction
constant function SS5 takes nothing returns string
return 5
endfunction
constant function SS6 takes nothing returns string
return 6
endfunction
constant function SS7 takes nothing returns string
return 7
endfunction
constant function SS8 takes nothing returns string
return 8
endfunction
constant function SS9 takes nothing returns string
return 9
endfunction
endlibrary
 
Level 8
Joined
Jun 28, 2008
Messages
356
Code:
if(I2())then
set hx[9]=true
endif
set bj_forLoopBIndex=0
set bj_forLoopBIndexEnd=9
loop
    exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
    if(A2())then
    set hx[4]=true
    set sx[(1+GetPlayerId(GetTriggerPlayer()))]=bj_forLoopBIndex
endif
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
if(N2())then
set hx[11]=true
endif
set bj_forLoopBIndex=0
set bj_forLoopBIndexEnd=9
loop
    exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
    if(b2())then
    set hx[5]=true
    set Dx[(1+GetPlayerId(GetTriggerPlayer()))]=(bj_forLoopBIndex*1000)
endif

Fail.
 
Bug (btw, LOVE this tool):

Starting Script
JASS:
library IntegerProtection
globals
constant string SJWKCI = ""
constant string PWLSIF = ""
constant string MEKDJF = ""
constant string EKDIJN = ""
constant string DUXINS = ""
constant string FKAHSU = ""
constant string DIWKCO = ""
constant string ZSKNDM = ""
constant string AJSHKD = ""
constant string TFJLSD = ""
endglobals
constant function SS0 takes nothing returns string
return 0
endfunction
constant function SS1 takes nothing returns string
return 1
endfunction
constant function SS2 takes nothing returns string
return 2
endfunction
constant function SS3 takes nothing returns string
return 3
endfunction
constant function SS4 takes nothing returns string
return 4
endfunction
constant function SS5 takes nothing returns string
return 5
endfunction
constant function SS6 takes nothing returns string
return 6
endfunction
constant function SS7 takes nothing returns string
return 7
endfunction
constant function SS8 takes nothing returns string
return 8
endfunction
constant function SS9 takes nothing returns string
return 9
endfunction
endlibrary
Result
JASS:
library IntegerProtection
    globals
        constant string SJWKCI = ""
        constant string PWLSIF = ""
        constant string MEKDJF = ""
        constant string EKDIJN = ""
        constant string DUXINS = ""
        constant string FKAHSU = ""
        constant string DIWKCO = ""
        constant string ZSKNDM = ""
        constant string AJSHKD = ""
        constant string TFJLSD = ""
    endglobals
    constant function SS0 takes nothing returns string
    return 0
endfunction
constant function SS1 takes nothing returns string
return 1
endfunction
constant function SS2 takes nothing returns string
return 2
endfunction
constant function SS3 takes nothing returns string
return 3
endfunction
constant function SS4 takes nothing returns string
return 4
endfunction
constant function SS5 takes nothing returns string
return 5
endfunction
constant function SS6 takes nothing returns string
return 6
endfunction
constant function SS7 takes nothing returns string
return 7
endfunction
constant function SS8 takes nothing returns string
return 8
endfunction
constant function SS9 takes nothing returns string
return 9
endfunction
endlibrary

JASS:
if(I2())then
set hx[9]=true
endif
set bj_forLoopBIndex=0
set bj_forLoopBIndexEnd=9
loop
    exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
    if(A2())then
    set hx[4]=true
    set sx[(1+GetPlayerId(GetTriggerPlayer()))]=bj_forLoopBIndex
endif
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
if(N2())then
set hx[11]=true
endif
set bj_forLoopBIndex=0
set bj_forLoopBIndexEnd=9
loop
    exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
    if(b2())then
    set hx[5]=true
    set Dx[(1+GetPlayerId(GetTriggerPlayer()))]=(bj_forLoopBIndex*1000)
endif
Fail.

fixed that guys!

v.1.2: major code changes, removed pascal support (since it has its own aligner), support for constant functions and crap code without spaces like ' if(s==2)then'
 
Level 8
Joined
Jun 28, 2008
Messages
356
Works like a charm now. You could also make it add newlines between function and endfunction and add spaces around operators (+, -, =, etc). Newline between endif and if, endloop and loop and so on. Y'know your stuff. It's pretty useful, tho.
 
Works like a charm now. You could also make it add newlines between function and endfunction and add spaces around operators (+, -, =, etc). Newline between endif and if, endloop and loop and so on. Y'know your stuff. It's pretty useful, tho.

Those stuff should be optional if they're going to be added.

v.2.0: added your proposals and made optional ;) @ garfield: fixed the issues with prefixes like constant, static etc...
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
As far as i know, all declaration within interface are one line so you could indent all interface members, but not make an indent after method members within interface.
JASS:
interface int
    integer x //those should be indented like this
    integer y 

    method blabla takes nothing returns real //this should be indented too, however, the text after it shouldn't be like for methods within structs

    method otherMethod takes nothing returns string //This is indented because it is within interface, not because it is after 'method' keyword

endinterface
So just indent interface members and ignore all keywords within it.
 
Top