Skip to content
Commits on Sep 12, 2011
  1. @scottmac

    zend_error_noreturn() causes problems on new gcc

    Summary:
    Fix build error
    
    Test Plan:
    
    Reviewers:
    
    CC:
    scottmac committed Sep 12, 2011
Commits on Aug 8, 2011
  1. @scottmac

    Fix static building of libxhp

    Description:
    libxhp didn't have the correct variable set in the include file.
    
    Also didn't include the path wherer to link libxhp from when it was static.
    scottmac committed Aug 8, 2011
Commits on Dec 2, 2010
  1. @laverdet

    Update fastpath to catch opening tags.

    Summary:
    If you have something like:
    
      $foo = <div>Her's</div>;
    
    The fastpath won't pick up the XHP because it thinks it's inside of a string, and it only looks for closing tags, not opening tags. I added an expression to detect opening tags as well, which in practice won't have many false positives.
    
    Test Plan:
    New unit test. Also ran xhpize on FB sources and no new fastpath false positives were introduced.
    
    Reviewed By: epriestley
    laverdet committed Dec 1, 2010
Commits on Jul 14, 2010
  1. Add a few comments in the XHP lexer

    Summary:
    While porting the XHP grammar to pfff I've made a few comments
    on the code that could be useful for other.
    
    Test Plan:
    cd xhp; make; ./xhpize -d ../tests/attr-blank.php
    seems to work.
    
    I was not able to make tests :(
    I get some:
    PHP Warning:  PHP Startup: Unable to load dynamic library 'modules/fb.so' -
    modules/fb.so: cannot open shared object file: No such file or directory in
    Unknown on line 0
    ...
    Running selected tests.
    FAIL Constant in Array [tests/array-constant.phpt]
    FAIL Blank attribute [tests/attr-blank.phpt]
    
    DiffCamp Revision: 132409
    Reviewed By: marcel
    CC: marcel
    Revert Plan:
    OK
    pad committed Jul 14, 2010
Commits on Jun 25, 2010
  1. @laverdet

    Fix parser glitch with <script />

    Summary:
    You can open and close PHP blocks with <script> and </script> which my fastpath parser tries to take into account. But the XHP detection looks for closing tags for its primary detection, so when it sees the closing </script> it leaves PHP context and then doesn't detect any XHP. I'm removing the closing </script> context switch which will slow down the fastpath in some stupid cases when people use <script language="php"> but whatever, no one does that. False positives are acceptable, false negatives are not.
    
    Test Plan:
    Unit test.
    
    Reviewed By: epriestley
    laverdet committed Jun 25, 2010
Commits on May 28, 2010
  1. @laverdet

    Fix invalid line numbers on syntax error

    Summary:
    If you encounter a syntax error via a mismatched tag, the line number it gives you may be messed up. This is because we only mark the parser as terminated but let it continue its work. This keeps eating up tokens and advancing the line number. So now we don't let the scanner continue if the parser has been marked as terminated, thus the line number remains where it was when we found the error.
    
    Test Plan:
    Unit tests.
    
    Reviewed By: kdelong
    laverdet committed May 28, 2010
Commits on May 17, 2010
  1. @laverdet

    Make categories not replace -, : etc

    Summary:
    Categories just become array keys so there's no need to replace them like we do identifiers.
    
    Test Plan:
    rebuild & reload
    
    Reviewed By: kdelong
    laverdet committed May 17, 2010
  2. @laverdet

    Stricter whitespace rules

    Summary:
    Basically this diff makes is so that XHP whitespace behaves as I said it would from the start. Pure whitespace in between nodes is truncated, leading and trailing whitespace between a text node and something else is collapsed into a space.
    
    Test Plan:
    Unit tests
    
    Reviewed By: kdelong
    laverdet committed May 14, 2010
Commits on May 12, 2010
  1. @laverdet

    Cleaning up the XHP bug list

    Summary:
    - Allow XHP constants in arrays, i.e. array('foo' => :foo::bar);
    - Fix handling of ?> and </script> in heredoc
    http://github.com/facebook/xhp/issues/issue/11
    - Fix 2 bugs with line numbers getting corrupted
    - Fix use of "xor", "or", and "and" operators
    http://github.com/facebook/xhp/issues/issue/12
    - Whitespace issues (need more tests)
    
    Test Plan:
    Added unit tests for each bug fixed. All tests passed successfully.
    
    Reviewed By: martin
    laverdet committed May 11, 2010
Commits on Mar 9, 2010
  1. Adding float attribute type to XHP.

    Summary:
    Add a new type for attributes in XHP for float (AKA double).
    
    Reviewed By: marcel
    
    Test Plan:
    Added a new test for float attributes.
    Nora Mullaney committed Mar 8, 2010
  2. @laverdet

    Bump to 1.3.8

    laverdet committed Mar 8, 2010
  3. @laverdet

    Fix parser glitch

    Summary:
    http://github.com/facebook/xhp/issues/issue/10
    
    XHP's flagrant misuse of scanner states is catching up now with this ridiculous parser bug. I'm taking the easy way out by forbidding clients to use reserved words in XHP class constants which is probably less bad than the existing bug.
    
    Reviewed By: dweatherford
    
    Test Plan:
    Ran tests. Added new test for the broken case, and another random case I wanted to add for the hell of it.
    laverdet committed Mar 8, 2010
  4. @laverdet

    Fix broken test

    Summary:
    The behavior of this actually changed in PHP 5.3 so I guess the unit test needs to work with both 5.2 and 5.3.
    
    Reviewed By: dweatherford
    
    Test Plan:
    Ran test on 5.2 and 5.3 (actually just 5.2).
    laverdet committed Mar 8, 2010
  5. @laverdet

    Fix XHP build on gcc 4.1

    Summary:
    There is an undefined function that I don't even know how it gets defined, but it does in gcc > 4.1. Collocating this function in ext.cpp so older versions of gcc can build XHP.
    
    Reviewed By: dweatherford
    
    Test Plan:
    Build using gcc 4.1.2 and php 5.3.2
    laverdet committed Mar 8, 2010
  6. @laverdet

    Add support for PHP 5.3 namespaces

    Summary:
    http://github.com/facebook/xhp/issues/issue/6
    
    Currently if you use `namespace` anywhere in your client code you can no longer use XHP. This is because of the new semantics introduced to PHP 5.3. Unfortunately XHP has its own namespace structure which conflicts with PHP's. So if we detect PHP 5.3 we will embrace namespaces by sticking all our classes in the global namespace.
    
    Reviewed By: dweatherford
    
    Test Plan:
    Build and run tests. No new tests since we don't run PHP 5.3.
    laverdet committed Mar 8, 2010
Commits on Feb 21, 2010
  1. @scottmac
  2. @scottmac

    Add cmake files to .gitignore

    scottmac committed Feb 21, 2010
Commits on Feb 17, 2010
  1. @metagoto @laverdet
  2. @metagoto @laverdet
Commits on Feb 8, 2010
  1. @laverdet

    Fix include orders

    Summary:
    There was some misuse here between string.h and string. I went ahead and cleared
    that up to make the build work on more correct platforms.
    laverdet committed Feb 7, 2010
  2. @laverdet

    Documentation update

    Summary:
    In the releases we will include generated code so that bison, flex, and re2c are
    only required for developers. Updating documentation to reflect this.
    laverdet committed Feb 7, 2010
  3. @laverdet

    Update license to 2010

    laverdet committed Feb 7, 2010
Commits on Jan 7, 2010
  1. @laverdet

    Adding .gitignore

    Summary:
    This is my local exclude file. It hides all the garbage that phpize puts into your directory in addition to bison, flex, and re2c generated files.
    laverdet committed Jan 7, 2010
  2. @laverdet
  3. @laverdet

    Update PHP libraries

    Summary:
    These have been seeing a lot of iteration in tfb, so I want to update them in
    XHP (seeing as how the current versions won't even work).
    laverdet committed Jan 6, 2010
Commits on Dec 19, 2009
  1. @laverdet

    Fix multiple attribute stealing

    Summary:
    There's a bug right now where if you steal attributes you have to do them all on the same line or there's a parse error. This isn't a parse error in XHP, but a problem with the generated code. Stripping line number information from the identifier fixes this, which is the desired behavior anyway because __xhpAttributeDeclaration should be one 1 line.
    
    Reviewed By: kdelong
    
    Test Plan:
    attributes.phpt
    
    Revert: OK
    
    DiffCamp Revision: 80761
    laverdet committed Dec 18, 2009
  2. @laverdet

    Fix bugs with markup attributes

    Summary:
    - Blank attributes <div style="" /> are valid
    - Entities may be used in attributes
    - &#...; attributes always work now
    - Invalid entity errors are sane
    
    Reviewed By: kdelong
    
    Test Plan:
    attr-blank.phpt now passes
    
    Revert: OK
    
    DiffCamp Revision: 80760
    laverdet committed Dec 18, 2009
Commits on Dec 18, 2009
  1. @laverdet

    Tons of entities

    Summary:
    This adds all XML and HTML entities to XHP. Now you can do <div>&Agrave;</div> if you want, I guess.
    
    I removed all the chess piece entities because those were crazy, but I kept the clouds and snowmans.
    
    Reviewed By: kdelong
    
    Test Plan:
    Confirmed that compile time of scanner.lex.cpp is like 4 times longer than it used to be.
    
    Revert: OK
    
    DiffCamp Revision: 80759
    laverdet committed Dec 18, 2009
  2. @laverdet

    Add a bunch of tests

    Summary:
    These tests are mostly worthless but it might motivate me to make more in the future.
    
    Reviewed By: kdelong
    
    Test Plan:
    HA!
    
    Revert: OK
    
    DiffCamp Revision: 80705
    laverdet committed Dec 18, 2009
Commits on Nov 30, 2009
  1. @laverdet

    Fix build error on newer gcc

    Summary:
    Our ancient copy of gcc lets this through but older versions do not.
    
    Reviewed By: epriestley
    
    Test Plan: build
    laverdet committed Nov 30, 2009
Commits on Nov 29, 2009
  1. @laverdet

    Allow ArrayAccess in __xhp_idx

    Summary:
    __xhp_idx doesn't work with FBObject right now because it's not aware of ArrayAccess. This diff adds some more functionality to that so hopefully now it'll work just like ##function idx($a, $b) { return $a[$b]; }##.
    
    I'm not aware of any function available to PHP extensions that does this for you, and my research has led me nowhere either. Seems like every extension just has to implement their own terrible versions of zval-mangling utility functions.
    
    Reviewed By: epriestley
    
    Other Commenters: mcslee
    
    Test Plan:
    Ran this guy and verified __xhp_idx and idx behave the same.
    
      <?php
      class foo implements ArrayAccess {
        public function offsetExists($offset) { return true; }
        public function offsetGet($offset) { return $offset; }
        public function offsetSet($offset, $data) {}
        public function offsetUnset($offset) {}
      }
    
      $array = array();
      $array[0] = 'zero';
      $array['key'] = 'value';
      $string = 'foobar';
      $object = new foo;
    
      function idx($a, $b) {
        return $a[$b];
      }
    
      foreach (array('idx', '__xhp_idx') as $fn) {
        var_dump($fn($array, 0));
        var_dump($fn($array, '0'));
        var_dump($fn($array, NULL));
        var_dump($fn($array, true));
        var_dump($fn($array, false));
        var_dump($fn($array, 'key'));
        var_dump($fn($array, 'other_key'));
        echo "---\n";
    
        var_dump($fn($string, 0));
        var_dump($fn($string, '0'));
        var_dump($fn($string, NULL));
        var_dump($fn($string, true));
        var_dump($fn($string, false));
        var_dump($fn($string, 'honk'));
        echo "---\n";
    
        var_dump($fn($object, 0));
        var_dump($fn($object, NULL));
        var_dump($fn($object, true));
        var_dump($fn($object, false));
        var_dump($fn($object, 'key'));
        echo "------------------------\n";
    }
    
    Revert: OK
    
    DiffCamp Revision: 76249
    laverdet committed Nov 29, 2009
Commits on Nov 24, 2009
  1. @laverdet

    Fix static variable access from XHP classes

    Summary:
    Currently you can't access static variables in an XHP class. "echo :x::$foo" is
    a syntax error.
    
    Reviewed By: epriestley
    
    Test Plan:
      marcel@dev050 ~/xhp $ cat test.php
      <?php
      class :fb:thing {
        public static $TEST = 1;
      }
    
      echo :fb:thing::$TEST."\n";
      (:fb:thing::$TEST = 2);
      echo :fb:thing::$TEST."\n";
    
      marcel@dev050 ~/xhp $ php test.php
      1
      2
    
    Revert: OK
    laverdet committed Nov 23, 2009
Commits on Oct 28, 2009
  1. @laverdet

    Fix bug with duped __xhpAttributeDeclaration

    Summary:
    Currently XHP will define __xhpAttributeDeclaration on any class that uses the
    leading-colon scheme. This is annoying because we can't define a base
    implementation or __xhpAttributeDeclaration. So now it only defines
    __xhpAttributeDeclaration if you define attributes.
    
    Reviewed By: epriestley
    
    Test Plan: xhpize
    
    Revert: OK
    laverdet committed Oct 28, 2009
Commits on Oct 27, 2009
  1. @laverdet

    Include debug info in element construction

    Summary:
    Right now XHP errors are difficult to debug because many errors aren't surfaced until toString() is called which is probably very far away from where the element was actually constructed. We've solved this in trunk by calling debug_backtrace() in every construction but that's pretty ridiculous.
    
    So I'm adding information to each construction which will pass to the element about where it came from.
    
    Reviewed By: epriestley
    
    Test Plan:
    xhpized a few files
    
    Revert: OK
    
    DiffCamp Revision: 71252
    laverdet committed Oct 27, 2009
Commits on Oct 26, 2009
  1. @laverdet

    Add support for empty closing tags

    Summary:
    <foo>bar</> is now valid syntax. "</>" will just close whatever tag happens to
    be open at the time. This mimics the behavior of a subset of SGML's SHORTTAG
    directive.
    
    Reviewed By: dcorson
    
    Test Plan: xhpize + various clients of XHP
    
    Revert: OK
    laverdet committed Oct 26, 2009
Something went wrong with that request. Please try again.