Example #1
0
File: ast.go Project: vnev/ark
func (v *NumericLiteral) String() string {
	if v.IsFloat {
		return fmt.Sprintf("("+util.Blue("NumericLiteral")+": "+util.Yellow("%d")+" "+util.Green(v.GetType().TypeName())+")", v.FloatValue)
	} else {
		return fmt.Sprintf("("+util.Blue("NumericLiteral")+": "+util.Yellow("%d")+" "+util.Green(v.GetType().TypeName())+")", v.IntValue)
	}
}
Example #2
0
File: ast.go Project: vnev/ark
func (v *BoolLiteral) String() string {
	res := "(" + util.Blue("BoolLiteral") + ": "
	if v.Value {
		res += util.Yellow("true")
	} else {
		res += util.Yellow("false")
	}
	return res + ")"
}