From 8acf4ec442a1837e848208e3c08078d86d4a4c11 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Tue, 3 Nov 2020 18:36:55 -0700 Subject: add the last couple statement types --- language/statements/index.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'language/statements') diff --git a/language/statements/index.rst b/language/statements/index.rst index 623eb23..93ff690 100644 --- a/language/statements/index.rst +++ b/language/statements/index.rst @@ -26,6 +26,31 @@ Statements None. +.. crowbar:element:: FragileStatement <- 'fragile' Statement + + Some behaviors are difficult to ensure the robustness of at compile time, and these behaviors are defined in this specification as *fragile*. + Fragile behaviors used outside of fragile statements should produce a compiler error. + + Compile-time Behavior: + + Fragile behaviors used inside a fragile statement must not produce a compiler error for their fragility. + Nesting fragile statements should produce a compiler error. + + Runtime Behavior: + + The contained statement is executed. + +.. crowbar:element:: ExpressionStatement <- Expression ';' + + Compile-time Behavior: + + If the expression is not a function call, the compiler may emit a warning. + + Runtime Behavior: + + The expression is evaluated and the resulting value is discarded. + Function calls must be fully evaluated, but expressions that are not function calls may be optimized out. + .. toctree:: :maxdepth: 1 -- cgit v1.2.3