Lines Matching refs:language

50 /** The language file directory for GeSHi
121 // When strict mode applies for a language
130 // Advanced regexp handling constants, used in language files
148 /** Used in language files to mark comments */
203 /** The language specified does not exist */
205 /** GeSHi could not open a file for reading (generally a language file) */
235 * The language to use when highlighting
238 protected $language = '';
241 * The data for the language used
247 * The path to the language files
264 GESHI_ERROR_NO_SUCH_LANG => 'GeSHi could not find the language {LANGUAGE} (using path {PATH})',
477 * Should we use language-defined tab stop widths?
502 * Currently loaded language file
547 * Creates a new GeSHi object, with source and language
550 * @param string $language The language to highlight the source with
551 * @param string $path The path to the language file directory. <b>This
555 * renamed the language directory however, you will
560 public function __construct($source = '', $language = '', $path = '') {
564 if ( is_string($language) && ($language !== '') ) {
565 $this->set_language($language);
592 '{LANGUAGE}' => $this->language,
606 * Gets a human-readable language name (thanks to Simon Patterson
609 * @return string The name for the current language
631 * Clean up the language name to prevent malicious code injection
633 * @param string $language The name of the language to strip
636 public function strip_language_name($language) {
637 $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
638 $language = strtolower($language);
640 return $language;
644 * Sets the language for this object
646 * @note since 1.0.8 this function won't reset language-settings by default anymore!
649 * @param string $language The name of the language to use
653 public function set_language($language, $force_reset = false) {
661 //Clean up the language name to prevent malicious code injection
662 $language = $this->strip_language_name($language);
665 $file_name = $this->language_path . $language . '.php';
667 // this language is already loaded!
671 $this->language = $language;
679 // Load the language for parsing
684 * Sets the path to the directory containing the language files. Note
688 * @param string $path The path to the language directory
690 * @deprecated The path to the language files should now be automatically
720 $this->set_language($this->language); // otherwise set_language_path has no effect
777 * @param string $language short langname (html4strict for example)
780 public function get_language_fullname($language)
782 //Clean up the language name to prevent malicious code injection
783 $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
785 $language = strtolower($language);
788 $fullpath = $this->language_path.$language.'.php';
792 $this->error = sprintf('Geshi::get_lang_fullname() Unknown Language: %s', $language);
798 $this->error = sprintf('Geshi::get_lang_fullname(%s): Regex can not detect language', $language);
1254 * appropriate "object splitter" - see the language file for the language
1361 * Sets whether or not to use tab-stop width specifed by language
1363 * @param boolean $use Whether to use language-specific tab-stop widths
1371 * Returns the tab width to use, based on the current language and user
1438 * Given a file extension, this method returns either a valid geshi language
1441 * @param string $extension The extension to get a language name for
1540 * to set the language automatically. An optional lookup table can be
1541 * passed for looking up the language name. If not specified a default
1544 * The language table is in the form
1593 * for the current language, you have to manually call @see GeSHi->optimize_keyword_group()
2355 // if we have a "maybe" strict language, this should be handled as highlightable code
3257 // New system: get keyword from language file to get correct case
3408 // get highlighted if the language has a CSS keyword in it (like CSS, for example ;))
3723 * Gets language information and stores it for later use
3725 * @param string $file_name The filename of the language file you want to load
3735 //Prepare some stuff before actually loading the language file
3741 //Load the language file
3745 // $language data is a valid thing but maybe not
3812 //Apply the new styles to our current language styles
4077 $attributes = ' class="' . $this->_genCSSName($this->language);
4338 * @return string A stylesheet built on the data for the current language
4342 // If there's an error, chances are that the language file
4343 // won't have populated the language data file, so we can't
4361 $selector = '.' . $this->_genCSSName($this->language);
4373 " * Dynamically generated stylesheet for {$this->language}\n".
4736 * @param string $language The language to highlight the code in
4737 * @param string $path The path to the language files. You can leave this blank if you need
4743 function geshi_highlight($string, $language, $path = null, $return = false) {
4744 $geshi = new GeSHi($string, $language, $path);