From 31e1bfa58f3678a7d89929d2ac94f668b0e4b781 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 7 Jan 2019 21:40:25 -0800 Subject: [PATCH] Moved require to top level. --- syntax_tree.lua | 2 +- syntax_tree.moon | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax_tree.lua b/syntax_tree.lua index 2365681..9886753 100644 --- a/syntax_tree.lua +++ b/syntax_tree.lua @@ -5,6 +5,7 @@ do end local Source Source = require("code_obj").Source +local Files = require('files') local unpack = unpack or table.unpack local as_lua as_lua = function(self) @@ -213,7 +214,6 @@ do self.source_code_for_tree = setmetatable({ }, { __index = function(self, t) local s = t.source - local Files = require('files') local f = Files.read(s.filename) return f end, diff --git a/syntax_tree.moon b/syntax_tree.moon index ba854e1..b59f1ef 100644 --- a/syntax_tree.moon +++ b/syntax_tree.moon @@ -2,6 +2,7 @@ -- as well as the logic for converting them to Lua code. {:insert, :remove, :concat} = table {:Source} = require "code_obj" +Files = require 'files' unpack or= table.unpack as_lua = => @@ -39,7 +40,6 @@ class SyntaxTree @source_code_for_tree: setmetatable({}, { __index:(t)=> s = t.source - Files = require 'files' f = Files.read(s.filename) return f __mode: "k"