1#![doc = include_str!("readme.md")]
2use oak_core::{Language, LanguageCategory};
3
4pub type TypedRoot = crate::ast::PhpRoot;
6
7#[derive(Debug, Clone, PartialEq, Eq, Hash)]
11#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12pub struct PhpLanguage {
13 pub tag_start: String,
15 pub tag_end: String,
17 pub short_tag_start: String,
19 pub echo_tag_start: String,
21}
22
23impl Default for PhpLanguage {
24 fn default() -> Self {
25 Self { tag_start: "<?php".to_string(), tag_end: "?>".to_string(), short_tag_start: "<?".to_string(), echo_tag_start: "<?=".to_string() }
26 }
27}
28
29impl PhpLanguage {
30 pub fn new() -> Self {
32 Self::default()
33 }
34}
35
36impl Language for PhpLanguage {
37 const NAME: &'static str = "php";
38 const CATEGORY: LanguageCategory = LanguageCategory::Programming;
39
40 type TokenType = crate::lexer::token_type::PhpTokenType;
41 type ElementType = crate::parser::element_type::PhpElementType;
42 type TypedRoot = crate::ast::PhpRoot;
43}