Introduce dedicated node to store markup
[hiphop-php.git] / hphp / hack / src / parser / full_fidelity_token_kind.ml
blobaffa73a8e3efb964fa2efc0cf01a2714f31f1b7b
1 (**
2 * Copyright (c) 2016, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the "hack" directory of this source tree. An additional
7 * grant of patent rights can be found in the PATENTS file in the same
8 * directory.
12 * THIS FILE IS @generated; DO NOT EDIT IT
13 * To regenerate this file, run
15 * buck run //hphp/hack/src:generate_full_fidelity
17 * This module contains the type describing the structure of a syntax tree.
23 type t =
24 (* No text tokens *)
25 | EndOfFile
26 (* Given text tokens *)
27 | Abstract
28 | And
29 | Array
30 | Arraykey
31 | As
32 | Async
33 | Attribute
34 | Await
35 | Bool
36 | Break
37 | Case
38 | Catch
39 | Category
40 | Children
41 | Class
42 | Classname
43 | Clone
44 | Const
45 | Construct
46 | Continue
47 | Coroutine
48 | Darray
49 | Default
50 | Define
51 | Destruct
52 | Dict
53 | Do
54 | Double
55 | Echo
56 | Else
57 | Elseif
58 | Empty
59 | Enum
60 | Eval
61 | Extends
62 | Fallthrough
63 | Float
64 | Final
65 | Finally
66 | For
67 | Foreach
68 | Function
69 | Global
70 | Goto
71 | If
72 | Implements
73 | Include
74 | Include_once
75 | Instanceof
76 | Insteadof
77 | Int
78 | Interface
79 | Isset
80 | Keyset
81 | List
82 | Mixed
83 | Namespace
84 | New
85 | Newtype
86 | Noreturn
87 | Num
88 | Object
89 | Or
90 | Parent
91 | Print
92 | Private
93 | Protected
94 | Public
95 | Require
96 | Require_once
97 | Required
98 | Resource
99 | Return
100 | Self
101 | Shape
102 | Static
103 | String
104 | Super
105 | Suspend
106 | Switch
107 | This
108 | Throw
109 | Trait
110 | Try
111 | Tuple
112 | Type
113 | Unset
114 | Use
115 | Var
116 | Varray
117 | Vec
118 | Void
119 | Where
120 | While
121 | Xor
122 | Yield
123 | LeftBracket
124 | RightBracket
125 | LeftParen
126 | RightParen
127 | LeftBrace
128 | RightBrace
129 | Dot
130 | MinusGreaterThan
131 | PlusPlus
132 | MinusMinus
133 | StarStar
134 | Star
135 | Plus
136 | Minus
137 | Tilde
138 | Exclamation
139 | Dollar
140 | Slash
141 | Percent
142 | LessThanGreaterThan
143 | LessThanEqualGreaterThan
144 | LessThanLessThan
145 | GreaterThanGreaterThan
146 | LessThan
147 | GreaterThan
148 | LessThanEqual
149 | GreaterThanEqual
150 | EqualEqual
151 | EqualEqualEqual
152 | ExclamationEqual
153 | ExclamationEqualEqual
154 | Carat
155 | Bar
156 | Ampersand
157 | AmpersandAmpersand
158 | BarBar
159 | Question
160 | QuestionQuestion
161 | Colon
162 | Semicolon
163 | Equal
164 | StarStarEqual
165 | StarEqual
166 | SlashEqual
167 | PercentEqual
168 | PlusEqual
169 | MinusEqual
170 | DotEqual
171 | LessThanLessThanEqual
172 | GreaterThanGreaterThanEqual
173 | AmpersandEqual
174 | CaratEqual
175 | BarEqual
176 | Comma
177 | At
178 | ColonColon
179 | EqualGreaterThan
180 | EqualEqualGreaterThan
181 | QuestionMinusGreaterThan
182 | DotDotDot
183 | DollarDollar
184 | BarGreaterThan
185 | NullLiteral
186 | SlashGreaterThan
187 | LessThanSlash
188 | LessThanQuestion
189 | QuestionGreaterThan
190 (* Variable text tokens *)
191 | ErrorToken
192 | Name
193 | QualifiedName
194 | Variable
195 | NamespacePrefix
196 | DecimalLiteral
197 | OctalLiteral
198 | HexadecimalLiteral
199 | BinaryLiteral
200 | FloatingLiteral
201 | ExecutionString
202 | SingleQuotedStringLiteral
203 | DoubleQuotedStringLiteral
204 | DoubleQuotedStringLiteralHead
205 | StringLiteralBody
206 | DoubleQuotedStringLiteralTail
207 | HeredocStringLiteral
208 | HeredocStringLiteralHead
209 | HeredocStringLiteralTail
210 | NowdocStringLiteral
211 | BooleanLiteral
212 | XHPCategoryName
213 | XHPElementName
214 | XHPClassName
215 | XHPStringLiteral
216 | XHPBody
217 | XHPComment
218 | Markup
221 let from_string keyword =
222 match keyword with
223 | "true" -> Some BooleanLiteral
224 | "false" -> Some BooleanLiteral
225 | "abstract" -> Some Abstract
226 | "and" -> Some And
227 | "array" -> Some Array
228 | "arraykey" -> Some Arraykey
229 | "as" -> Some As
230 | "async" -> Some Async
231 | "attribute" -> Some Attribute
232 | "await" -> Some Await
233 | "bool" -> Some Bool
234 | "break" -> Some Break
235 | "case" -> Some Case
236 | "catch" -> Some Catch
237 | "category" -> Some Category
238 | "children" -> Some Children
239 | "class" -> Some Class
240 | "classname" -> Some Classname
241 | "clone" -> Some Clone
242 | "const" -> Some Const
243 | "__construct" -> Some Construct
244 | "continue" -> Some Continue
245 | "coroutine" -> Some Coroutine
246 | "darray" -> Some Darray
247 | "default" -> Some Default
248 | "define" -> Some Define
249 | "__destruct" -> Some Destruct
250 | "dict" -> Some Dict
251 | "do" -> Some Do
252 | "double" -> Some Double
253 | "echo" -> Some Echo
254 | "else" -> Some Else
255 | "elseif" -> Some Elseif
256 | "empty" -> Some Empty
257 | "enum" -> Some Enum
258 | "eval" -> Some Eval
259 | "extends" -> Some Extends
260 | "fallthrough" -> Some Fallthrough
261 | "float" -> Some Float
262 | "final" -> Some Final
263 | "finally" -> Some Finally
264 | "for" -> Some For
265 | "foreach" -> Some Foreach
266 | "function" -> Some Function
267 | "global" -> Some Global
268 | "goto" -> Some Goto
269 | "if" -> Some If
270 | "implements" -> Some Implements
271 | "include" -> Some Include
272 | "include_once" -> Some Include_once
273 | "instanceof" -> Some Instanceof
274 | "insteadof" -> Some Insteadof
275 | "int" -> Some Int
276 | "interface" -> Some Interface
277 | "isset" -> Some Isset
278 | "keyset" -> Some Keyset
279 | "list" -> Some List
280 | "mixed" -> Some Mixed
281 | "namespace" -> Some Namespace
282 | "new" -> Some New
283 | "newtype" -> Some Newtype
284 | "noreturn" -> Some Noreturn
285 | "num" -> Some Num
286 | "object" -> Some Object
287 | "or" -> Some Or
288 | "parent" -> Some Parent
289 | "print" -> Some Print
290 | "private" -> Some Private
291 | "protected" -> Some Protected
292 | "public" -> Some Public
293 | "require" -> Some Require
294 | "require_once" -> Some Require_once
295 | "required" -> Some Required
296 | "resource" -> Some Resource
297 | "return" -> Some Return
298 | "self" -> Some Self
299 | "shape" -> Some Shape
300 | "static" -> Some Static
301 | "string" -> Some String
302 | "super" -> Some Super
303 | "suspend" -> Some Suspend
304 | "switch" -> Some Switch
305 | "this" -> Some This
306 | "throw" -> Some Throw
307 | "trait" -> Some Trait
308 | "try" -> Some Try
309 | "tuple" -> Some Tuple
310 | "type" -> Some Type
311 | "unset" -> Some Unset
312 | "use" -> Some Use
313 | "var" -> Some Var
314 | "varray" -> Some Varray
315 | "vec" -> Some Vec
316 | "void" -> Some Void
317 | "where" -> Some Where
318 | "while" -> Some While
319 | "xor" -> Some Xor
320 | "yield" -> Some Yield
321 | "[" -> Some LeftBracket
322 | "]" -> Some RightBracket
323 | "(" -> Some LeftParen
324 | ")" -> Some RightParen
325 | "{" -> Some LeftBrace
326 | "}" -> Some RightBrace
327 | "." -> Some Dot
328 | "->" -> Some MinusGreaterThan
329 | "++" -> Some PlusPlus
330 | "--" -> Some MinusMinus
331 | "**" -> Some StarStar
332 | "*" -> Some Star
333 | "+" -> Some Plus
334 | "-" -> Some Minus
335 | "~" -> Some Tilde
336 | "!" -> Some Exclamation
337 | "$" -> Some Dollar
338 | "/" -> Some Slash
339 | "%" -> Some Percent
340 | "<>" -> Some LessThanGreaterThan
341 | "<=>" -> Some LessThanEqualGreaterThan
342 | "<<" -> Some LessThanLessThan
343 | ">>" -> Some GreaterThanGreaterThan
344 | "<" -> Some LessThan
345 | ">" -> Some GreaterThan
346 | "<=" -> Some LessThanEqual
347 | ">=" -> Some GreaterThanEqual
348 | "==" -> Some EqualEqual
349 | "===" -> Some EqualEqualEqual
350 | "!=" -> Some ExclamationEqual
351 | "!==" -> Some ExclamationEqualEqual
352 | "^" -> Some Carat
353 | "|" -> Some Bar
354 | "&" -> Some Ampersand
355 | "&&" -> Some AmpersandAmpersand
356 | "||" -> Some BarBar
357 | "?" -> Some Question
358 | "??" -> Some QuestionQuestion
359 | ":" -> Some Colon
360 | ";" -> Some Semicolon
361 | "=" -> Some Equal
362 | "**=" -> Some StarStarEqual
363 | "*=" -> Some StarEqual
364 | "/=" -> Some SlashEqual
365 | "%=" -> Some PercentEqual
366 | "+=" -> Some PlusEqual
367 | "-=" -> Some MinusEqual
368 | ".=" -> Some DotEqual
369 | "<<=" -> Some LessThanLessThanEqual
370 | ">>=" -> Some GreaterThanGreaterThanEqual
371 | "&=" -> Some AmpersandEqual
372 | "^=" -> Some CaratEqual
373 | "|=" -> Some BarEqual
374 | "," -> Some Comma
375 | "@" -> Some At
376 | "::" -> Some ColonColon
377 | "=>" -> Some EqualGreaterThan
378 | "==>" -> Some EqualEqualGreaterThan
379 | "?->" -> Some QuestionMinusGreaterThan
380 | "..." -> Some DotDotDot
381 | "$$" -> Some DollarDollar
382 | "|>" -> Some BarGreaterThan
383 | "null" -> Some NullLiteral
384 | "/>" -> Some SlashGreaterThan
385 | "</" -> Some LessThanSlash
386 | "<?" -> Some LessThanQuestion
387 | "?>" -> Some QuestionGreaterThan
388 | _ -> None
390 let to_string kind =
391 match kind with
392 (* No text tokens *)
393 | EndOfFile -> "end_of_file"
394 (* Given text tokens *)
395 | Abstract -> "abstract"
396 | And -> "and"
397 | Array -> "array"
398 | Arraykey -> "arraykey"
399 | As -> "as"
400 | Async -> "async"
401 | Attribute -> "attribute"
402 | Await -> "await"
403 | Bool -> "bool"
404 | Break -> "break"
405 | Case -> "case"
406 | Catch -> "catch"
407 | Category -> "category"
408 | Children -> "children"
409 | Class -> "class"
410 | Classname -> "classname"
411 | Clone -> "clone"
412 | Const -> "const"
413 | Construct -> "__construct"
414 | Continue -> "continue"
415 | Coroutine -> "coroutine"
416 | Darray -> "darray"
417 | Default -> "default"
418 | Define -> "define"
419 | Destruct -> "__destruct"
420 | Dict -> "dict"
421 | Do -> "do"
422 | Double -> "double"
423 | Echo -> "echo"
424 | Else -> "else"
425 | Elseif -> "elseif"
426 | Empty -> "empty"
427 | Enum -> "enum"
428 | Eval -> "eval"
429 | Extends -> "extends"
430 | Fallthrough -> "fallthrough"
431 | Float -> "float"
432 | Final -> "final"
433 | Finally -> "finally"
434 | For -> "for"
435 | Foreach -> "foreach"
436 | Function -> "function"
437 | Global -> "global"
438 | Goto -> "goto"
439 | If -> "if"
440 | Implements -> "implements"
441 | Include -> "include"
442 | Include_once -> "include_once"
443 | Instanceof -> "instanceof"
444 | Insteadof -> "insteadof"
445 | Int -> "int"
446 | Interface -> "interface"
447 | Isset -> "isset"
448 | Keyset -> "keyset"
449 | List -> "list"
450 | Mixed -> "mixed"
451 | Namespace -> "namespace"
452 | New -> "new"
453 | Newtype -> "newtype"
454 | Noreturn -> "noreturn"
455 | Num -> "num"
456 | Object -> "object"
457 | Or -> "or"
458 | Parent -> "parent"
459 | Print -> "print"
460 | Private -> "private"
461 | Protected -> "protected"
462 | Public -> "public"
463 | Require -> "require"
464 | Require_once -> "require_once"
465 | Required -> "required"
466 | Resource -> "resource"
467 | Return -> "return"
468 | Self -> "self"
469 | Shape -> "shape"
470 | Static -> "static"
471 | String -> "string"
472 | Super -> "super"
473 | Suspend -> "suspend"
474 | Switch -> "switch"
475 | This -> "this"
476 | Throw -> "throw"
477 | Trait -> "trait"
478 | Try -> "try"
479 | Tuple -> "tuple"
480 | Type -> "type"
481 | Unset -> "unset"
482 | Use -> "use"
483 | Var -> "var"
484 | Varray -> "varray"
485 | Vec -> "vec"
486 | Void -> "void"
487 | Where -> "where"
488 | While -> "while"
489 | Xor -> "xor"
490 | Yield -> "yield"
491 | LeftBracket -> "["
492 | RightBracket -> "]"
493 | LeftParen -> "("
494 | RightParen -> ")"
495 | LeftBrace -> "{"
496 | RightBrace -> "}"
497 | Dot -> "."
498 | MinusGreaterThan -> "->"
499 | PlusPlus -> "++"
500 | MinusMinus -> "--"
501 | StarStar -> "**"
502 | Star -> "*"
503 | Plus -> "+"
504 | Minus -> "-"
505 | Tilde -> "~"
506 | Exclamation -> "!"
507 | Dollar -> "$"
508 | Slash -> "/"
509 | Percent -> "%"
510 | LessThanGreaterThan -> "<>"
511 | LessThanEqualGreaterThan -> "<=>"
512 | LessThanLessThan -> "<<"
513 | GreaterThanGreaterThan -> ">>"
514 | LessThan -> "<"
515 | GreaterThan -> ">"
516 | LessThanEqual -> "<="
517 | GreaterThanEqual -> ">="
518 | EqualEqual -> "=="
519 | EqualEqualEqual -> "==="
520 | ExclamationEqual -> "!="
521 | ExclamationEqualEqual -> "!=="
522 | Carat -> "^"
523 | Bar -> "|"
524 | Ampersand -> "&"
525 | AmpersandAmpersand -> "&&"
526 | BarBar -> "||"
527 | Question -> "?"
528 | QuestionQuestion -> "??"
529 | Colon -> ":"
530 | Semicolon -> ";"
531 | Equal -> "="
532 | StarStarEqual -> "**="
533 | StarEqual -> "*="
534 | SlashEqual -> "/="
535 | PercentEqual -> "%="
536 | PlusEqual -> "+="
537 | MinusEqual -> "-="
538 | DotEqual -> ".="
539 | LessThanLessThanEqual -> "<<="
540 | GreaterThanGreaterThanEqual -> ">>="
541 | AmpersandEqual -> "&="
542 | CaratEqual -> "^="
543 | BarEqual -> "|="
544 | Comma -> ","
545 | At -> "@"
546 | ColonColon -> "::"
547 | EqualGreaterThan -> "=>"
548 | EqualEqualGreaterThan -> "==>"
549 | QuestionMinusGreaterThan -> "?->"
550 | DotDotDot -> "..."
551 | DollarDollar -> "$$"
552 | BarGreaterThan -> "|>"
553 | NullLiteral -> "null"
554 | SlashGreaterThan -> "/>"
555 | LessThanSlash -> "</"
556 | LessThanQuestion -> "<?"
557 | QuestionGreaterThan -> "?>"
558 (* Variable text tokens *)
559 | ErrorToken -> "error_token"
560 | Name -> "name"
561 | QualifiedName -> "qualified_name"
562 | Variable -> "variable"
563 | NamespacePrefix -> "namespace_prefix"
564 | DecimalLiteral -> "decimal_literal"
565 | OctalLiteral -> "octal_literal"
566 | HexadecimalLiteral -> "hexadecimal_literal"
567 | BinaryLiteral -> "binary_literal"
568 | FloatingLiteral -> "floating_literal"
569 | ExecutionString -> "execution_string"
570 | SingleQuotedStringLiteral -> "single_quoted_string_literal"
571 | DoubleQuotedStringLiteral -> "double_quoted_string_literal"
572 | DoubleQuotedStringLiteralHead -> "double_quoted_string_literal_head"
573 | StringLiteralBody -> "string_literal_body"
574 | DoubleQuotedStringLiteralTail -> "double_quoted_string_literal_tail"
575 | HeredocStringLiteral -> "heredoc_string_literal"
576 | HeredocStringLiteralHead -> "heredoc_string_literal_head"
577 | HeredocStringLiteralTail -> "heredoc_string_literal_tail"
578 | NowdocStringLiteral -> "nowdoc_string_literal"
579 | BooleanLiteral -> "boolean_literal"
580 | XHPCategoryName -> "XHP_category_name"
581 | XHPElementName -> "XHP_element_name"
582 | XHPClassName -> "XHP_class_name"
583 | XHPStringLiteral -> "XHP_string_literal"
584 | XHPBody -> "XHP_body"
585 | XHPComment -> "XHP_comment"
586 | Markup -> "markup"