<commit_before># Copyright (C) 2002-2008, The Perl Foundation.
# $Id$

.sub main :main
  .param pmc argv

  load_bytecode "Getopt/Obj.pbc"

  # Specification of command line arguments.
  .local pmc getopts
  getopts = new "Getopt::Obj"
  push getopts, "language=s"
  # getopts."notOptStop"(1)


  # the program name is the first element in argv
  .local string program_name
  program_name = shift argv

  # Make a copy of argv, because this can easier be handled in get_options
  # TODO: eliminate need for copy
  .local pmc argv_pmc_arr
  argv_pmc_arr = new .ResizablePMCArray
  .local int k, argc
  k = 0
  argc = argv
  beginfor:
    unless k < argc goto endfor
    $P0 = shift argv
    push argv_pmc_arr, $P0
    inc k
    goto beginfor
  endfor:

  .local pmc opt
  opt = getopts."get_options"(argv_pmc_arr)

  # Now we do what the passed options tell
  .local int is_defined

  # Was '--language' passed ?
  is_defined = defined opt["language"]
  if is_defined goto HAS_LANGUAGE_PARAM
    print "Please pass --language=<language>\n"
    end
  HAS_LANGUAGE_PARAM:

  .local string language
  language = opt["language"]

  # Get the input as a string, don't care about buffer overflow yet
  read S0, 1000000

  # Assume that the input is PASM and compile it
  compreg P1, language
  P0 = P1( S0 )

  # invoke the compiled code
  P0()

.end

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
<commit_msg>[parrot_compiler] - fix syntax<commit_after># Copyright (C) 2002-2008, The Perl Foundation.
# $Id$

.sub main :main
  .param pmc argv

  load_bytecode "Getopt/Obj.pbc"

  # Specification of command line arguments.
  .local pmc getopts
  getopts = new "Getopt::Obj"
  push getopts, "language=s"
  # getopts."notOptStop"(1)


  # the program name is the first element in argv
  .local string program_name
  program_name = shift argv

  # Make a copy of argv, because this can easier be handled in get_options
  # TODO: eliminate need for copy
  .local pmc argv_pmc_arr
  argv_pmc_arr = new "ResizablePMCArray"
  .local int k, argc
  k = 0
  argc = argv
  beginfor:
    unless k < argc goto endfor
    $P0 = shift argv
    push argv_pmc_arr, $P0
    inc k
    goto beginfor
  endfor:

  .local pmc opt
  opt = getopts."get_options"(argv_pmc_arr)

  # Now we do what the passed options tell
  .local int is_defined

  # Was '--language' passed ?
  is_defined = defined opt["language"]
  if is_defined goto HAS_LANGUAGE_PARAM
    print "Please pass --language=<language>\n"
    end
  HAS_LANGUAGE_PARAM:

  .local string language
  language = opt["language"]

  # Get the input as a string, don't care about buffer overflow yet
  read S0, 1000000

  # Assume that the input is PASM and compile it
  compreg P1, language
  P0 = P1( S0 )

  # invoke the compiled code
  P0()

.end

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:

{'fraction_non_alphanumeric': 0.08327645051194539, 'fraction_numerical': 0.019795221843003412, 'mean_word_length': 3.151558073654391, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '7650528', 'n_tokens_mistral': 1070, 'n_tokens_neox': 992, 'n_words': 360}