# Monkey

To use this language, use the class "language-monkey".

## Comments

    ' This is a comment

    #Rem            ' This is the start of a comment block
    Some comment    ' We are inside the comment block
    #End

## Strings

    "Hello World"
    "~qHello World~q"
    "~tIndented~n"

## Numbers

    0
    1234
    $3D0DEAD
    $CAFEBABE

    .0
    0.0
    .5
    0.5
    1.0
    1.5
    1.00001
    3.14159265

## Variable types

    Local myVariable:Bool = True
    Local myVariable? = True
    Local myVariable:Int = 1024
    Local myVariable% = 1024
    Local myVariable:Float = 3.141516
    Local myVariable# = 3.141516
    Local myVariable:String = "Hello world"
    Local myVariable$ = "Hello world"

## Full example

    Import mojo

    Class MyApp Extends App

        Method OnCreate()

            SetUpdateRate 60

        End

        Method OnRender()

            Local date:=GetDate()

            Local months:=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]

            Local day:=("0"+date[2])[-2..]
            Local month:=months[date[1]-1]
            Local year:=date[0]
            Local hour:=("0"+date[3])[-2..]
            Local min:=("0"+date[4])[-2..]
            Local sec:=("0"+date[5])[-2..] + "." + ("00"+date[6])[-3..]

            Local now:=hour+":"+min+":"+sec+"  "+day+" "+month+" "+year

            Cls
            DrawText now,DeviceWidth/2,DeviceHeight/2,.5,.5
        End

    End

    Function Main()

        New MyApp

    End

## Known failures

There are certain edge cases where Prism will fail. There are always such cases in every regex-based syntax highlighter. However, Prism dares to be open and honest about them. If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.

## Two double quotes inside a comment

    ' This "comment" is broken
    #Rem
    This "comment" is broken
    #End