1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
6: * @package Nette\Latte
7: */
8:
9:
10:
11: /**
12: * Latte parser token.
13: *
14: * @author David Grudl
15: * @package Nette\Latte
16: */
17: class NLatteToken extends NObject
18: {
19: const TEXT = 'text',
20: MACRO_TAG = 'macroTag', // latte macro tag
21: HTML_TAG_BEGIN = 'htmlTagBegin', // begin of HTML tag or comment
22: HTML_TAG_END = 'htmlTagEnd', // end of HTML tag or comment
23: HTML_ATTRIBUTE = 'htmlAttribute',
24: COMMENT = 'comment'; // latte comment
25:
26: /** @var string token type [TEXT | MACRO_TAG | HTML_TAG_BEGIN | HTML_TAG_END | HTML_ATTRIBUTE | COMMENT] */
27: public $type;
28:
29: /** @var string content of the token */
30: public $text;
31:
32: /** @var int line number */
33: public $line;
34:
35: /** @var string name of macro tag, HTML tag or attribute; used for types MACRO_TAG, HTML_TAG_BEGIN, HTML_ATTRIBUTE */
36: public $name;
37:
38: /** @var string value of macro tag or HTML attribute; used for types MACRO_TAG, HTML_ATTRIBUTE */
39: public $value;
40:
41: /** @var string macro modifiers; used for type MACRO_TAG */
42: public $modifiers;
43:
44: /** @var bool is closing HTML tag? used for type HTML_TAG_BEGIN */
45: public $closing;
46:
47: }
48: