yodevs / yo_ex Goto Github PK
View Code? Open in Web Editor NEWTastes always change, try new one like YOLang ; Simple, fast, safe.
License: GNU General Public License v3.0
Tastes always change, try new one like YOLang ; Simple, fast, safe.
License: GNU General Public License v3.0
code ::
let mcar , ncar : str
mcar := 'Ford'
ncar := 'Bmw'
io::println("mcar = '#{mcar}' , ncar = '#{ncar}'")
error ::
-Intermediate Code Generation
Gen ->\src\main.yo - 2 func(s) , 0 field(s) :: [FAILED]
================================================================================
RUNTIME ERROR : An unknown error occurred while running.
Source : Error Code : [Err-RUNTIMEERROR-3]
*** More Detials ***
StartIndex cannot be less than zero.
Parameter name: startIndex
***********************SNIPPT************************
Example :
Not specified
================================================================================
Problem not running ILASM software on 32-bit Windows .
Error ::
-Assembly Code Generation
Asm ->Preparation of prerequisites and parameters :: [DONE]
Asm ->Assembly process & Linker :: [FAILED]
================================================================================
RUNTIME ERROR : An unknown error occurred while running.
Source : Error Code : [Err-RUNTIMEERROR-3]
* More Detials *
The specified executable is not a valid application for this OS platform.
********SNIPPT*********
Example :
Not specified
================================================================================```
code : ```
#[app::classname("MyApp")]
#[cfg::CIL(true)]
const public static pi : f32 = 3.14
func main()
{
System.Console::Write("Pi is #{pi}")
}
Error text : ```
C:\Users\...\YOTEST>yoca build
-Initialization & Process Preparation
Init ->Preparation & analysis of 'Labra.yoda' :: [PASSED]
Init ->Check the path of project files :: [PASSED]
Init ->Check the dependencies of the '\assets' path :: [PASSED]
-Lexical Analyzer
Lex ->\src\main.yo :: [PASSED]
-Intermediate Code Generation
Gen ->\src\main.yo - 1 func(s) , 1 field(s) :: [FAILED]
================================================================================
EXPLICIT CONVERSION ERROR : Cannot implicitly convert type 'f32' to 'f32'.
Source : C:\Users\amin\Desktop\YOProject\YOSTD\src\main.yo - Line [7]
Error Code : [Err-EXPLICITCONVERSION-15]
*** More Detials ***
Method : main - identifier [ Field ] : pi
***********************SNIPPT************************
Example :
Not specified
================================================================================
code func test1(a : i32 , b : i32) { while(a <> b && b >> a) { System.Console::WriteLine(a) a += 1 } }
error
================================================================================
METHOD ERROR : Method WriteLine(...) not found.
Source : C:\...\condition_action\src\main.yo - Line [12
]
Error Code : [Err-METHODERROR-37]
*** More Detials ***
System.Console::WriteLine(a)
^^^^^^^^^^^^^^^^^^^^^^^^^
***********************SNIPPT************************
Example :
Not specified
================================================================================
Error in yoda format :
code :
!![
"build" = "Compile a project and build an output (.dll, .exe, etc.).
Usage : yoca build <options>
*** Options ***
--debug :: Disable JIT optimization, create PDB file, use sequence points from PDB.
--debug_impl :: Disable JIT optimization, create PDB file, use implicit sequence points.
--debug_opt :: Enable JIT optimization, create PDB file, use implicit sequence points.
--import_assets :: Copy dependencies and assets from the assets folder to the output.
--display_token :: Display and print tokens while analyzing source code (lexical analysis).
*** Hints ***
The Build command must be called next to labra.yoda file by the Command Prompt.
"
,
"run" = "Compile a project and execute it.
Usage : yoca run <options>
*** Options ***
--debug :: Disable JIT optimization, create PDB file, use sequence points from PDB.
--debug_impl :: Disable JIT optimization, create PDB file, use implicit sequence points.
--debug_opt :: Enable JIT optimization, create PDB file, use implicit sequence points.
--import_assets :: Copy dependencies and assets from the assets folder to the output.
--display_token :: Display and print tokens while analyzing source code (lexical analysis).
*** Hints ***
The Run command must be called next to labra.yoda file by the Command Prompt.
"
]
================================================================================
RUNTIME ERROR : An unknown error occurred while running.
Source : Error Code : [Err-RUNTIMEERROR-3]
*** More Detials ***
- Unauthorized character found outside of string.
***********************SNIPPT************************
Example :
Not specified
================================================================================
code ::
func main()
{
let name : str = System.Console::ReadLine()
System.Console::Write("Hello #{name}")
}
error code ::
-Intermediate Code Generation
Gen ->\src\main.yo - 1 func(s) , 0 field(s) :: [FAILED]
================================================================================
RUNTIME ERROR : An unknown error occurred while running.
Source : Error Code : [Err-RUNTIMEERROR-3]
*** More Detials ***
Object reference not set to an instance of an object.
***********************SNIPPT************************
Example :
Not specified
================================================================================
Simple command :
yoca build --Import_assets
Code :
func main()
{
<
ldstr "Hello World !"
call void [mscorlib]System.Console::WriteLine(string)
>
}
error log :
Lex ->\src\main.yo :: [REFUSED]
================================================================================
IDENTIFIER UNKNOWN : Identifier validation is ambiguous.
An identifier can contain numbers, letters, and '_'.
An identifier cannot start with a number.
Source : E:\YO\YOCA\YOCA\bin\Release\tests\nsexample\src\main.yo - Line [9]
*** More Detials ***
call void [mscorlib]System.Console::WriteLine(string)
^^^^^^^^^^
***********************SNIPPT************************
Example :
name / mycity2 / get_name
================================================================================
Problem displaying variables from other classes in constant string literal.
System.Console::Write(" my name is #{minfo.inf::name}")
Change the default class name in YO using attributes.
The compiler identifies any class that has a Main function as the entry point for the software.
When a variable is created outside the loop, it cannot be used inside the loop.
code :
#[app::classname("matheq")]
#[app::namespace("myexpr")]
let public static name : str = "Ruzes Larrey"
error text :
-Initialization & Process Preparation
Init ->Preparation & analysis of 'Labra.yoda' :: [PASSED]
Init ->Check the path of project files :: [PASSED]
Init ->Check the dependencies of the '\assets' path :: [PASSED]
-Lexical Analyzer
Lex ->\src\lib.yo :: [PASSED]
Lex ->\src\main.yo :: [PASSED]
-Intermediate Code Generation
Gen ->\src\lib.yo - 1 func(s) , 1 field(s) :: [DONE]
Gen ->\src\main.yo - 1 func(s) , 0 field(s) :: [DONE]
-Assembly Code Generation
Asm ->Preparation of prerequisites and parameters :: [DONE]
Asm ->Assembly process & Linker :: [FAILED]
-The overall result
***** FAILURE *****
Error: Reference to undefined class 'matheq'
Could not create output file, error code=0x80004005
Searching the database to provide error explanation ...
Win32Exception [description]: native code (0x80004005) = Unspecified error.```
Code ::
to(5)
{
<
ldstr "*"
call void [mscorlib]System.Console::Write(string)
>
}
Error ::
================================================================================
IDENTIFIER UNKNOWN : 'YO_Flag_1' is not declared. It may be inaccessible due to
its protection level.
Source : C:\Users\amin\Desktop\YOProject\simple_pointer\src\main.yo - Line [9]
Error Code : [Err-TYPENOTFOUND-13]
*** More Detials ***
Method : main - Unknown identifier : YO_Flag_1
to(5)
^
***********************SNIPPT************************
Example :
Not specified
================================================================================
code ::
let public ps : str = "Hello! How are you ?"
func main()
{
io::println(ps)
}
error ::
Lex ->E:\YO\YOCA\YOCA\bin\Release\std\ystdio.yo :: [PASSED]
-Intermediate Code Generation
Gen ->\src\main.yo - 2 func(s) , 1 field(s) :: [FAILED]
================================================================================
METHOD ERROR : Method println(...) , The parameters of the called function do no
t match its original function.
Source : C:\...\src\main.yo - Line [9]
Error Code : [Err-METHODERROR-37]
*** More Detials ***
io::println(ps)
^^
***********************SNIPPT************************
Example :
Not specified
================================================================================
code ::
func main()
{
let _getkelvin : f32 = celsius_to_kelvin(25)
System.Console::WriteLine(_getkelvin)
System.Console::WriteLine("25 C = #{_getkelvin} K")
}
expr celsius_to_kelvin(c : f32) : f32 = [c + 273.15]
run time error ::
Unhandled Exception: System.InvalidProgramException: Common Language Runtime det
ected an invalid program.
at MyApp.main()
The two variables ui_32_1 and ui_32_2 were not introduced(initial) in the source code, however the compiler did not make any errors.
func main()
{
let i : i32 = 0
ui_32_1 := [ui_32_2 + 50 + i]
<
ldloc.0
call void [mscorlib]System.Console::WriteLine(uint32)
>
}
code ::
include 'ystdio'
func main()
{
let sb : System.Text.StringBuilder = get_string_format()
let result : str = sb::tostring()
io::print(result)
}
func get_string_format() : System.Text.StringBuilder
{
let sb : init System.Text.StringBuilder()
sb::append('Hello')
sb::appendline()
sb::append("Bye !")
return sb
}
error ::
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at MyApp.main()
The compiler allows the construction of two functions of the same name and does not give any errors.
error text :
C:\Users\amin\Desktop\YOProject\if_statement>yoca run
================================================================================
RUNTIME ERROR : An unknown error occurred while running.
Source : Error Code : [Err-RUNTIMEERROR-3]
*** More Detials ***
The console buffer size must not be less than the current size and position of t
he console window, nor greater than or equal to Int16.MaxValue.
Parameter name: height
Actual value was 170.
***********************SNIPPT************************
Example :
Not specified
================================================================================
error text :
Unhandled Exception: System.ArgumentOutOfRangeException: The console buffer size
must not be less than the current size and position of the console window, nor
greater than or equal to Int16.MaxValue.
Parameter name: height
Actual value was 70.
Unexpected output in the following code :
func main()
{
test(10.3,32)
}
func test(f : f32 , i : i32)
{
System.Console::WriteLine("#{f} , #{i}")
}
Warning :
1)Formatted String Literal : 'f} , #{i' was identified as a variable in the string but has not been previously defined in this scope.
FILE : C:....\overload_methods\src\main.yo - LINE(41)
Output :
#{f} , #{i}
Code :
#[app::classname("ErrTest")]
#[app::wait(true)]
#[cfg::CIL(true)]
func main()
{
try
{
err "Error : Attempted to divide by zero."
}
catch
{
<
stloc.2
ldloc.2
callvirt instance string [mscorlib]System.Exception::get_Message()
call void [mscorlib]System.Console::Write(string)
>
}
}```
Response :
-Initialization & Process Preparation
Init ->Preparation & analysis of 'Labra.yoda' :: [PASSED]
Init ->Check the path of project files :: [PASSED]
Init ->Check the dependencies of the '\assets' path :: [PASSED]
-Lexical Analyzer
Lex ->\src\main.yo :: [PASSED]
-Intermediate Code Generation
Gen ->\src\main.yo - 1 func :: [FAILED]
code :
func main()
{
exec_logs("start")
System.Console::WriteLine("Stopping service...")
System.Threading.Thread.Sleep(5000)
System.Console::WriteLine("Stopping service...")
}
error :
-Intermediate Code Generation
Gen ->\src\main.yo - 2 func(s) , 0 field(s) :: [FAILED]
================================================================================
METHOD ERROR : Method system.threading.thread.sleep(...) not found.
Source : C:\Users\amin\Desktop\YOProject\match_statement\src\main.yo - Line [9]
Error Code : [Err-METHODERROR-37]
*** More Detials ***
System.Threading.Thread.Sleep(5000)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
***********************SNIPPT************************
Example :
Not specified
================================================================================
Error in :
#[cfg::CIL(true)]
#[cfg::optimize_expression(true)] #> Default is true
func main()
{
let result : i32 = 1
let sd : f32 = 1.66
result := [(25 + 5 + 3 ) * 3 * sd ]
sd := [(25 + 5 + 3 ) * 3 * sd ]
<
ldloc.0
call void [mscorlib]System.Console::WriteLine(int32)
ldloc.1
call void [mscorlib]System.Console::WriteLine(float32)
>
}
Output : Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at YO_Main.main()
There is a bug when a user enters the wrong parameter such as "tokens" instead of "token" and hits ENTER, no error shows up. app runs the command without considering the parameter.
Error when compiling when it is in the name of the space directory.
Error code ::
E:\YO\...\New folder\test3>yoca run
-Initialization & Process Preparation
Init ->Preparation & analysis of 'Labra.yoda' :: [PASSED]
Init ->Check the path of project files :: [PASSED]
Init ->Check the dependencies of the '\assets' path :: [PASSED]
-Lexical Analyzer
Lex ->\src\main.yo :: [PASSED]
-Intermediate Code Generation
Gen ->\src\main.yo - 1 func(s) , 0 field(s) :: [DONE]
-Assembly Code Generation
Asm ->Preparation of prerequisites and parameters :: [DONE]
Asm ->Assembly process & Linker :: [FAILED]
-The overall result
***** FAILURE *****
code ::
func main()
{
let ps : str = "Hello"
test2(ps)
io::println(ps)
}
func test2(val:str&)
{
val := val::trim()
}
Output is Hello
code :
func main()
{
let i : i64 = 5
test(i)
<
ldloc i
call void [mscorlib]System.Console::Write(int64)
>
}
func test(ia : i64&)
{
let p : i64 = 10
ia += p
ia += 3
}
error text :
-Initialization & Process Preparation
Init ->Preparation & analysis of 'Labra.yoda' :: [PASSED]
Init ->Check the path of project files :: [PASSED]
Init ->Check the dependencies of the '\assets' path :: [PASSED]
-Lexical Analyzer
Lex ->\src\main.yo :: [PASSED]
-Intermediate Code Generation
Gen ->\src\main.yo - 2 func :: [FAILED]
================================================================================
IDENTIFIER UNKNOWN : 'ia' is not declared. It may be inaccessible due to its pro
tection level.
Source : C:\Users\amin\Desktop\YOProject\operator_test\src\main.yo - Line [18]
Error Code : [Err-TYPENOTFOUND-13]
*** More Detials ***
Method : test - Unknown identifier : ia
ia += 3
^
***********************SNIPPT************************
Example :
Not specified
================================================================================
code
func main()
{
let a : i32 = 10
let b : i32 = 20
let result : i32 = sum(a,b)
<
call void [mscorlib]System.Console::WriteLine(int32)
>
}
func sum(a : i32 , b : i32& ) : i32
{
let result : i32 = [a + b]
return result
}
error
-Initialization & Process Preparation
Init ->Preparation & analysis of 'Labra.yoda' :: [PASSED]
Init ->Check the path of project files :: [PASSED]
Init ->Check the dependencies of the '\assets' path :: [PASSED]
-Lexical Analyzer
Lex ->\src\main.yo :: [PASSED]
-Intermediate Code Generation
Gen ->\src\main.yo - 2 func :: [FAILED]
================================================================================
IDENTIFIER UNKNOWN : 'a' is not declared. It may be inaccessible due to its prot
ection level.
Source : C:\Users\amin\Desktop\YOProject\performancetest\src\main.yo
Error Code : [Err-TYPENOTFOUND-13]
*** More Detials ***
Method : sum - Unknown identifier : a
***********************SNIPPT************************
Example :
Not specified
================================================================================
code :
for(n in [1..3])
{
System.Console::WriteLine(n)
}
output : 0 1 2
When the compiler is called by a process and needs to receive output, the compiler crashes.
The compiler gets into trouble when several loops are intertwined in the programming.
When no variable is defined :
func main()
{
<
ldstr "Hello World !"
call void [mscorlib]System.Console::WriteLine(string)
>
}
Output :
================================================================================
RUNTIME ERROR : An unknown error occurred while running.
Source : *** More Detials ***
Index was outside the bounds of the array.
at YOCA.ilbodybulider.imp_func(_ilmethodcollection funcdt)
at YOCA.ilbodybulider.conv_to_msil()
at YOCA.ilgencode.codegenerator()
at YOCA.impfiles.import_directory(String dir)
at YOCA.maincr.main(String[] argsval)
***********************SNIPPT************************
Example :
Not specified
================================================================================
The problem is when the Ret command is returned without any parameters.
func get_grade(percentage:i32) : str
{
if(percentage >> 100)
{
return "AA"
}
}
exception :
Unhandled Exception: System.Exception: The value of the entered score is not val
id.
at MyApp.get_grade(Int32 percentage)
at MyApp.main()
code :
let msg : str = "Hello Alex.
How are you ?"
<
ldloc msg
call void [mscorlib]System.Console::Write(string)
>
output :
Hello Alex.\nHow are you ?
Code:
let i : i32 = 20 + 20
i := 30 + 10
io::println("#{i}")
Output :
10
code :
let percentage : i32 = 78
if(percentage > 100)
{
return "AA"
}
output error :
================================================================================
RUNTIME ERROR : An unknown error occurred while running.
Source : Error Code : [Err-RUNTIMEERROR-3]
*** More Detials ***
Index was outside the bounds of the array.
***********************SNIPPT************************
Example :
Not specified
================================================================================
Code
#[app::classname("MyApp")]
#[cfg::CIL(true)]
#[app::wait(true)]
func main()
{
let message : str = NULL
message &= concat("Hello ","World " , "!")
print(message)
}
func concat(val1 : str , val2 : str , val3 : str) : str
{
let result : str = val1
result &= val2
result &= val3
return result
}
func print(message : str)
{
<
ldarg message
call void [mscorlib]System.Console::Write(string)
>
}
output
Hello World ! Hello World !
Problem identifying multi-line comments in the project.
Sample code:
#-#[CIL::inject(true)]
#[cfg::mustused(false)]
#[cfg::optimize(true)]
#[cfg::entrypoint(main)]
-#
func main()
{
let m , a , s : str
let sayhello : str = "Hello #qu #[65]min #qu"
<
ldloc sayhello
call void [mscorlib]System.Console::Write(string)
}
Code:
func test(val:i32) : i32
{
return [val * 2]
}
code ::
func main()
{
let result2 : f32 = test_expression(21)
<
ldloc result2
call void [mscorlib]System.Console::Write(float32)
>
}
func test_expression(i : i32) : f32
{
let result : f32 = [i + 32]
return result
}
CIL code ::
.method static public float32 test_expression(
int32 i
) cil managed
{
.locals init(
[0] float32 result
)
ldarg i
ldc.r8 32
add
stloc result
ldloc result
ret
}
Result ::
5.279024E-17
func main()
{
let i , ii : i8
<
ldc.i4 4
stloc.0 //Upper limit of the Loop, total 5
ldc.i4 0 //Initialize the Starting of loop
stloc.1
YO_Start:
//Check if the Counter exceeds
ldloc.1
ldloc.0
bgt Exit //
ldloc.1
call void [mscorlib]System.Console::WriteLine(int32)
//Increase the Counter
ldc.i4 1
ldloc.1
add
stloc.1
br YO_Start
>
}
Error :
================================================================================
CIL COMMANDS ERROR : Intermediate grammar for injection is not valid.
Source : E:\myapp\myapp.yo - Line [6]
*** More Detials ***
YO_Start: - This command could not be found.
***********************SNIPPT************************
Example :
Not specified
================================================================================
#[app::wait(true)]
#[app::classname("MyApp")]
#[cfg::CIL(true)]
func main()
{
let x : i32 = 25
X := 32
}
Error :
================================================================================
DECLARING ERROR : This local variable is already declared in the current block.
Source : C:\...\src\main.yo - Line [8]
Error Code : [Err-DECLARINGERROR-12]
*** More Detials ***
X := 32
^
***********************SNIPPT************************
Example :
Not specified
================================================================================
Error in function get_line_error(...) , get_line_code(...) , if the error is in the first line.
RUNTIME ERROR : An unknown error occurred while running.
Source : *** More Detials ***
Index was outside the bounds of the array.
at YOCA.authfunc.get_line_code(String path, Int32 line)
at YOCA.authfunc.get_line_error(String path, targetinf linecinf, String errto
ken)
at YOCA.attr.set_attribute(resultattribute resultattr)
Code:
let i : i32 = io::getln()
io::println("#{i}")
Output:
10
49504064
If there is a field without a value, it does not define it.
Example ::
#[app::classname("MyApp")]
#[app::wait(true)]
let public static name : str
func main()
{
...
}
Code :
let myname : str = "Amin"
Error :
================================================================================
ASSIGNMENT ERROR : '"Amin"' - Cannot be assignment to [type] -> 'string'.
Source : C:\Users\amin\Desktop\YOProject\useargs\src\main.yo - Line [12]
Error Code : [Err-ASSIGNCONVERT-24]
*** More Detials ***
let myname : str = "Amin"
^^^^^^
***********************SNIPPT************************
Example :
Not specified
================================================================================
YO Data Format Error :
-Initialization & Process Preparation
Init ->Preparation & analysis of 'Labra.yoda' :: [REFUSED]
================================================================================
RUNTIME ERROR : An unknown error occurred while running.
Source : *** More Detials ***
The keys and values are not equal.
***********************SNIPPT************************
Example :
Not specified
================================================================================```
code
func main()
{
test2()
}
func test2(i:i32)
{
to(i)
{
System.Console::Write("*")
}
System.Console::WriteLine()
}
error
-Intermediate Code Generation
Gen ->\src\main.yo - 3 func(s) , 0 field(s) :: [FAILED]
================================================================================
RUNTIME ERROR : An unknown error occurred while running.
Source : Error Code : [Err-RUNTIMEERROR-3]
*** More Detials ***
Object reference not set to an instance of an object.
***********************SNIPPT************************
Example :
Not specified
================================================================================
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.