<commit_before>SILE.Commands = {}
function SILE.registerCommand (name, f) SILE.Commands[name] = f end

SILE.baseClass = std.object {
  registerCommands = (function()
    local commandStack = {};
    SILE.registerCommand("define", function (options, content)
      SILE.registerCommand(options["command"], function(o,c)
        local prevState = SILE.documentState;
        SILE.documentState = std.tree.clone( prevState )
        table.insert(commandStack, c)
        SILE.process(content)
        SILE.documentState = prevState
      end)
    end)

    SILE.registerCommand("comment", function(o,c) end);
    SILE.registerCommand("process", function()
      SILE.process(table.remove(commandStack));
    end)

    SILE.registerCommand("script", function(options, content)
      if (options["src"]) then 
        require(options["src"])
      else 
        p,e = loadstring(content[1])
        if not p then SU.error(e) end
        p()
      end
    end)

    SILE.registerCommand("include", function(options, content)
        SILE.readFile(options["src"]);
    end)

    SILE.registerCommand("pagetemplate", function (options, content) 
      SILE.documentState.thisPageTemplate = { frames = {} };
      SILE.process(content);
      SILE.documentState.thisPageTemplate.firstContentFrame = SILE.getFrame(options["first-content-frame"]);
      SILE.typesetter:initFrame(SILE.documentState.thisPageTemplate.firstContentFrame);
    end)

    SILE.registerCommand("frame", function (options, content)
      local spec = {<commit_msg>This was causing confusion and things seem to work without it.<commit_after>SILE.Commands = {}
function SILE.registerCommand (name, f) SILE.Commands[name] = f end

SILE.baseClass = std.object {
  registerCommands = (function()
    local commandStack = {};
    SILE.registerCommand("define", function (options, content)
      SILE.registerCommand(options["command"], function(o,c)
        --local prevState = SILE.documentState;
        --SILE.documentState = std.tree.clone( prevState )
        table.insert(commandStack, c)
        SILE.process(content)
        --SILE.documentState = prevState
      end)
    end)

    SILE.registerCommand("comment", function(o,c) end);
    SILE.registerCommand("process", function()
      SILE.process(table.remove(commandStack));
    end)

    SILE.registerCommand("script", function(options, content)
      if (options["src"]) then 
        require(options["src"])
      else 
        p,e = loadstring(content[1])
        if not p then SU.error(e) end
        p()
      end
    end)

    SILE.registerCommand("include", function(options, content)
        SILE.readFile(options["src"]);
    end)

    SILE.registerCommand("pagetemplate", function (options, content) 
      SILE.documentState.thisPageTemplate = { frames = {} };
      SILE.process(content);
      SILE.documentState.thisPageTemplate.firstContentFrame = SILE.getFrame(options["first-content-frame"]);
      SILE.typesetter:initFrame(SILE.documentState.thisPageTemplate.firstContentFrame);
    end)

    SILE.registerCommand("frame", function (options, content)
      local spec = {
{'fraction_non_alphanumeric': 0.1262447799550273, 'fraction_numerical': 0.00064246707356248, 'mean_word_length': 3.3735955056179776, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5678326', 'n_tokens_mistral': 920, 'n_tokens_neox': 909, 'n_words': 172}