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

some updates to the PHP lexer #1397

Merged
merged 15 commits into from Apr 7, 2020
Merged

some updates to the PHP lexer #1397

merged 15 commits into from Apr 7, 2020

Commits on Apr 4, 2020

  1. * fix case insensitivity of (accordingly to the language):

      + `<?php`
      + keywords
      + function/method names
    * updates to the language:
      + support `_` in (binary, decimal, hexadecimal, ...) numbers (7.4.0)
      + support for binary numbers (`0b...`) (5.4.0)
      + Unicode codepoints escape syntax (`\u{...}`) (7.0.0)
      + add some missing keywords:
        * `fn` keyword (7.4.0)
        * type declarations (PHP 7, including `void` and nullable types from PHP 7.1)
        * 7.0.0: `class` (anonymous classes), `yield from`
        * 5.4.0: `callable`, `insteadof`, `trait`, `__TRAIT__`
        * 5.3.0: `goto`, `__NAMESPACE__`, `__DIR__`
        * others: casts, `instanceof`, `__CLASS__`, `__FUNCTION__`, `__METHOD__`, `__halt_compiler`
        * `self` even if it's not really a reserved word
    julp committed Apr 4, 2020
    Configuration menu
    Copy the full SHA
    4a21ac0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    060295a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0c64839 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    00911c6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9090523 View commit details
    Browse the repository at this point in the history
  6. pull out true, false and null from keywords:

    we already had a rule to handle their lower case form,
    just make it case insensitive.
    julp committed Apr 4, 2020
    Configuration menu
    Copy the full SHA
    f441f10 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2d98e5a View commit details
    Browse the repository at this point in the history
  8. cleanup PHP keywords:

    * remove E_* and PHP_* constants: these are not keywords and are case sensitive
    (keywords are not)
    * `not` doesn't exist
    * neither `this`
    * `empty` should be treated in the same way as `isset` and `unset` (currently functions)
    * `virtual` is a function, not a keyword
    * `php_user_filter` is a class, not a keyword
    julp committed Apr 4, 2020
    Configuration menu
    Copy the full SHA
    ef6fc5e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2aa5634 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    775cd71 View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2020

  1. Remove trailing whitespace

    pyrmont committed Apr 5, 2020
    Configuration menu
    Copy the full SHA
    a12604d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ca22a6c View commit details
    Browse the repository at this point in the history
  3. simplify rules for numbers

    julp committed Apr 5, 2020
    Configuration menu
    Copy the full SHA
    5c80d72 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c93f333 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2020

  1. fix tokenization of nullable types (eg ?int): the rule handling

    typehinting should be placed before the one whith `?` and which
    recognizes, among others, operators like `?`, `??`, `??=`, ...
    
    In clear, `?int` is actually tokenized as:
    `['Operator', '?'], ['Keyword.Type', 'int']`
    Instead of:
    `['Keyword.Type', '?int']`
    julp committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    67d3bb5 View commit details
    Browse the repository at this point in the history