src/Luminous/Scanners/ScalaScanner.php
public function xmlOverride($matches)
    {
        // this might just be an inequality, so we first need to disambiguate
        // that

        // 1.5 - the disambiguation is pretty simple, an XML tag must
        // follow either whitespace, (, or {, and the '<' must be followed
        // by '[!?_a-zA-Z]
        // I'm not sure if a comment is a special case, or if it's treated as
        // whitespace...
        $xml = false;
        for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
            $tok = $this->tokens[$i];
            $name = $tok[0];
            // ... but we're going treat it as a no-op and skip over it
            if ($name === 'COMMENT') {
                continue;
            }
            $lastChar = $tok[1][strlen($tok[1]) - 1];
            if (!(ctype_space($lastChar) || $lastChar === '(' || $lastChar === '{')) {
                break;
            }
            if (!$this->check('/<[!?a-zA-Z0-9_]/')) {
                break;
            }
            $xml = true;
        }
        if (!$xml) {
            $this->record($matches[0], 'OPERATOR');
            $this->posShift(strlen($matches[0]));
            return;
        }
        $subscanner = new XmlScanner();
        $subscanner->string($this->string());
        $subscanner->pos($this->pos());
        $subscanner->xmlLiteral = true;
        $subscanner->init();
        $subscanner->main();
        $tagged = $subscanner->tagged();
        $this->record($tagged, 'XML', true);
        $this->pos($subscanner->pos());
    }
public function xmlOverride($matches)
    {
        // this might just be an inequality, so we first need to disambiguate
        // that

        // 1.5 - the disambiguation is pretty simple, an XML tag must
        // follow either whitespace, (, or {, and the '<' must be followed
        // by '[!?_a-zA-Z]
        // I'm not sure if a comment is a special case, or if it's treated as
        // whitespace...
        $xml = false;
        for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
            $tok = $this->tokens[$i];
            $name = $tok[0];
            // ... but we're going treat it as a no-op and skip over it
            if ($name === 'COMMENT') {
                continue;
            }
            $lastChar = $tok[1][strlen($tok[1]) - 1];
            if (!(ctype_space($lastChar) || $lastChar === '(' || $lastChar === '{')) {
                break;
            }
            if (!$this->check('/<[!?a-zA-Z0-9_]/')) {
                break;
            }
            $xml = true;
        }
        if (!$xml) {
            $this->record($matches[0], 'OPERATOR');
            $this->posShift(strlen($matches[0]));
            return;
        }
        $subscanner = new XmlScanner();
        $subscanner->string($this->string());
        $subscanner->pos($this->pos());
        $subscanner->xmlLiteral = true;
        $subscanner->init();
        $subscanner->main();
        $tagged = $subscanner->tagged();
        $this->record($tagged, 'XML', true);
        $this->pos($subscanner->pos());
    }
public function xmlOverride ( $ matches ) { // this might just be an inequality, so we first need to disambiguate // that // 1.5 - the disambiguation is pretty simple, an XML tag must // follow either whitespace, (, or {, and the '<' must be followed // by '[!?_a-zA-Z] // I'm not sure if a comment is a special case, or if it's treated as // whitespace... $ xml = false ; for ( $ i = count ( $ this -> tokens ) - 1 ; $ i >= 0 ; $ i -- ) { $ tok = $ this -> tokens [ $ i ] ; $ name = $ tok [ 0 ] ; // ... but we're going treat it as a no-op and skip over it if ( $ name === 'COMMENT' ) { continue ; } $ lastChar = $ tok [ 1 ] [ strlen ( $ tok [ 1 ] ) - 1 ] ; if ( ! ( ctype_space ( $ lastChar ) || $ lastChar === '(' || $ lastChar === '{' ) ) { break ; } if ( ! $ this -> check ( '/<[!?a-zA-Z0-9_]/' ) ) { break ; } $ xml = true ; } if ( ! $ xml ) { $ this -> record ( $ matches [ 0 ] , 'OPERATOR' ) ; $ this -> posShift ( strlen ( $ matches [ 0 ] ) ) ; return ; } $ subscanner = new XmlScanner ( ) ; $ subscanner -> string ( $ this -> string ( ) ) ; $ subscanner -> pos ( $ this -> pos ( ) ) ; $ subscanner -> xmlLiteral = true ; $ subscanner -> init ( ) ; $ subscanner -> main ( ) ; $ tagged = $ subscanner -> tagged ( ) ; $ this -> record ( $ tagged , 'XML' , true ) ; $ this -> pos ( $ subscanner -> pos ( ) ) ; }
Scala has XML literals.
Scala has XML literals .