#![doc = include_str!("readme.md")]
use oak_core::{Language, LanguageCategory};
pub type TypedRoot = crate::ast::PhpRoot;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct PhpLanguage {
pub tag_start: String,
pub tag_end: String,
pub short_tag_start: String,
pub echo_tag_start: String,
}
impl Default for PhpLanguage {
fn default() -> Self {
Self { tag_start: "<?php".to_string(), tag_end: "?>".to_string(), short_tag_start: "<?".to_string(), echo_tag_start: "<?=".to_string() }
}
}
impl PhpLanguage {
pub fn new() -> Self {
Self::default()
}
}
impl Language for PhpLanguage {
const NAME: &'static str = "php";
const CATEGORY: LanguageCategory = LanguageCategory::Programming;
type TokenType = crate::lexer::token_type::PhpTokenType;
type ElementType = crate::parser::element_type::PhpElementType;
type TypedRoot = crate::ast::PhpRoot;
}