Wikini

ColorationSyntaxiqueOz

PagePrincipale :: DerniersChangements :: DerniersCommentaires :: ParametresUtilisateur :: Vous êtes ec2-3-145-119-199.us-east-2.compute.amazonaws.com
Nom de la contribution : ColorationSyntaxiqueOz
Description : Coloration syntaxique du langage de programmation Oz.
Type de contribution : coloration syntaxique
Fonctionne avec : WikiNi 0.4.3
Intégration technique : placer le fichier coloration_oz.php dans le répertoire formatters/
Mainteneur : LordFarquaad
Licence : GPL
Dernière version : 0.1.0
Dernière livraison : 27/12/2004
Accès au code et mise en oeuvre : ColorationSyntaxiqueOz
Démonstration : http://fsa.notredomaine.org/wiki/TestColorationOz
Intégration au projet WikiNi :
Bugs: signaler ici les bugs

Description détaillée:
Cette coloration utilise le classe Hightlighter de WikiNi et essaie d'imiter la coloration de Mozart:
Ce qu'elle ne fait pas:
Cela ne me paraît pas possible avec la classe Hightlighter

Telechargement: http://contributions-wikini.notredomaine.org/ColorationSyntaxiqueOz-v.0.1.0-20041227.zip
Code source:
<?php
/*
colration_oz.php : coloration syntaxique de l'oz pour WikiNi

Copyright 2004  Didier Loiseau
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

if (!defined('WIKINI_VERSION'))
    die (
'accès direct interdit');

include_once(
'formatters/hightlighter.class.inc');

$oz = new Hightlighter();
$oz->isCaseSensitiv true;

$oz->commentLine[] = "(\\%.*(\n|$))";
$oz->commentStyle 'color: #b22222;';

$oz->string[] = "('(.*[^\\\\])?(\\\\\\\\)*')";
$oz->string[] = '("(.*[^\\\\])?(\\\\\\\\)*")';
$oz->stringStyle 'color: #bc8f8f;';

$oz->keywords['Commands']['words'] = array(
    
'andthen',
    
'attr',
    
'at',
    
'case',
    
'class',
    
'declare',
    
'define',
    
'div',
    
'do',
    
'else',
    
'elseif',
    
'end',
    
'export',
    
'for',
    
'from',
    
'fun',
    
'functor',
    
'if',
    
'import',
    
'in',
    
'local',
    
'meth',
    
'mod',
    
'of',
    
'orelse',
    
'proc',
    
'then',
    
'thread'
);
$oz->keywords['Commands']['style'] = 'color: #a020f0;';

$oz->symboles = array('==''-''+''*''/''=<''>=''<=''\=''<''>''=''~''|''@'':=''[]''#''.''?''!' );
$oz->symbolesStyle 'color: #a020f0;';

$oz->identifier = array('([A_Z][[:alnum:]]+|\$)');
$oz->identStyle '';

echo 
'<pre>' $oz->Analyse($text) . '</pre>';
unset(
$oz);
?>

Il n'y a pas de commentaire sur cette page. [Afficher commentaires/formulaire]