summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cratera/compiler.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/cratera/compiler.lua b/src/cratera/compiler.lua
index cb0681f..6b188ef 100644
--- a/src/cratera/compiler.lua
+++ b/src/cratera/compiler.lua
@@ -169,7 +169,9 @@ defs[parser.FALLBACK] = function(state, token)
                     -- keep going
                     i = i - 3
                 elseif results[i-2] == TK.FUNCTION then -- we're in funcname
-                    find_statement = false -- don't even bother with : handling
+                    -- funcname is of the form Name {'.' Name} ':'
+                    -- TODO how can we parse 'function Foo:[Bar].Baz()'...
+                    find_statement = false
                     break
                 else
                     -- found start of statement
@@ -381,19 +383,17 @@ defs[parser.FALLBACK] = function(state, token)
                             results.n = results.n + 1
                         end
                         -- inject cratera
-                        table.insert(results, pos, ')')
                         table.insert(results, pos, CRATERA_FUNCTION)
-                        table.insert(results, pos, '(')
                         -- check for potential prefixexp and correct for it
-                        if is_tk(results, pos-1, ']') or
-                            is_tk(results, pos-1, '}') or
-                            is_tk(results, pos-1, ')') or
-                            results[pos-2] == TK.NAME or
-                            results[pos-2] == TK.STRING then
-                            table.insert(results, pos, ';')
-                            results.n = results.n + 1
-                        end
-                        results.n = results.n + 3
+                        --if is_tk(results, pos-1, ']') or
+                        --    is_tk(results, pos-1, '}') or
+                        --    is_tk(results, pos-1, ')') or
+                        --    results[pos-2] == TK.NAME or
+                        --    results[pos-2] == TK.STRING then
+                        --    table.insert(results, pos, ' ')
+                        --    results.n = results.n + 1
+                        --end
+                        results.n = results.n + 1
                         -- tag it so we know to insert a ')' to close our '('
                         -- and to handle '(' ')' (no argument) calls
                         -- we add the tag before TK.STRING/'{'/','