Comments in SRON
Comments are lines which are used in code to provide explanations or notes that are ignored by the compiler. It is removed by the compiler at compile time.
Comments are very helpful during the maintenance of big projects. They help humans understand the data structure and context but have no effect on the output of code.
SRON provides two types of comments:
Multi-line comments
Single-line comments
This is a multi-line comment because
it is outside the scope of function.
{
name : MAIN
@ this is a single line comment declared using '@'
}
SRON's compiler starts the compilation from the first occurrence of open curly braces ( { ), so while using multi-line comments keep this point in your mind.
Single line comments are made using '@'.
But if you still want to make a comment starting with '{' , then you have to use '@' like this
This is a comment
@ {
name : Main
println()
}
The above function will not be compiled by compiler because
there is a open curly brace but after '@', whenever compiler
reads '@' that whole line will be ignored by the compiler.
{
name : Main
println("This function is compiled")
}
NOTE: YOU CANNOT MAKE MULTI-LINE COMMENT INSIDE THE FUNCTION.
Last updated