mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 19:01:07 +01:00
turn off tracing by default, change golden (#381)
* turn off tracing by default, change golden * Update executable_semantics/main.cpp Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com> * Update executable_semantics/main.cpp Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com> * merge with trunk, update goldens Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
co-authored by
Jon Meow
parent
ced98ef021
commit
7c4fcd3fa5
@@ -1,95 +1 @@
|
||||
********** source program **********
|
||||
fn f () -> Int {
|
||||
return 0;
|
||||
|
||||
}
|
||||
var Int : y = f()
|
||||
fn main () -> Int {
|
||||
return y;
|
||||
|
||||
}
|
||||
********** type checking **********
|
||||
--- step exp Int --->
|
||||
--- step exp Int --->
|
||||
--- step exp Int --->
|
||||
--- step exp Int --->
|
||||
--- step exp Int --->
|
||||
--- step exp Int --->
|
||||
|
||||
********** type checking complete **********
|
||||
fn f () -> Int {
|
||||
return 0;
|
||||
}
|
||||
var Int : y = f()
|
||||
fn main () -> Int {
|
||||
return y;
|
||||
}
|
||||
********** starting execution **********
|
||||
********** initializing globals **********
|
||||
--- step exp () --->
|
||||
--- step exp f() --->
|
||||
--- step exp f --->
|
||||
--- handle value fun<f> with f()<1>(fun<f>,) --->
|
||||
--- step exp () --->
|
||||
--- handle value () with f()<2>(fun<f>,(),) --->
|
||||
pattern_match((), ())
|
||||
--- step stmt return 0; --->
|
||||
--- step exp 0 --->
|
||||
--- handle value 0 with return 0;<1>(0,) --->
|
||||
--- step exp () --->
|
||||
********** calling main function **********
|
||||
{
|
||||
stack: top{main()<-1>}
|
||||
heap: fun<f>, 0, fun<main>,
|
||||
env: main: fun<main>, y: 0, f: fun<f>,
|
||||
}
|
||||
--- step exp main() --->
|
||||
{
|
||||
stack: top{main<-1> :: main()<0>}
|
||||
heap: fun<f>, 0, fun<main>,
|
||||
env: main: fun<main>, y: 0, f: fun<f>,
|
||||
}
|
||||
--- step exp main --->
|
||||
{
|
||||
stack: top{fun<main><-1> :: main()<0>}
|
||||
heap: fun<f>, 0, fun<main>,
|
||||
env: main: fun<main>, y: 0, f: fun<f>,
|
||||
}
|
||||
--- handle value fun<main> with main()<1>(fun<main>,) --->
|
||||
{
|
||||
stack: top{()<-1> :: main()<1>(fun<main>,)}
|
||||
heap: fun<f>, 0, fun<main>,
|
||||
env: main: fun<main>, y: 0, f: fun<f>,
|
||||
}
|
||||
--- step exp () --->
|
||||
{
|
||||
stack: top{()<-1> :: main()<1>(fun<main>,)}
|
||||
heap: fun<f>, 0, fun<main>,
|
||||
env: main: fun<main>, y: 0, f: fun<f>,
|
||||
}
|
||||
--- handle value () with main()<2>(fun<main>,(),) --->
|
||||
pattern_match((), ())
|
||||
{
|
||||
stack: main{return y;<-1>} :: top{}
|
||||
heap: fun<f>, 0, fun<main>,
|
||||
env: main: fun<main>, y: 0, f: fun<f>,
|
||||
}
|
||||
--- step stmt return y; --->
|
||||
{
|
||||
stack: main{y<-1> :: return y;<0>} :: top{}
|
||||
heap: fun<f>, 0, fun<main>,
|
||||
env: main: fun<main>, y: 0, f: fun<f>,
|
||||
}
|
||||
--- step exp y --->
|
||||
{
|
||||
stack: main{0<-1> :: return y;<0>} :: top{}
|
||||
heap: fun<f>, 0, fun<main>,
|
||||
env: main: fun<main>, y: 0, f: fun<f>,
|
||||
}
|
||||
--- handle value 0 with return y;<1>(0,) --->
|
||||
{
|
||||
stack: top{0<-1>}
|
||||
heap: fun<f>, 0, fun<main>,
|
||||
env: main: fun<main>, y: 0, f: fun<f>,
|
||||
}
|
||||
result: 0
|
||||
|
||||
Reference in New Issue
Block a user