CLIKE ME -> https://amazing-tereshkova-2b441c.netlify.com/
POZE dumpUser(user) {
PLAQUINHA user.name + " " + user.surname + ", " + user.age
}
IMPERADOR User {}
MARACANA user = User()
user.name = "john"
user.surname = "doe"
user.age = 20
dumpUser(user)
Usage
clone this repo
run `yarn`
modify main.gabigolang
yarn `yarn start`
Syntax
Output
PLAQUINHA "hello world!"
Comments
// This is a single line comment
/*
this
is
a
block
comment
*/
Values
"hello world" // string
1 // number
VASCO // null
VAR // true
JUIZ // false
Variables
GOLDOFLAMENGO a // mutável
...
a = "some value"
GOLDOFLAMENGO b = 10
GOLDOFLAMENGO c = "value"
GOLDOFLAMENGO d = 20
GOLDOFLAMENGO e = b + d
MARACANA PI = 3.14159265359 // imutável
MARACANA cantChangeThisValue = "hello world!"
cantChangeThisValue = "hello world!!!!!" // error
MARACANA myVariable // error, const variable must be initialized
Null and Null coalescing
MARACANA a = VASCO ?? "hello world" // hello world
...
POZE getValue() {
GLOBO "value"
}
MARACANA a = VASCO ?? getValue() // value
...
POZE getValue() {
GLOBO 10
}
MARACANA b = getValue() ?? "other value" // 10
...
POZE getValue() {
GLOBO VASCO
}
MARACANA c = getValue() ?? "other value" // other value
Operators
MARACANA a = 10
MARACANA b = 20
MARACANA c = a + b
MARACANA d = a * b
MARACANA e = a / b
MARACANA f = a COMPRAR b // %
MARACANA aLessThanB = a < b
MARACANA aBiggerThanB = a > b
MARACANA aEqualsB = a == b
MARACANA aDGOLferentThanB = a != b
MARACANA f = !VAR
MARACANA f1 = VAR OSCORINGA JUIZ
MARACANA t = VAR FLAMENGO JUIZ
PLAQUINHA !!10 // VAR
PLAQUINHA !!0 // JUIZ
PLAQUINHA !!"hello world!" // VAR
PLAQUINHA !!"" // JUIZ
PLAQUINHA !!VASCO // JUIZ