Added validation for the Custom keyword endings as per the scope

Signed-off-by: Anurag <anurag.pattnaik@andolasoft.com>