PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/vjCommentPlugin/lib/tools/htmlpurifier/library/HTMLPurifier/Token.php

https://bitbucket.org/Kudlaty/360kdw
PHP | 57 lines | 31 code | 8 blank | 18 comment | 3 complexity | cebdc28d8a702d0d2dfceb8c27196812 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. /**
  3. * Abstract base token class that all others inherit from.
  4. */
  5. class HTMLPurifier_Token {
  6. public $line; /**< Line number node was on in source document. Null if unknown. */
  7. public $col; /**< Column of line node was on in source document. Null if unknown. */
  8. /**
  9. * Lookup array of processing that this token is exempt from.
  10. * Currently, valid values are "ValidateAttributes" and
  11. * "MakeWellFormed_TagClosedError"
  12. */
  13. public $armor = array();
  14. /**
  15. * Used during MakeWellFormed.
  16. */
  17. public $skip;
  18. public $rewind;
  19. public $carryover;
  20. public function __get($n) {
  21. if ($n === 'type') {
  22. trigger_error('Deprecated type property called; use instanceof', E_USER_NOTICE);
  23. switch (get_class($this)) {
  24. case 'HTMLPurifier_Token_Start': return 'start';
  25. case 'HTMLPurifier_Token_Empty': return 'empty';
  26. case 'HTMLPurifier_Token_End': return 'end';
  27. case 'HTMLPurifier_Token_Text': return 'text';
  28. case 'HTMLPurifier_Token_Comment': return 'comment';
  29. default: return null;
  30. }
  31. }
  32. }
  33. /**
  34. * Sets the position of the token in the source document.
  35. */
  36. public function position($l = null, $c = null) {
  37. $this->line = $l;
  38. $this->col = $c;
  39. }
  40. /**
  41. * Convenience function for DirectLex settings line/col position.
  42. */
  43. public function rawPosition($l, $c) {
  44. if ($c === -1) $l++;
  45. $this->line = $l;
  46. $this->col = $c;
  47. }
  48. }
  49. // vim: et sw=4 sts=4