From: Jean Privat Date: Thu, 14 Jan 2010 16:34:27 +0000 (-0500) Subject: syntax: prepare stmts following loops to be unreachable X-Git-Tag: v0.4~58 X-Git-Url: http://nitlanguage.org?ds=sidebyside syntax: prepare stmts following loops to be unreachable Add dummy breaks and aborts in order to be able to bootstrap once statements following loops without breaks are set unreachable. Once c_src is updated, these dummy statements should be removed. Signed-off-by: Jean Privat --- diff --git a/lib/standard/collection/hash_collection.nit b/lib/standard/collection/hash_collection.nit index 818da57..a6c6837 100644 --- a/lib/standard/collection/hash_collection.nit +++ b/lib/standard/collection/hash_collection.nit @@ -57,8 +57,9 @@ special ArrayCapable[nullable N] cur -= 1 if cur < 0 then cur = _capacity - 1 assert no_loop: cur != base + if false then break # FIXME remove once unreach loop exits are in c_src end - abort + abort #FIXME remove once unreach loop exits are in c_src end # Add a new node (should be free) diff --git a/src/parser/lexer.nit b/src/parser/lexer.nit index 6d6b295..158a76f 100644 --- a/src/parser/lexer.nit +++ b/src/parser/lexer.nit @@ -2059,8 +2059,9 @@ class Lexer end end end + if false then break # FIXME remove once unreach loop exits are in c_src end - return null + return null # FIXME remove once unreach loop exits are in c_src end # Read the next character. diff --git a/src/parser/parser.nit b/src/parser/parser.nit index 6b01634..b0cead6 100644 --- a/src/parser/parser.nit +++ b/src/parser/parser.nit @@ -146,8 +146,9 @@ special ParserTable var node = new Start(null, node2) return node end + if false then break # FIXME remove once unreach loop exits are in c_src end - abort + abort # FIXME remove once unreach loop exits are in c_src end var _reduce_table: Array[ReduceAction] diff --git a/src/parser/xss/lexer.xss b/src/parser/xss/lexer.xss index 6bb0008..f45f37c 100644 --- a/src/parser/xss/lexer.xss +++ b/src/parser/xss/lexer.xss @@ -222,8 +222,9 @@ $ end foreach end end end + if false then break # FIXME remove once unreach loop exits are in c_src end - return null + return null # FIXME remove once unreach loop exits are in c_src end # Read the next character. diff --git a/src/parser/xss/parser.xss b/src/parser/xss/parser.xss index 08510f7..4123fd1 100644 --- a/src/parser/xss/parser.xss +++ b/src/parser/xss/parser.xss @@ -158,8 +158,9 @@ special ParserTable var node = new Start(null, node2) return node end + if false then break # FIXME remove once unreach loop exits are in c_src end - abort + abort # FIXME remove once unreach loop exits are in c_src end var _reduce_table: Array[ReduceAction]