phrep

Check-in [e2ad430ee0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use array_merge() instad of += adjoing operator on updating ->pragma stack.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e2ad430ee0cdf6f7c6a4a0df31a04b7aee1e35d1
User & Date: mario 2015-04-28 23:08:40
Context
2015-04-28
23:09
Set current as '0.2.9' (no release). check-in: 6c2466e1ae user: mario tags: trunk
23:08
Use array_merge() instad of += adjoing operator on updating ->pragma stack. check-in: e2ad430ee0 user: mario tags: trunk
23:07
Only redirect STDOUT for failing tests. check-in: 0370a185c4 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to macro.php.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<?php
/**
 * api: php
 * title: PHP Macro Preprocessor
 * description: Context-sensitive C-style #define/macro directive processing.
 * license: MITL
 * version: 0.2.7
 * state: beta
 * depends: php (>= 5.4.0)
 * type: rewrite
 * category: macro
 * url: http://fossil.include-once.org/phrep/
 * pack: macro.php=MacroProcessor.php
 *
................................................................................
        "interpolate" => "token", # Or "regex" mode, or "erb", "phpp", or "delim << >>" for custom delimiters.
        "dirs" => NULL,           # Append include -I search paths.
        "preserve" => "output,file,line",  # Pragma states to retain between #includes
        "strip_php_tags" => 1,    # Remove <?php open and close tokens from #include files
    ];

    // Updated via versionnum
    const PHREP_VERSION = "0.2.7";

    /**
     * Predefined and collected constants and macros.
     */
    var $defines = [

       #-- Predeclare some C-style constants
................................................................................

        // Change some states between includes (output,file,line)
        $preserve = array_intersect_key($this->pragma, array_flip(str_getcsv($this->pragma["preserve"])));
        $this->pragma += ["file" => $fn, "line" => 0, "output" => fnmatch($fn, $this->pragma["omit"], GLOB_BRACE)];

        // Run through preprocessor phase, and reset kept states
        $src = $this->block($src);
        $this->pragma += $preserve;
        return $src;
    }


    /**
     * Search ->dirs for #include $fn with automatic extension probing.
     *






|







 







|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<?php
/**
 * api: php
 * title: PHP Macro Preprocessor
 * description: Context-sensitive C-style #define/macro directive processing.
 * license: MITL
 * version: 0.2.8
 * state: beta
 * depends: php (>= 5.4.0)
 * type: rewrite
 * category: macro
 * url: http://fossil.include-once.org/phrep/
 * pack: macro.php=MacroProcessor.php
 *
................................................................................
        "interpolate" => "token", # Or "regex" mode, or "erb", "phpp", or "delim << >>" for custom delimiters.
        "dirs" => NULL,           # Append include -I search paths.
        "preserve" => "output,file,line",  # Pragma states to retain between #includes
        "strip_php_tags" => 1,    # Remove <?php open and close tokens from #include files
    ];

    // Updated via versionnum
    const PHREP_VERSION = "0.2.8";

    /**
     * Predefined and collected constants and macros.
     */
    var $defines = [

       #-- Predeclare some C-style constants
................................................................................

        // Change some states between includes (output,file,line)
        $preserve = array_intersect_key($this->pragma, array_flip(str_getcsv($this->pragma["preserve"])));
        $this->pragma += ["file" => $fn, "line" => 0, "output" => fnmatch($fn, $this->pragma["omit"], GLOB_BRACE)];

        // Run through preprocessor phase, and reset kept states
        $src = $this->block($src);
        $this->pragma = array_merge($this->pragma, $preserve);
        return $src;
    }


    /**
     * Search ->dirs for #include $fn with automatic extension probing.
     *