syntax: prepare stmts following loops to be unreachable
authorJean Privat <jean@pryen.org>
Thu, 14 Jan 2010 16:34:27 +0000 (11:34 -0500)
committerJean Privat <jean@pryen.org>
Thu, 14 Jan 2010 16:46:30 +0000 (11:46 -0500)
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 <jean@pryen.org>

lib/standard/collection/hash_collection.nit
src/parser/lexer.nit
src/parser/parser.nit
src/parser/xss/lexer.xss
src/parser/xss/parser.xss

index 818da57..a6c6837 100644 (file)
@@ -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)
index 6d6b295..158a76f 100644 (file)
@@ -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.
index 6b01634..b0cead6 100644 (file)
@@ -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]
index 6bb0008..f45f37c 100644 (file)
@@ -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.
index 08510f7..4123fd1 100644 (file)
@@ -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]