<commit_before># Spry Language executable
#
# Copyright (c) 2015 <NAME>

# Enable when profiling
when defined(profiler):
  import nimprof

import os, parseopt2

import spryvm

import sprycore, sprylib, spryextend, sprymath, spryos, spryio, sprythread,
 spryoo, sprydebug, sprycompress, sprystring, sprymodules, spryreflect,
 spryblock, sprynet, sprysmtp, spryjson

# import sprypython

var spry = newInterpreter()

# Add extra modules
spry.addCore()
spry.addExtend()
spry.addMath()
spry.addOS()
spry.addIO()
spry.addThread()
#spry.addPython()
spry.addOO()
spry.addDebug()
spry.addCompress()
spry.addString()
spry.addModules()
spry.addReflect()
#spry.addUI()
spry.addBlock()
spry.addNet()
spry.addSMTP()
spry.addJSON()
#spry.addSophia()
spry.addLib()


let doc = """

Usage:
  spry [options] <path-or-stdin>

Options:
  -e --eval "code"    Evaluates Spry code given as string
  -h --help           Show this screen
  -v --version        Show version of Spry
"""

proc writeVersion() =
  echo "Spry 0.6"

proc writeHelp() =
  writeVersion()
  echo doc
  quit()

var
  filename: string
  eval = false
  code: string

for kind, key, val in getopt():
  case kind
  of cmdArgument:
    filename = key
  of cmdLongOption, cmdShortOption:
    case key
    of "help", "h":
      writeHelp()
    of "version", "v":
      writeVersion()
      quit()
    of "eval", "e": eval = true
  of cmdEnd: assert(false) # cannot happen

if eval:
  if filename == nil:
    writeHelp()
  else:
    code = filename
else:
  code =
    if filename == nil:
      # no filename has been given, so we use stdin
      readAll stdin
    else:
      readFile(filename)

discard spry.eval("[" & code & "]")<commit_msg>Fix warning for Nim 0.16.1<commit_after># Spry Language executable
#
# Copyright (c) 2015 <NAME>

# Enable when profiling
when defined(profiler):
  import nimprof

import os, parseopt2

import spryvm

import sprycore, sprylib, spryextend, sprymath, spryos, spryio, sprythread,
 spryoo, sprydebug, sprycompress, sprystring, sprymodules, spryreflect,
 spryblock, sprynet, sprysmtp, spryjson

# import sprypython

var spry = newInterpreter()

# Add extra modules
spry.addCore()
spry.addExtend()
spry.addMath()
spry.addOS()
spry.addIO()
spry.addThread()
#spry.addPython()
spry.addOO()
spry.addDebug()
spry.addCompress()
spry.addString()
spry.addModules()
spry.addReflect()
#spry.addUI()
spry.addBlock()
spry.addNet()
spry.addSMTP()
spry.addJSON()
#spry.addSophia()
spry.addLib()


let doc = """

Usage:
  spry [options] <path-or-stdin>

Options:
  -e --eval "code"    Evaluates Spry code given as string
  -h --help           Show this screen
  -v --version        Show version of Spry
"""

proc writeVersion() =
  echo "Spry 0.6"

proc writeHelp() =
  writeVersion()
  echo doc
  quit()

var
  filename: string
  eval = false
  code: string

for kind, key, val in getopt():
  case kind
  of cmdArgument:
    filename = key
  of cmdLongOption, cmdShortOption:
    case key
    of "help", "h":
      writeHelp()
    of "version", "v":
      writeVersion()
      quit()
    of "eval", "e": eval = true
    else: discard
  of cmdEnd: assert(false) # cannot happen

if eval:
  if filename == nil:
    writeHelp()
  else:
    code = filename
else:
  code =
    if filename == nil:
      # no filename has been given, so we use stdin
      readAll stdin
    else:
      readFile(filename)

discard spry.eval("[" & code & "]")
{'fraction_non_alphanumeric': 0.12327155045601648, 'fraction_numerical': 0.00529567519858782, 'mean_word_length': 3.3870967741935485, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 7, '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': '3771760', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1247, 'n_words': 362}