chemoish / atom-valign

MIT License
5 stars 1 forks source link

PHP Keyed Arrays #1

Closed curtisblackwell closed 10 years ago

curtisblackwell commented 10 years ago

When using Valign with keyed arrays in PHP, the = gets separated from the >, resulting in a syntax error.

Example after using Valign:

<?php 

$my_array = array(
  'A' => array(
    'one' => array(
      'z'  = > 'hey',
      'aa' = > 'bee'
    )
  )
);
chemoish commented 10 years ago

Thank you for the issue. It is an easy one to fix though it would be a one off for PHP. I wonder if I should finally implement language parser.

I will try and fix it in the next day or two.

chemoish commented 10 years ago

Fixed https://github.com/chemoish/atom-valign/commit/e10af41a4173e64f3a41a5d334982fa53def06b4

curtisblackwell commented 10 years ago

sweet. thanks!

noticed a similar issue today… triple equals === become == =. I imagine a default regex with the ability to override based on language would handle this well.

chemoish commented 10 years ago

Yes, I didn't want to use the language parser in the beginning because it was too unreliable. Yes, in the cases of equality it will be messed up. I could strictly match on valid operators or just know that it will have odd behavior if you try to align anything that wasn't meant to be :>

I have never went out of my way to align equalities. I don't think this is a big issue. Your recommendations are noted, however!

curtisblackwell commented 10 years ago

Gotcha. Thanks for the explanation.