Aego Русский

Lexical structure

Deliberately unsupported lexical forms (each has a diagnostic that names the intended form):

Input Why Write instead
'a' no char type separate from string "a"
1. / 1.e3 a float needs digits after the point 1.0 / 1.0e3
имя := 1 identifiers are ASCII ASCII names
a & b no bitwise arithmetic && / ||

Run it:

package demo

import "aego/log"

/* Literals and operators from this page. */
script Lexer {
    func Ready() {
        hex := 0x1f
        big := 1_000_000
        half := .5
        sci := 1e3
        log.Info("ints " + string(hex) + " " + string(big) + ", floats " + string(half) + " " + string(sci))
        log.Info("escapes: tab[\t] quote[\"] backslash[\\] unicode[\u00e9]")
        log.Info("bytes in \"héllo\": " + string(len("héllo")))
        a := 7
        a += 3
        a %= 4
        a++
        log.Info("(7 + 3) % 4 + 1 = " + string(a) + ", both: " + string(a > 2 && !(a == 0)))
    }
}