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

=head1 NAME

t/embed/eval.t - Testing the sub 'eval'.

=head1 SYNOPSIS

    % perl t/harness t/embed/eval_string.t

=head1 DESCRIPTION

Tests the sub 'eval' used for supporting embedding Pipp in other applications.

=cut

.sub '_load' :anon :init :load

    load_bytecode 'pipp.pbc'

.end

.sub 'main' :main
    .include "include/test_more.pir"
    plan(1)

    ok( 1, 'no tests implemented yet')
    # TODO:
    # find sub 'eval_string'
    .local pmc eval_sub, no_args_sub
    .local int ret
    eval_sub = get_hll_global [ 'Pipp' ], 'eval'
    # call it with TAP diagnostics
    eval_sub("# only sea, not islands\n")

    eval_sub('<?php function no_args () { echo "# no_args was called\n"; } no_args(); ?>')

    # define a function
    # call it from here
    no_args_sub = get_hll_global 'no_args'
    no_args_sub()
.end

# Local Variables:
#   mode: pir
#   cperl-indent-level: 4
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
<commit_msg>Add examples on how to find 'no_args'.<commit_after># Copyright (C) 2008, The Perl Foundation.
# $Id$

=head1 NAME

t/embed/eval.t - Testing the sub 'eval'.

=head1 SYNOPSIS

    % perl t/harness t/embed/eval_string.t

=head1 DESCRIPTION

Tests the sub 'eval' used for supporting embedding Pipp in other applications.

=cut

.sub '_load' :anon :init :load

    load_bytecode 'pipp.pbc'

.end

.sub 'main' :main
    .include "include/test_more.pir"
    plan(1)

    ok( 1, 'no tests implemented yet')
    # TODO:
    # find sub 'eval_string'
    .local pmc eval_sub, no_args_sub
    .local int ret
    eval_sub = get_root_global [ 'parrot'; 'Pipp' ], 'eval'
    # call it with TAP diagnostics
    eval_sub("# only sea, not islands\n")

    eval_sub('<?php function no_args () { echo "# no_args was called\n"; } no_args(); ?>')

    # define a function
    # call it from here
    no_args_sub = get_hll_global 'no_args'
    no_args_sub()

    no_args_sub = get_root_global [ 'parrot' ], 'no_args'
    no_args_sub()
    # $P3 = get_namespace
    # say $P3

    # $P4 = get_hll_namespace
    # say $P4

    # $P5 = get_root_namespace
    # say $P5
.end

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

{'fraction_non_alphanumeric': 0.12272333044232438, 'fraction_numerical': 0.014744145706851692, 'mean_word_length': 3.0121739130434784, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6861378', 'n_tokens_mistral': 907, 'n_tokens_neox': 855, 'n_words': 250}