Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix access to undefined stack index on ExpressionParser #67

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Commits on Apr 17, 2019

  1. Configuration menu
    Copy the full SHA
    6c13805 View commit details
    Browse the repository at this point in the history
  2. Add runtime error when attempting to unpack a non unpackable Ast node

    Ex.:
    
    ```
    Error unpacking a non unpackable Ast node on `$(binary_xor?... {` at line 29 with context: [
        "^"
    ]
    
    Hint: use a non ellipsis expansion as in `$(binary_xor ? {`
    ```
    
    cc ircmaxell/php-compiler#29
    marcioAlmada committed Apr 17, 2019
    Configuration menu
    Copy the full SHA
    0cf0840 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ae6ee42 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    08c6490 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2019

  1. Allow Ast to set nested values

    ```
    $ast->{'some deep token'} = new Token(T_STRING, 'patch');
    ```
    
    Ref: github.com//pull/59
    marcioAlmada committed Apr 18, 2019
    Configuration menu
    Copy the full SHA
    58556cc View commit details
    Browse the repository at this point in the history
  2. 2 Configuration menu
    Copy the full SHA
    f0d1407 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2019

  1. Configuration menu
    Copy the full SHA
    3d49888 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2019

  1. Configuration menu
    Copy the full SHA
    490d24d View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2019

  1. Add support for composable Ast and TokenStream based expanders.

    From now on, the supported signature for expanders is:
    
    ```
    function(Optional<Ast|TokenStream> $subject, Optional<Engine> $e) : Ast|TokenStream;
    ```
    
    Support for nested Ast based expanders through Yay DSL also allowed:
    
    Ex.:
    
    ```php
    >> {
        $$(my_cheers_ast_expander(
            $$(my_hello_ast_expander(
                $(name_ast_node)
            ))
        ));
    }
    ```
    
    Given:
    
    ```php
    
    function my_hello_ast_expander(\Yay\Ast $ast) : \Yay\Ast {
        return new \Yay\Ast($ast->label(), new Token(
            T_CONSTANT_ENCAPSED_STRING, "'Hello, {$ast->token()}. From Ast.'", $ast->token()->line()
        ));
    }
    
    function my_cheers_ast_expander(\Yay\Ast $ast) : \Yay\Ast {
        $str = str_replace("'", "", (string) $ast->token());
    
        return new \Yay\Ast($ast->label(), new Token(
            T_CONSTANT_ENCAPSED_STRING, "'{$str} Cheers!'", $ast->token()->line()
        ));
    }
    
    ```
    
    Thanks @assertchris for reproducing bugs and pushing tests.
    marcioAlmada committed Sep 26, 2019
    Configuration menu
    Copy the full SHA
    c3dd1a3 View commit details
    Browse the repository at this point in the history
  2. Improve error handling and error message contextualization 👀

    - Augment error messages with their respective line and filename using the
    same formating as the PHP engine itself. This allows IDEs to parse both
    preprocessor and runtime error message the same way;
    - Use a `YayPreprocessorError` instead of stdlib exceptions that can come
    from any random user space code;
    marcioAlmada committed Sep 26, 2019
    Configuration menu
    Copy the full SHA
    5bfac52 View commit details
    Browse the repository at this point in the history
  3. Remove YayStreamWraper 💣

    Using a stream wrapper requires url include enabled and this is
    considered too unsafe for most setups. With that in mind I have
    no reason to maintain this feature.
    
    Other methods involving composer autoload trickery or xray
    (https://github.com/marcioAlmada/xray) extension have been
    considered preferable according to community usage history.
    marcioAlmada committed Sep 26, 2019
    Configuration menu
    Copy the full SHA
    c76f655 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2019

  1. Configuration menu
    Copy the full SHA
    975d96a View commit details
    Browse the repository at this point in the history
  2. Add experimental non opinionated command line linker to bin/yay:

    YAY!
    
    Usage:
      yay
      yay <file>
      yay --macros=<macros>
      yay --macros=<macros> <file>
      yay -h | --help
      yay --version
    
    Options:
      -h --help         Show this screen.
      --version         Show version.
      --macros=<macros> PHP glob pattern for macros to be loaded. Ex: my/macros/*.yay [default: '']
    
    Examples:
    
    ```
    # Process file:
    yay input.php > output.php
    
    # Process file, preload project macros:
    > yay --macros="./project-macros/*.yay" input.php > output.php
    
    # Process stdin:
    > cat input.php | yay > output.php
    
    # Process stdin, preload project macros:
    > cat input.php | yay --macros="./project-macros/*.yay" > output.php
    ```
    marcioAlmada committed Sep 29, 2019
    Configuration menu
    Copy the full SHA
    36e8191 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2019

  1. Configuration menu
    Copy the full SHA
    01c2896 View commit details
    Browse the repository at this point in the history
  2. Test againt php 7.4

    BackEndTea authored and marcioAlmada committed Sep 30, 2019
    Configuration menu
    Copy the full SHA
    9518254 View commit details
    Browse the repository at this point in the history
  3. Allow xdebug not to be disabled

    This allows the script to continue if xdebug can't be disabled
    (most likely bc it isn't there in the first place)
    BackEndTea authored and marcioAlmada committed Sep 30, 2019
    Configuration menu
    Copy the full SHA
    6a7fe41 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    50751d5 View commit details
    Browse the repository at this point in the history