\usepackage{xcolor}
\usepackage{listings}
\usepackage{tcolorbox}
\tcbuselibrary{listings}

\definecolor{basicColor}{HTML}{5C6166}

\definecolor{backgroundColor}{HTML}{FCFCFC}
\definecolor{keywordColor}{HTML}{FA8D3E}
\definecolor{stringColor}{HTML}{86B300}
\definecolor{typeColor}{HTML}{399EE6}
\definecolor{numberColor}{HTML}{A37ACC}

\lstdefinelanguage{Fasto}{
    alsoletter=0123456789,
    keywords={[0]fun,let,in,if,else,then},
    keywords={[1]int,char,bool},
    keywords={[2]@invariant,0,1,2,3,4,5,6,7,8,9},
    sensitive=true,
    comment=[l]{//},
    comment=[s]{/*}{*/},
    string=[b]",
}

\lstdefinelanguage{FSharp}{
    alsoletter=0123456789->|,
    keywords={[0]let,rec,|,->,match,for,in,with},
    keywords={[1]int,char,bool,INT,EXP,SymTab,CONSTANT,VARIABLE,OPERATE,LET_IN, OVER,BPLUS,BMINUS,BTIMES,RSUM,RPROD,RMAX,RARGMAX},
    keywords={[2]@invariant,0,1,2,3,4,5,6,7,8,9},
    sensitive=true,
    comment=[l]{//},
    comment=[s]{/*}{*/},
    string=[b]",
}

\lstset{
    basicstyle=\color{basicColor}\small\ttfamily,
    keywordstyle=[0]\color{keywordColor},
    keywordstyle=[1]\color{typeColor},
    keywordstyle=[2]\color{numberColor},
    stringstyle=\color{stringColor},
    backgroundcolor=\color{backgroundColor},
    frame=single, framerule=1pt,
    numbers=left,
    stepnumber=1,
    showstringspaces=false,
    tabsize=1,
    breaklines=true,
    breakatwhitespace=true
}
