<commit_before>//
//  Environment.swift
//  slox
//
//  Created by <NAME> on 2017-06-03.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import CoreFoundation

class Environment {
    var values: [String: LiteralValue] = [:]
    let enclosing: Environment?
    
    init(enclosing: Environment) {
        self.enclosing = enclosing
    }
    
    fileprivate init() {
        self.enclosing = nil
    }
    
    func define(name: String, value: LiteralValue) {
        values[name] = value
    }
    
    func get(name: String, at depth: Int) -> LiteralValue? {
        if depth == 0 {
            return values[name]
        } else {
            return enclosing!.get(name: name, at: depth - 1)
        }
    }
    
    func assign(name: String, value: LiteralValue, at depth: Int) -> Bool {
        if depth == 0 {
            guard values[name] != nil else { return false }
            
            values[name] = value
            return true
        } else {
            return enclosing!.assign(name: name, value: value, at: depth - 1)
        }<commit_msg>Minor access control change<commit_after>//
//  Environment.swift
//  slox
//
//  Created by <NAME> on 2017-06-03.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import CoreFoundation

class Environment {
    var values: [String: LiteralValue] = [:]
    let enclosing: Environment?
    
    init(enclosing: Environment) {
        self.enclosing = enclosing
    }
    
    private init() {
        self.enclosing = nil
    }
    
    func define(name: String, value: LiteralValue) {
        values[name] = value
    }
    
    func get(name: String, at depth: Int) -> LiteralValue? {
        if depth == 0 {
            return values[name]
        } else {
            return enclosing!.get(name: name, at: depth - 1)
        }
    }
    
    func assign(name: String, value: LiteralValue, at depth: Int) -> Bool {
        if depth == 0 {
            guard values[name] != nil else { return false }
            
            values[name] = value
            return true
        } else {
            return enclosing!.assign(name: name, value: value, at: depth - 1)
        }
{'fraction_non_alphanumeric': 0.11452513966480447, 'fraction_numerical': 0.0148975791433892, 'mean_word_length': 1.748081841432225, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '623919', 'n_tokens_mistral': 684, 'n_tokens_neox': 628, 'n_words': 185}