diff options
39 files changed, 2861 insertions, 417 deletions
@@ -156,6 +156,7 @@ Other contributors, listed alphabetically, are: * Corey Richardson -- Rust lexer updates * Lubomir Rintel -- GoodData MAQL and CL lexers * Andre Roberge -- Tango style +* Michiel Roos -- TypoScript lexer * Konrad Rudolph -- LaTeX formatter enhancements * Mario Ruggier -- Evoque lexers * Miikka Salminen -- Lovelace style, Hexdump lexer, lexer enhancements @@ -186,6 +187,7 @@ Other contributors, listed alphabetically, are: * Abe Voelker -- OpenEdge ABL lexer * Pepijn de Vos -- HTML formatter CTags support * Matthias Vallentin -- Bro lexer +* BenoƮt Vinot -- AMPL lexer * Linh Vu Hong -- RSL lexer * Nathan Weizenbaum -- Haml and Sass lexers * Nathan Whetsell -- Csound lexers @@ -7,6 +7,31 @@ pull request numbers to the requests at <https://bitbucket.org/birkenfeld/pygments-main/pull-requests/merged>. +Version 2.2 +----------- +(in development) + +- Added lexers: + + * AMPL + * TypoScript (#1173) + +- Added `lexers.find_lexer_class_by_name()` (#1203) + + +Version 2.1.1 +------------- +(in development) + +- Fixed Jython compatibility (#1205) +- Fixed HTML formatter output with leading empty lines (#1111) +- Added a mapping table for LaTeX encodings and added utf8 (#1152) +- Fixed image formatter font searching on Macs (#1188) +- Fixed deepcopy-ing of Token instances (#1168) +- Fixed Julia string interpolation (#1170) +- Many smaller fixes to various lexers + + Version 2.1 ----------- (released Jan 17, 2016) diff --git a/doc/docs/api.rst b/doc/docs/api.rst index 123a4643..dd831bd1 100644 --- a/doc/docs/api.rst +++ b/doc/docs/api.rst @@ -89,6 +89,21 @@ Functions from :mod:`pygments.lexers`: .. versionadded:: 0.6 +.. function:: find_lexer_class_by_name(alias) + + Return the `Lexer` subclass that has `alias` in its aliases list, without + instantiating it. + + Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is + found. + + .. versionadded:: 2.2 + +.. function:: find_lexer_class(name) + + Return the `Lexer` subclass that with the *name* attribute as given by + the *name* argument. + .. module:: pygments.formatters diff --git a/doc/docs/integrate.rst b/doc/docs/integrate.rst index 73e02acd..77daaa43 100644 --- a/doc/docs/integrate.rst +++ b/doc/docs/integrate.rst @@ -27,3 +27,14 @@ Bash completion The source distribution contains a file ``external/pygments.bashcomp`` that sets up completion for the ``pygmentize`` command in bash. + +Wrappers for other languages +---------------------------- + +These libraries provide Pygments highlighting for users of other languages +than Python: + +* `pygments.rb <https://github.com/tmm1/pygments.rb>`_, a pygments wrapper for Ruby +* `Clygments <https://github.com/bfontaine/clygments>`_, a pygments wrapper for + Clojure +* `PHPygments <https://github.com/capynet/PHPygments>`_, a pygments wrapper for PHP diff --git a/doc/faq.rst b/doc/faq.rst index 476a0102..f375828b 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -90,28 +90,23 @@ Who uses Pygments? This is an (incomplete) list of projects and sites known to use the Pygments highlighter. * `Wikipedia <http://en.wikipedia.org>`_ -* `Pygments API <http://pygments.appspot.com/>`_, a HTTP POST interface to Pygments +* `BitBucket <http://bitbucket.org/>`_, a Mercurial and Git hosting site * `The Sphinx documentation builder <http://sphinx.pocoo.org/>`_, for embedded source examples * `rst2pdf <http://code.google.com/p/rst2pdf/>`_, a reStructuredText to PDF converter -* `Zine <http://zine.pocoo.org/>`_, a Python blogging system +* `Codecov <http://codecov.io/>`_, a code coverage CI service * `Trac <http://trac.edgewall.org/>`_, the universal project management tool -* `Bruce <http://r1chardj0n3s.googlepages.com/bruce>`_, a reStructuredText presentation tool * `AsciiDoc <http://www.methods.co.nz/asciidoc/>`_, a text-based documentation generator * `ActiveState Code <http://code.activestate.com/>`_, the Python Cookbook successor * `ViewVC <http://viewvc.org/>`_, a web-based version control repository browser * `BzrFruit <http://repo.or.cz/w/bzrfruit.git>`_, a Bazaar branch viewer * `QBzr <http://bazaar-vcs.org/QBzr>`_, a cross-platform Qt-based GUI front end for Bazaar -* `BitBucket <http://bitbucket.org/>`_, a Mercurial and Git hosting site * `Review Board <http://www.review-board.org/>`_, a collaborative code reviewing tool -* `skeletonz <http://orangoo.com/skeletonz/>`_, a Python powered content management system * `Diamanda <http://code.google.com/p/diamanda/>`_, a Django powered wiki system with support for Pygments * `Progopedia <http://progopedia.ru/>`_ (`English <http://progopedia.com/>`_), an encyclopedia of programming languages -* `Postmarkup <http://code.google.com/p/postmarkup/>`_, a BBCode to XHTML generator -* `Language Comparison <http://michaelsilver.us/lc>`_, a site that compares different programming languages -* `BPython <http://www.noiseforfree.com/bpython/>`_, a curses-based intelligent Python shell -* `Challenge-You! <http://challenge-you.appspot.com/>`_, a site offering programming challenges +* `Bruce <http://r1chardj0n3s.googlepages.com/bruce>`_, a reStructuredText presentation tool * `PIDA <http://pida.co.uk/>`_, a universal IDE written in Python +* `BPython <http://www.noiseforfree.com/bpython/>`_, a curses-based intelligent Python shell * `PuDB <http://pypi.python.org/pypi/pudb>`_, a console Python debugger * `XWiki <http://www.xwiki.org/>`_, a wiki-based development framework in Java, using Jython * `roux <http://ananelson.com/software/roux/>`_, a script for running R scripts @@ -119,23 +114,25 @@ This is an (incomplete) list of projects and sites known to use the Pygments hig * `hurl <http://hurl.it/>`_, a web service for making HTTP requests * `wxHTMLPygmentizer <http://colinbarnette.net/projects/wxHTMLPygmentizer>`_ is a GUI utility, used to make code-colorization easier -* `WpPygments <http://blog.mirotin.net/?page_id=49>`_, a highlighter plugin for WordPress -* `LodgeIt <http://paste.pocoo.org/>`_, a pastebin with XMLRPC support and diffs -* `SpammCan <http://chrisarndt.de/projects/spammcan/>`_, a pastebin (demo see - `here <http://paste.chrisarndt.de/>`_) -* `WowAce.com pastes <http://www.wowace.com/paste/>`_, a pastebin +* `Postmarkup <http://code.google.com/p/postmarkup/>`_, a BBCode to XHTML generator +* `WpPygments <http://blog.mirotin.net/?page_id=49>`_, and `WPygments + <https://github.com/capynet/WPygments>`_, highlighter plugins for WordPress * `Siafoo <http://siafoo.net>`_, a tool for sharing and storing useful code and programming experience * `D source <http://www.dsource.org/>`_, a community for the D programming language -* `dumpz.org <http://dumpz.org/>`_, a pastebin * `dpaste.com <http://dpaste.com/>`_, another Django pastebin -* `PylonsHQ Pasties <http://pylonshq.com/pasties/new>`_, a pastebin * `Django snippets <http://www.djangosnippets.org/>`_, a pastebin for Django code * `Fayaa <http://www.fayaa.com/code/>`_, a Chinese pastebin * `Incollo.com <http://incollo.com>`_, a free collaborative debugging tool * `PasteBox <http://p.boxnet.eu/>`_, a pastebin focused on privacy -* `xinotes.org <http://www.xinotes.org/>`_, a site to share notes, code snippets etc. * `hilite.me <http://www.hilite.me/>`_, a site to highlight code snippets * `patx.me <http://patx.me/paste>`_, a pastebin +* `Fluidic <https://github.com/richsmith/fluidic>`_, an experiment in + integrating shells with a GUI +* `pygments.rb <https://github.com/tmm1/pygments.rb>`_, a pygments wrapper for Ruby +* `Clygments <https://github.com/bfontaine/clygments>`_, a pygments wrapper for + Clojure +* `PHPygments <https://github.com/capynet/PHPygments>`_, a pygments wrapper for PHP + If you have a project or web site using Pygments, drop me a line, and I'll add a link here. diff --git a/pygments/formatters/_mapping.py b/pygments/formatters/_mapping.py index 569ae849..01d053dd 100755 --- a/pygments/formatters/_mapping.py +++ b/pygments/formatters/_mapping.py @@ -77,7 +77,7 @@ if __name__ == '__main__': # pragma: no cover footer = content[content.find("if __name__ == '__main__':"):] # write new file - with open(__file__, 'wb') as fp: + with open(__file__, 'w') as fp: fp.write(header) fp.write('FORMATTERS = {\n %s\n}\n\n' % ',\n '.join(found_formatters)) fp.write(footer) diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py index a0087515..2c6bb19e 100644 --- a/pygments/formatters/html.py +++ b/pygments/formatters/html.py @@ -702,7 +702,9 @@ class HtmlFormatter(Formatter): if self.filename: yield 0, ('<span class="filename">' + self.filename + '</span>') - yield 0, ('<pre' + (style and ' style="%s"' % style) + '>') + # the empty span here is to keep leading empty lines from being + # ignored by HTML parsers + yield 0, ('<pre' + (style and ' style="%s"' % style) + '><span></span>') for tup in inner: yield tup yield 0, '</pre>' diff --git a/pygments/formatters/img.py b/pygments/formatters/img.py index a7b5d51e..c7b8e819 100644 --- a/pygments/formatters/img.py +++ b/pygments/formatters/img.py @@ -82,9 +82,13 @@ class FontManager(object): stdout, _ = proc.communicate() if proc.returncode == 0: lines = stdout.splitlines() - if lines: - path = lines[0].decode().strip().strip(':') - return path + for line in lines: + if line.startswith('Fontconfig warning:'): + continue + path = line.decode().strip().strip(':') + if path: + return path + return None def _create_nix(self): for name in STYLES['NORMAL']: diff --git a/pygments/formatters/latex.py b/pygments/formatters/latex.py index 15e68e37..66d521f5 100644 --- a/pygments/formatters/latex.py +++ b/pygments/formatters/latex.py @@ -413,11 +413,18 @@ class LatexFormatter(Formatter): outfile.write(u'\\end{' + self.envname + u'}\n') if self.full: + encoding = self.encoding or 'utf8' + # map known existings encodings from LaTeX distribution + encoding = { + 'utf_8': 'utf8', + 'latin_1': 'latin1', + 'iso_8859_1': 'latin1', + }.get(encoding.replace('-', '_'), encoding) realoutfile.write(DOC_TEMPLATE % dict(docclass = self.docclass, preamble = self.preamble, title = self.title, - encoding = self.encoding or 'utf8', + encoding = encoding, styledefs = self.get_style_defs(), code = outfile.getvalue())) diff --git a/pygments/lexers/__init__.py b/pygments/lexers/__init__.py index 7d0b89d4..d64f163f 100644 --- a/pygments/lexers/__init__.py +++ b/pygments/lexers/__init__.py @@ -72,6 +72,28 @@ def find_lexer_class(name): return cls +def find_lexer_class_by_name(alias): + """Lookup a lexer class by alias. + + Like `get_lexer_by_name`, but does not instantiate the class. + + .. versionadded:: 2.2 + """ + if not _alias: + raise ClassNotFound('no lexer for alias %r found' % _alias) + # lookup builtin lexers + for module_name, name, aliases, _, _ in itervalues(LEXERS): + if _alias.lower() in aliases: + if name not in _lexer_cache: + _load_lexers(module_name) + return _lexer_cache[name] + # continue with lexers from setuptools entrypoints + for cls in find_plugin_lexers(): + if _alias.lower() in cls.aliases: + return cls + raise ClassNotFound('no lexer for alias %r found' % _alias) + + def get_lexer_by_name(_alias, **options): """Get a lexer by an alias. diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index f86c47c4..d10f2b6a 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -26,6 +26,7 @@ LEXERS = { 'AgdaLexer': ('pygments.lexers.haskell', 'Agda', ('agda',), ('*.agda',), ('text/x-agda',)), 'AlloyLexer': ('pygments.lexers.dsls', 'Alloy', ('alloy',), ('*.als',), ('text/x-alloy',)), 'AmbientTalkLexer': ('pygments.lexers.ambient', 'AmbientTalk', ('at', 'ambienttalk', 'ambienttalk/2'), ('*.at',), ('text/x-ambienttalk',)), + 'AmplLexer': ('pygments.lexers.ampl', 'Ampl', ('ampl',), ('*.run',), ()), 'AntlrActionScriptLexer': ('pygments.lexers.parsers', 'ANTLR With ActionScript Target', ('antlr-as', 'antlr-actionscript'), ('*.G', '*.g'), ()), 'AntlrCSharpLexer': ('pygments.lexers.parsers', 'ANTLR With C# Target', ('antlr-csharp', 'antlr-c#'), ('*.G', '*.g'), ()), 'AntlrCppLexer': ('pygments.lexers.parsers', 'ANTLR With CPP Target', ('antlr-cpp',), ('*.G', '*.g'), ()), @@ -46,7 +47,7 @@ LEXERS = { 'BBCodeLexer': ('pygments.lexers.markup', 'BBCode', ('bbcode',), (), ('text/x-bbcode',)), 'BCLexer': ('pygments.lexers.algebra', 'BC', ('bc',), ('*.bc',), ()), 'BaseMakefileLexer': ('pygments.lexers.make', 'Base Makefile', ('basemake',), (), ()), - 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'shell'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript')), + 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'shell'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '*.exheres-0', '*.exlib', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript')), 'BashSessionLexer': ('pygments.lexers.shell', 'Bash Session', ('console', 'shell-session'), ('*.sh-session', '*.shell-session'), ('application/x-shell-session', 'application/x-sh-session')), 'BatchLexer': ('pygments.lexers.shell', 'Batchfile', ('bat', 'batch', 'dosbatch', 'winbatch'), ('*.bat', '*.cmd'), ('application/x-dos-batch',)), 'BefungeLexer': ('pygments.lexers.esoteric', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)), @@ -391,6 +392,9 @@ LEXERS = { 'TwigHtmlLexer': ('pygments.lexers.templates', 'HTML+Twig', ('html+twig',), ('*.twig',), ('text/html+twig',)), 'TwigLexer': ('pygments.lexers.templates', 'Twig', ('twig',), (), ('application/x-twig',)), 'TypeScriptLexer': ('pygments.lexers.javascript', 'TypeScript', ('ts', 'typescript'), ('*.ts',), ('text/x-typescript',)), + 'TypoScriptCssDataLexer': ('pygments.lexers.typoscript', 'TypoScriptCssData', ('typoscriptcssdata',), (), ()), + 'TypoScriptHtmlDataLexer': ('pygments.lexers.typoscript', 'TypoScriptHtmlData', ('typoscripthtmldata',), (), ()), + 'TypoScriptLexer': ('pygments.lexers.typoscript', 'TypoScript', ('typoscript',), ('*.ts', '*.txt'), ('text/x-typoscript',)), 'UrbiscriptLexer': ('pygments.lexers.urbi', 'UrbiScript', ('urbiscript',), ('*.u',), ('application/x-urbiscript',)), 'VCTreeStatusLexer': ('pygments.lexers.console', 'VCTreeStatus', ('vctreestatus',), (), ()), 'VGLLexer': ('pygments.lexers.dsls', 'VGL', ('vgl',), ('*.rpf',), ()), @@ -458,7 +462,7 @@ if __name__ == '__main__': # pragma: no cover footer = content[content.find("if __name__ == '__main__':"):] # write new file - with open(__file__, 'wb') as fp: + with open(__file__, 'w') as fp: fp.write(header) fp.write('LEXERS = {\n %s,\n}\n\n' % ',\n '.join(found_lexers)) fp.write(footer) diff --git a/pygments/lexers/ampl.py b/pygments/lexers/ampl.py new file mode 100644 index 00000000..f57b486f --- /dev/null +++ b/pygments/lexers/ampl.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.ampl + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for the ampl language. <http://ampl.com/> + + :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, bygroups, using, this +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation + + +__all__ = ['AmplLexer'] + + +class AmplLexer(RegexLexer): + """ + For AMPL source code. + + .. versionadded:: 2.2 + """ + name = 'Ampl' + aliases = ['ampl'] + filenames = ['*.run'] + + tokens = { + 'root':[ + (r'\n', Text), + (r'\s+', Text.Whitespace), + (r'#.*?\n', Comment.Single), + (r'/[*](.|\n)*?[*]/', Comment.Multiline), + (r'(call|cd|close|commands|data|delete|display|drop|end|environ|' + r'exit|expand|include|load|model|objective|option|problem|purge|' + r'quit|redeclare|reload|remove|reset|restore|shell|show|solexpand|' + r'solution|solve|update|unload|xref|' + r'coeff|coef|cover|obj|interval|' + r'default|from|to|to_come|net_in|net_out|dimen|dimension|' + r'check|complements|write|end|function|pipe|' + r'format|if|then|else|in|while|repeat|for)\b', Keyword.Reserved), + (r'(integer|binary|symbolic|ordered|circular|reversed|IN|INOUT|OUT|LOCAL)', + Keyword.Type), + (r'\".*?\"', String.Double), + (r'\'.*?\'', String.Single), + (r'[()\[\]{},;:]+', Punctuation), + (r'\b(\w+)(\.)(astatus|init|init0|lb|lb0|lb1|lb2|lrc|' + r'lslack|rc|relax|slack|sstatus|status|ub|ub0|ub1|' + r'ub2|urc|uslack|val)', + bygroups(Name.Variable, Punctuation, Keyword.Reserved)), + (r'(set|param|var|arc|minimize|maximize|subject to|s\.t\.|subj to|' + r'node|table|suffix|read table|write table)(\s+)(\w+)', + bygroups(Keyword.Declaration, Text, Name.Variable)), + (r'(param)(\s*)(:)(\s*)(\w+)(\s*)(:)(\s*)((\w|\s)+)', + bygroups(Keyword.Declaration, Text, Punctuation, Text, + Name.Variable, Text, Punctuation, Text, Name.Variable)), + (r'(let|fix|unfix)(\s*)(\{.*\}|)(\s*)(\w+)', + bygroups(Keyword.Declaration, Text, using(this), Text, Name.Variable)), + (r'\b(abs|acos|acosh|alias|' + r'asin|asinh|atan|atan2|atanh|ceil|ctime|cos|exp|floor|log|log10|' + r'max|min|precision|round|sin|sinh|sqrt|tan|tanh|time|trunc|Beta|' + r'Cauchy|Exponential|Gamma|Irand224|Normal|Normal01|Poisson|Uniform|Uniform01|' + r'num|num0|ichar|char|length|substr|sprintf|match|sub|gsub|print|printf' + r'next|nextw|prev|prevw|first|last|ord|ord0|card|arity|indexarity)\b', + Name.Builtin), + (r'(\+|\-|\*|/|\*\*|=|<=|>=|==|\||\^|<|>|\!|\.\.|:=|\&|\!=|<<|>>)', + Operator), + (r'(or|exists|forall|and|in|not|within|union|diff|' + r'difference|symdiff|inter|intersect|intersection|' + r'cross|setof|by|less|sum|prod|product|div|mod)', + Keyword.Reserved), #Operator.Name but not enough emphasized with Operator.Name + (r'(\d+\.(?!\.)\d*|\.(?!.)\d+)([eE][+-]?\d+)?', Number.Float), + (r'\d+([eE][+-]?\d+)?', Number.Integer), + (r'[+-]?Infinity', Number.Integer), + (r'(\w+|(\.(?!\.)))', Text) + ] + + } diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py index 5a7137ea..5c724d03 100644 --- a/pygments/lexers/c_cpp.py +++ b/pygments/lexers/c_cpp.py @@ -216,6 +216,8 @@ class CppLexer(CFamilyLexer): 'final'), suffix=r'\b'), Keyword), (r'char(16_t|32_t)\b', Keyword.Type), (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'), + # C++11 raw strings + (r'R"\(', String, 'rawstring'), inherit, ], 'root': [ @@ -232,10 +234,15 @@ class CppLexer(CFamilyLexer): # template specification (r'\s*(?=>)', Text, '#pop'), ], + 'rawstring': [ + (r'\)"', String, '#pop'), + (r'[^)]+', String), + (r'\)', String), + ], } def analyse_text(text): - if re.search('#include <[a-z]+>', text): + if re.search('#include <[a-z_]+>', text): return 0.2 if re.search('using namespace ', text): return 0.4 diff --git a/pygments/lexers/c_like.py b/pygments/lexers/c_like.py index d894818d..f4a9c299 100644 --- a/pygments/lexers/c_like.py +++ b/pygments/lexers/c_like.py @@ -427,115 +427,115 @@ class ArduinoLexer(CppLexer): filenames = ['*.ino'] mimetypes = ['text/x-arduino'] - # Language constants - constants = set(('DIGITAL_MESSAGE', 'FIRMATA_STRING', 'ANALOG_MESSAGE', - 'REPORT_DIGITAL', 'REPORT_ANALOG', 'INPUT_PULLUP', - 'SET_PIN_MODE', 'INTERNAL2V56', 'SYSTEM_RESET', 'LED_BUILTIN', - 'INTERNAL1V1', 'SYSEX_START', 'INTERNAL', 'EXTERNAL', - 'DEFAULT', 'OUTPUT', 'INPUT', 'HIGH', 'LOW')) - # Language sketch main structure functions structure = set(('setup', 'loop')) - # Language variable types - storage = set(('boolean', 'const', 'byte', 'word', 'string', 'String', 'array')) + # Language operators + operators = set(('not', 'or', 'and', 'xor')) + + # Language 'variables' + variables = set(( + 'DIGITAL_MESSAGE', 'FIRMATA_STRING', 'ANALOG_MESSAGE', 'REPORT_DIGITAL', + 'REPORT_ANALOG', 'INPUT_PULLUP', 'SET_PIN_MODE', 'INTERNAL2V56', 'SYSTEM_RESET', + 'LED_BUILTIN', 'INTERNAL1V1', 'SYSEX_START', 'INTERNAL', 'EXTERNAL', 'HIGH', + 'LOW', 'INPUT', 'OUTPUT', 'INPUT_PULLUP', 'LED_BUILTIN', 'true', 'false', + 'void', 'boolean', 'char', 'unsigned char', 'byte', 'int', 'unsigned int', + 'word', 'long', 'unsigned long', 'short', 'float', 'double', 'string', 'String', + 'array', 'static', 'volatile', 'const', 'boolean', 'byte', 'word', 'string', + 'String', 'array', 'int', 'float', 'private', 'char', 'virtual', 'operator', + 'sizeof', 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', 'int8_t', 'int16_t', + 'int32_t', 'int64_t', 'dynamic_cast', 'typedef', 'const_cast', 'const', + 'struct', 'static_cast', 'union', 'unsigned', 'long', 'volatile', 'static', + 'protected', 'bool', 'public', 'friend', 'auto', 'void', 'enum', 'extern', + 'class', 'short', 'reinterpret_cast', 'double', 'register', 'explicit', + 'signed', 'inline', 'delete', '_Bool', 'complex', '_Complex', '_Imaginary', + 'atomic_bool', 'atomic_char', 'atomic_schar', 'atomic_uchar', 'atomic_short', + 'atomic_ushort', 'atomic_int', 'atomic_uint', 'atomic_long', 'atomic_ulong', + 'atomic_llong', 'atomic_ullong', 'PROGMEM')) # Language shipped functions and class ( ) - functions = set(('KeyboardController', 'MouseController', 'SoftwareSerial', - 'EthernetServer', 'EthernetClient', 'LiquidCrystal', - 'RobotControl', 'GSMVoiceCall', 'EthernetUDP', 'EsploraTFT', - 'HttpClient', 'RobotMotor', 'WiFiClient', 'GSMScanner', - 'FileSystem', 'Scheduler', 'GSMServer', 'YunClient', 'YunServer', - 'IPAddress', 'GSMClient', 'GSMModem', 'Keyboard', 'Ethernet', - 'Console', 'GSMBand', 'Esplora', 'Stepper', 'Process', - 'WiFiUDP', 'GSM_SMS', 'Mailbox', 'USBHost', 'Firmata', 'PImage', - 'Client', 'Server', 'GSMPIN', 'FileIO', 'Bridge', 'Serial', - 'EEPROM', 'Stream', 'Mouse', 'Audio', 'Servo', 'File', 'Task', - 'GPRS', 'WiFi', 'Wire', 'TFT', 'GSM', 'SPI', 'SD', - 'runShellCommandAsynchronously', 'analogWriteResolution', - 'retrieveCallingNumber', 'printFirmwareVersion', - 'analogReadResolution', 'sendDigitalPortPair', - 'noListenOnLocalhost', 'readJoystickButton', 'setFirmwareVersion', - 'readJoystickSwitch', 'scrollDisplayRight', 'getVoiceCallStatus', - 'scrollDisplayLeft', 'writeMicroseconds', 'delayMicroseconds', - 'beginTransmission', 'getSignalStrength', 'runAsynchronously', - 'getAsynchronously', 'listenOnLocalhost', 'getCurrentCarrier', - 'readAccelerometer', 'messageAvailable', 'sendDigitalPorts', - 'lineFollowConfig', 'countryNameWrite', 'runShellCommand', - 'readStringUntil', 'rewindDirectory', 'readTemperature', - 'setClockDivider', 'readLightSensor', 'endTransmission', - 'analogReference', 'detachInterrupt', 'countryNameRead', - 'attachInterrupt', 'encryptionType', 'readBytesUntil', - 'robotNameWrite', 'readMicrophone', 'robotNameRead', 'cityNameWrite', - 'userNameWrite', 'readJoystickY', 'readJoystickX', 'mouseReleased', - 'openNextFile', 'scanNetworks', 'noInterrupts', 'digitalWrite', - 'beginSpeaker', 'mousePressed', 'isActionDone', 'mouseDragged', - 'displayLogos', 'noAutoscroll', 'addParameter', 'remoteNumber', - 'getModifiers', 'keyboardRead', 'userNameRead', 'waitContinue', - 'processInput', 'parseCommand', 'printVersion', 'readNetworks', - 'writeMessage', 'blinkVersion', 'cityNameRead', 'readMessage', - 'setDataMode', 'parsePacket', 'isListening', 'setBitOrder', - 'beginPacket', 'isDirectory', 'motorsWrite', 'drawCompass', - 'digitalRead', 'clearScreen', 'serialEvent', 'rightToLeft', - 'setTextSize', 'leftToRight', 'requestFrom', 'keyReleased', - 'compassRead', 'analogWrite', 'interrupts', 'WiFiServer', - 'disconnect', 'playMelody', 'parseFloat', 'autoscroll', - 'getPINUsed', 'setPINUsed', 'setTimeout', 'sendAnalog', - 'readSlider', 'analogRead', 'beginWrite', 'createChar', - 'motorsStop', 'keyPressed', 'tempoWrite', 'readButton', - 'subnetMask', 'debugPrint', 'macAddress', 'writeGreen', - 'randomSeed', 'attachGPRS', 'readString', 'sendString', - 'remotePort', 'releaseAll', 'mouseMoved', 'background', - 'getXChange', 'getYChange', 'answerCall', 'getResult', - 'voiceCall', 'endPacket', 'constrain', 'getSocket', 'writeJSON', - 'getButton', 'available', 'connected', 'findUntil', 'readBytes', - 'exitValue', 'readGreen', 'writeBlue', 'startLoop', 'IPAddress', - 'isPressed', 'sendSysex', 'pauseMode', 'gatewayIP', 'setCursor', - 'getOemKey', 'tuneWrite', 'noDisplay', 'loadImage', 'switchPIN', - 'onRequest', 'onReceive', 'changePIN', 'playFile', 'noBuffer', - 'parseInt', 'overflow', 'checkPIN', 'knobRead', 'beginTFT', - 'bitClear', 'updateIR', 'bitWrite', 'position', 'writeRGB', - 'highByte', 'writeRed', 'setSpeed', 'readBlue', 'noStroke', - 'remoteIP', 'transfer', 'shutdown', 'hangCall', 'beginSMS', - 'endWrite', 'attached', 'maintain', 'noCursor', 'checkReg', - 'checkPUK', 'shiftOut', 'isValid', 'shiftIn', 'pulseIn', - 'connect', 'println', 'localIP', 'pinMode', 'getIMEI', - 'display', 'noBlink', 'process', 'getBand', 'running', 'beginSD', - 'drawBMP', 'lowByte', 'setBand', 'release', 'bitRead', 'prepare', - 'pointTo', 'readRed', 'setMode', 'noFill', 'remove', 'listen', - 'stroke', 'detach', 'attach', 'noTone', 'exists', 'buffer', - 'height', 'bitSet', 'circle', 'config', 'cursor', 'random', - 'IRread', 'sizeof', 'setDNS', 'endSMS', 'getKey', 'micros', - 'millis', 'begin', 'print', 'write', 'ready', 'flush', 'width', - 'isPIN', 'blink', 'clear', 'press', 'mkdir', 'rmdir', 'close', - 'point', 'yield', 'image', 'float', 'BSSID', 'click', 'delay', - 'read', 'text', 'move', 'peek', 'beep', 'rect', 'line', 'open', - 'seek', 'fill', 'size', 'turn', 'stop', 'home', 'find', 'char', - 'byte', 'step', 'word', 'long', 'tone', 'sqrt', 'RSSI', 'SSID', - 'end', 'bit', 'tan', 'cos', 'sin', 'pow', 'map', 'abs', 'max', - 'min', 'int', 'get', 'run', 'put')) - + functions = set(( + 'KeyboardController', 'MouseController', 'SoftwareSerial', 'EthernetServer', + 'EthernetClient', 'LiquidCrystal', 'RobotControl', 'GSMVoiceCall', + 'EthernetUDP', 'EsploraTFT', 'HttpClient', 'RobotMotor', 'WiFiClient', + 'GSMScanner', 'FileSystem', 'Scheduler', 'GSMServer', 'YunClient', 'YunServer', + 'IPAddress', 'GSMClient', 'GSMModem', 'Keyboard', 'Ethernet', 'Console', + 'GSMBand', 'Esplora', 'Stepper', 'Process', 'WiFiUDP', 'GSM_SMS', 'Mailbox', + 'USBHost', 'Firmata', 'PImage', 'Client', 'Server', 'GSMPIN', 'FileIO', + 'Bridge', 'Serial', 'EEPROM', 'Stream', 'Mouse', 'Audio', 'Servo', 'File', + 'Task', 'GPRS', 'WiFi', 'Wire', 'TFT', 'GSM', 'SPI', 'SD', + 'runShellCommandAsynchronously', 'analogWriteResolution', + 'retrieveCallingNumber', 'printFirmwareVersion', 'analogReadResolution', + 'sendDigitalPortPair', 'noListenOnLocalhost', 'readJoystickButton', + 'setFirmwareVersion', 'readJoystickSwitch', 'scrollDisplayRight', + 'getVoiceCallStatus', 'scrollDisplayLeft', 'writeMicroseconds', + 'delayMicroseconds', 'beginTransmission', 'getSignalStrength', + 'runAsynchronously', 'getAsynchronously', 'listenOnLocalhost', + 'getCurrentCarrier', 'readAccelerometer', 'messageAvailable', + 'sendDigitalPorts', 'lineFollowConfig', 'countryNameWrite', 'runShellCommand', + 'readStringUntil', 'rewindDirectory', 'readTemperature', 'setClockDivider', + 'readLightSensor', 'endTransmission', 'analogReference', 'detachInterrupt', + 'countryNameRead', 'attachInterrupt', 'encryptionType', 'readBytesUntil', + 'robotNameWrite', 'readMicrophone', 'robotNameRead', 'cityNameWrite', + 'userNameWrite', 'readJoystickY', 'readJoystickX', 'mouseReleased', + 'openNextFile', 'scanNetworks', 'noInterrupts', 'digitalWrite', 'beginSpeaker', + 'mousePressed', 'isActionDone', 'mouseDragged', 'displayLogos', 'noAutoscroll', + 'addParameter', 'remoteNumber', 'getModifiers', 'keyboardRead', 'userNameRead', + 'waitContinue', 'processInput', 'parseCommand', 'printVersion', 'readNetworks', + 'writeMessage', 'blinkVersion', 'cityNameRead', 'readMessage', 'setDataMode', + 'parsePacket', 'isListening', 'setBitOrder', 'beginPacket', 'isDirectory', + 'motorsWrite', 'drawCompass', 'digitalRead', 'clearScreen', 'serialEvent', + 'rightToLeft', 'setTextSize', 'leftToRight', 'requestFrom', 'keyReleased', + 'compassRead', 'analogWrite', 'interrupts', 'WiFiServer', 'disconnect', + 'playMelody', 'parseFloat', 'autoscroll', 'getPINUsed', 'setPINUsed', + 'setTimeout', 'sendAnalog', 'readSlider', 'analogRead', 'beginWrite', + 'createChar', 'motorsStop', 'keyPressed', 'tempoWrite', 'readButton', + 'subnetMask', 'debugPrint', 'macAddress', 'writeGreen', 'randomSeed', + 'attachGPRS', 'readString', 'sendString', 'remotePort', 'releaseAll', + 'mouseMoved', 'background', 'getXChange', 'getYChange', 'answerCall', + 'getResult', 'voiceCall', 'endPacket', 'constrain', 'getSocket', 'writeJSON', + 'getButton', 'available', 'connected', 'findUntil', 'readBytes', 'exitValue', + 'readGreen', 'writeBlue', 'startLoop', 'IPAddress', 'isPressed', 'sendSysex', + 'pauseMode', 'gatewayIP', 'setCursor', 'getOemKey', 'tuneWrite', 'noDisplay', + 'loadImage', 'switchPIN', 'onRequest', 'onReceive', 'changePIN', 'playFile', + 'noBuffer', 'parseInt', 'overflow', 'checkPIN', 'knobRead', 'beginTFT', + 'bitClear', 'updateIR', 'bitWrite', 'position', 'writeRGB', 'highByte', + 'writeRed', 'setSpeed', 'readBlue', 'noStroke', 'remoteIP', 'transfer', + 'shutdown', 'hangCall', 'beginSMS', 'endWrite', 'attached', 'maintain', + 'noCursor', 'checkReg', 'checkPUK', 'shiftOut', 'isValid', 'shiftIn', 'pulseIn', + 'connect', 'println', 'localIP', 'pinMode', 'getIMEI', 'display', 'noBlink', + 'process', 'getBand', 'running', 'beginSD', 'drawBMP', 'lowByte', 'setBand', + 'release', 'bitRead', 'prepare', 'pointTo', 'readRed', 'setMode', 'noFill', + 'remove', 'listen', 'stroke', 'detach', 'attach', 'noTone', 'exists', 'buffer', + 'height', 'bitSet', 'circle', 'config', 'cursor', 'random', 'IRread', 'setDNS', + 'endSMS', 'getKey', 'micros', 'millis', 'begin', 'print', 'write', 'ready', + 'flush', 'width', 'isPIN', 'blink', 'clear', 'press', 'mkdir', 'rmdir', 'close', + 'point', 'yield', 'image', 'BSSID', 'click', 'delay', 'read', 'text', 'move', + 'peek', 'beep', 'rect', 'line', 'open', 'seek', 'fill', 'size', 'turn', 'stop', + 'home', 'find', 'step', 'tone', 'sqrt', 'RSSI', 'SSID', 'end', 'bit', 'tan', + 'cos', 'sin', 'pow', 'map', 'abs', 'max', 'min', 'get', 'run', 'put', + 'isAlphaNumeric', 'isAlpha', 'isAscii', 'isWhitespace', 'isControl', 'isDigit', + 'isGraph', 'isLowerCase', 'isPrintable', 'isPunct', 'isSpace', 'isUpperCase', + 'isHexadecimalDigit')) + + # do not highlight + suppress_highlight = set(( + 'namespace', 'template', 'mutable', 'using', 'asm', 'typeid', + 'typename', 'this', 'alignof', 'constexpr', 'decltype', 'noexcept', + 'static_assert', 'thread_local', 'restrict')) + def get_tokens_unprocessed(self, text): for index, token, value in CppLexer.get_tokens_unprocessed(self, text): - if token is Name: - if value in self.constants: - yield index, Keyword.Constant, value - elif value in self.functions: - yield index, Name.Function, value - elif value in self.storage: - yield index, Keyword.Type, value - else: - yield index, token, value - elif token is Name.Function: - if value in self.structure: - yield index, Name.Other, value - else: - yield index, token, value - elif token is Keyword: - if value in self.storage: - yield index, Keyword.Type, value - else: - yield index, token, value + if value in self.structure: + yield index, Name.Builtin, value + elif value in self.operators: + yield index, Operator, value + elif value in self.variables: + yield index, Keyword.Reserved, value + elif value in self.suppress_highlight: + yield index, Name, value + elif value in self.functions: + yield index, Name.Function, value else: yield index, token, value diff --git a/pygments/lexers/chapel.py b/pygments/lexers/chapel.py index d69c55f5..9f9894cd 100644 --- a/pygments/lexers/chapel.py +++ b/pygments/lexers/chapel.py @@ -44,12 +44,13 @@ class ChapelLexer(RegexLexer): (words(( 'align', 'atomic', 'begin', 'break', 'by', 'cobegin', 'coforall', 'continue', 'delete', 'dmapped', 'do', 'domain', 'else', 'enum', - 'export', 'extern', 'for', 'forall', 'if', 'index', 'inline', - 'iter', 'label', 'lambda', 'let', 'local', 'new', 'noinit', 'on', - 'otherwise', 'pragma', 'private', 'public', 'reduce', - 'require', 'return', 'scan', 'select', 'serial', 'single', - 'sparse', 'subdomain', 'sync', 'then', 'use', 'when', 'where', - 'while', 'with', 'yield', 'zip'), suffix=r'\b'), + 'except', 'export', 'extern', 'for', 'forall', 'if', 'index', + 'inline', 'iter', 'label', 'lambda', 'let', 'local', 'new', + 'noinit', 'on', 'only', 'otherwise', 'pragma', 'private', + 'public', 'reduce', 'require', 'return', 'scan', 'select', + 'serial', 'single', 'sparse', 'subdomain', 'sync', 'then', + 'use', 'when', 'where', 'while', 'with', 'yield', 'zip'), + suffix=r'\b'), Keyword), (r'(proc)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'procname'), (r'(class|module|record|union)(\s+)', bygroups(Keyword, Text), diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py index 21f8d1e4..eac4b5e5 100644 --- a/pygments/lexers/dotnet.py +++ b/pygments/lexers/dotnet.py @@ -97,17 +97,17 @@ class CSharpLexer(RegexLexer): Comment.Preproc), (r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Text, Keyword)), - (r'(abstract|as|async|await|base|break|case|catch|' + (r'(abstract|as|async|await|base|break|by|case|catch|' r'checked|const|continue|default|delegate|' r'do|else|enum|event|explicit|extern|false|finally|' r'fixed|for|foreach|goto|if|implicit|in|interface|' - r'internal|is|lock|new|null|operator|' + r'internal|is|let|lock|new|null|on|operator|' r'out|override|params|private|protected|public|readonly|' r'ref|return|sealed|sizeof|stackalloc|static|' r'switch|this|throw|true|try|typeof|' r'unchecked|unsafe|virtual|void|while|' r'get|set|new|partial|yield|add|remove|value|alias|ascending|' - r'descending|from|group|into|orderby|select|where|' + r'descending|from|group|into|orderby|select|thenby|where|' r'join|equals)\b', Keyword), (r'(global)(::)', bygroups(Keyword, Punctuation)), (r'(bool|byte|char|decimal|double|dynamic|float|int|long|object|' diff --git a/pygments/lexers/erlang.py b/pygments/lexers/erlang.py index c353a4dc..7838b3c5 100644 --- a/pygments/lexers/erlang.py +++ b/pygments/lexers/erlang.py @@ -82,7 +82,11 @@ class ErlangLexer(RegexLexer): variable_re = r'(?:[A-Z_]\w*)' - escape_re = r'(?:\\(?:[bdefnrstv\'"\\/]|[0-7][0-7]?[0-7]?|\^[a-zA-Z]))' + esc_char_re = r'[bdefnrstv\'"\\]' + esc_octal_re = r'[0-7][0-7]?[0-7]?' + esc_hex_re = r'(?:x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\})' + esc_ctrl_re = r'\^[a-zA-Z]' + escape_re = r'(?:\\(?:'+esc_char_re+r'|'+esc_octal_re+r'|'+esc_hex_re+r'|'+esc_ctrl_re+r'))' macro_re = r'(?:'+variable_re+r'|'+atom_re+r')' @@ -112,6 +116,13 @@ class ErlangLexer(RegexLexer): (r'\?'+macro_re, Name.Constant), (r'\$(?:'+escape_re+r'|\\[ %]|[^\\])', String.Char), (r'#'+atom_re+r'(:?\.'+atom_re+r')?', Name.Label), + + # Erlang script shebang + (r'\A#!.+\n', Comment.Hashbang), + + # EEP 43: Maps + # http://www.erlang.org/eeps/eep-0043.html + (r'#\{', Punctuation, 'map_key'), ], 'string': [ (escape_re, String.Escape), @@ -127,6 +138,17 @@ class ErlangLexer(RegexLexer): bygroups(Name.Entity, Text, Punctuation, Name.Label), '#pop'), (atom_re, Name.Entity, '#pop'), ], + 'map_key': [ + include('root'), + (r'=>', Punctuation, 'map_val'), + (r':=', Punctuation, 'map_val'), + (r'\}', Punctuation, '#pop'), + ], + 'map_val': [ + include('root'), + (r',', Punctuation, '#pop'), + (r'(?=\})', Punctuation, '#pop'), + ], } diff --git a/pygments/lexers/hdl.py b/pygments/lexers/hdl.py index fc5ff719..04cef14e 100644 --- a/pygments/lexers/hdl.py +++ b/pygments/lexers/hdl.py @@ -108,8 +108,8 @@ class VerilogLexer(RegexLexer): 'trior', 'tri0', 'tri1', 'trireg', 'uwire', 'wire', 'wand', 'wo' 'shortreal', 'real', 'realtime'), suffix=r'\b'), Keyword.Type), - ('[a-zA-Z_]\w*:(?!:)', Name.Label), - ('[a-zA-Z_]\w*', Name), + (r'[a-zA-Z_]\w*:(?!:)', Name.Label), + (r'\$?[a-zA-Z_]\w*', Name), ], 'string': [ (r'"', String, '#pop'), @@ -250,8 +250,8 @@ class SystemVerilogLexer(RegexLexer): 'trior', 'tri0', 'tri1', 'trireg', 'uwire', 'wire', 'wand', 'wo' 'shortreal', 'real', 'realtime'), suffix=r'\b'), Keyword.Type), - ('[a-zA-Z_]\w*:(?!:)', Name.Label), - ('[a-zA-Z_]\w*', Name), + (r'[a-zA-Z_]\w*:(?!:)', Name.Label), + (r'\$?[a-zA-Z_]\w*', Name), ], 'classname': [ (r'[a-zA-Z_]\w*', Name.Class, '#pop'), @@ -308,20 +308,27 @@ class VhdlLexer(RegexLexer): (r'[~!%^&*+=|?:<>/-]', Operator), (r"'[a-z_]\w*", Name.Attribute), (r'[()\[\],.;\']', Punctuation), - (r'"[^\n\\]*"', String), + (r'"[^\n\\"]*"', String), (r'(library)(\s+)([a-z_]\w*)', bygroups(Keyword, Text, Name.Namespace)), (r'(use)(\s+)(entity)', bygroups(Keyword, Text, Keyword)), + (r'(use)(\s+)([a-z_][\w.]*\.)(all)', + bygroups(Keyword, Text, Name.Namespace, Keyword)), (r'(use)(\s+)([a-z_][\w.]*)', bygroups(Keyword, Text, Name.Namespace)), + (r'(std|ieee)(\.[a-z_]\w*)', + bygroups(Name.Namespace, Name.Namespace)), + (words(('std', 'ieee', 'work'), suffix=r'\b'), + Name.Namespace), (r'(entity|component)(\s+)([a-z_]\w*)', bygroups(Keyword, Text, Name.Class)), (r'(architecture|configuration)(\s+)([a-z_]\w*)(\s+)' r'(of)(\s+)([a-z_]\w*)(\s+)(is)', bygroups(Keyword, Text, Name.Class, Text, Keyword, Text, Name.Class, Text, Keyword)), - + (r'([a-z_]\w*)(:)(\s+)(process|for)', + bygroups(Name.Class, Operator, Text, Keyword)), (r'(end)(\s+)', bygroups(using(this), Text), 'endblock'), include('types'), @@ -341,7 +348,7 @@ class VhdlLexer(RegexLexer): 'boolean', 'bit', 'character', 'severity_level', 'integer', 'time', 'delay_length', 'natural', 'positive', 'string', 'bit_vector', 'file_open_kind', 'file_open_status', 'std_ulogic', 'std_ulogic_vector', - 'std_logic', 'std_logic_vector'), suffix=r'\b'), + 'std_logic', 'std_logic_vector', 'signed', 'unsigned'), suffix=r'\b'), Keyword.Type), ], 'keywords': [ @@ -357,8 +364,8 @@ class VhdlLexer(RegexLexer): 'next', 'nor', 'not', 'null', 'of', 'on', 'open', 'or', 'others', 'out', 'package', 'port', 'postponed', 'procedure', 'process', 'pure', 'range', 'record', - 'register', 'reject', 'return', 'rol', 'ror', 'select', - 'severity', 'signal', 'shared', 'sla', 'sli', 'sra', + 'register', 'reject', 'rem', 'return', 'rol', 'ror', 'select', + 'severity', 'signal', 'shared', 'sla', 'sll', 'sra', 'srl', 'subtype', 'then', 'to', 'transport', 'type', 'units', 'until', 'use', 'variable', 'wait', 'when', 'while', 'with', 'xnor', 'xor'), suffix=r'\b'), diff --git a/pygments/lexers/igor.py b/pygments/lexers/igor.py index b0eaf6aa..17fedf88 100644 --- a/pygments/lexers/igor.py +++ b/pygments/lexers/igor.py @@ -40,7 +40,7 @@ class IgorLexer(RegexLexer): types = ( 'variable', 'string', 'constant', 'strconstant', 'NVAR', 'SVAR', 'WAVE', 'STRUCT', 'dfref', 'funcref', 'char', 'uchar', 'int16', 'uint16', 'int32', - 'uint32', 'float', 'double' + 'uint32', 'int64', 'uint64', 'float', 'double' ) keywords = ( 'override', 'ThreadSafe', 'MultiThread', 'static', 'Proc', @@ -48,213 +48,221 @@ class IgorLexer(RegexLexer): 'Structure', 'EndStructure', 'EndMacro', 'Menu', 'SubMenu' ) operations = ( - 'Abort', 'AddFIFOData', 'AddFIFOVectData', 'AddMovieAudio', - 'AddMovieFrame', 'APMath', 'Append', 'AppendImage', - 'AppendLayoutObject', 'AppendMatrixContour', 'AppendText', - 'AppendToGraph', 'AppendToLayout', 'AppendToTable', 'AppendXYZContour', - 'AutoPositionWindow', 'BackgroundInfo', 'Beep', 'BoundingBall', - 'BrowseURL', 'BuildMenu', 'Button', 'cd', 'Chart', 'CheckBox', - 'CheckDisplayed', 'ChooseColor', 'Close', 'CloseMovie', 'CloseProc', - 'ColorScale', 'ColorTab2Wave', 'Concatenate', 'ControlBar', - 'ControlInfo', 'ControlUpdate', 'ConvexHull', 'Convolve', 'CopyFile', - 'CopyFolder', 'CopyScales', 'Correlate', 'CreateAliasShortcut', 'Cross', - 'CtrlBackground', 'CtrlFIFO', 'CtrlNamedBackground', 'Cursor', - 'CurveFit', 'CustomControl', 'CWT', 'Debugger', 'DebuggerOptions', - 'DefaultFont', 'DefaultGuiControls', 'DefaultGuiFont', 'DefineGuide', - 'DelayUpdate', 'DeleteFile', 'DeleteFolder', 'DeletePoints', - 'Differentiate', 'dir', 'Display', 'DisplayHelpTopic', - 'DisplayProcedure', 'DoAlert', 'DoIgorMenu', 'DoUpdate', 'DoWindow', - 'DoXOPIdle', 'DrawAction', 'DrawArc', 'DrawBezier', 'DrawLine', - 'DrawOval', 'DrawPICT', 'DrawPoly', 'DrawRect', 'DrawRRect', 'DrawText', - 'DSPDetrend', 'DSPPeriodogram', 'Duplicate', 'DuplicateDataFolder', - 'DWT', 'EdgeStats', 'Edit', 'ErrorBars', 'Execute', 'ExecuteScriptText', - 'ExperimentModified', 'Extract', 'FastGaussTransform', 'FastOp', - 'FBinRead', 'FBinWrite', 'FFT', 'FIFO2Wave', 'FIFOStatus', 'FilterFIR', - 'FilterIIR', 'FindLevel', 'FindLevels', 'FindPeak', 'FindPointsInPoly', - 'FindRoots', 'FindSequence', 'FindValue', 'FPClustering', 'fprintf', - 'FReadLine', 'FSetPos', 'FStatus', 'FTPDelete', 'FTPDownload', - 'FTPUpload', 'FuncFit', 'FuncFitMD', 'GetAxis', 'GetFileFolderInfo', - 'GetLastUserMenuInfo', 'GetMarquee', 'GetSelection', 'GetWindow', - 'GraphNormal', 'GraphWaveDraw', 'GraphWaveEdit', 'Grep', 'GroupBox', - 'Hanning', 'HideIgorMenus', 'HideInfo', 'HideProcedures', 'HideTools', - 'HilbertTransform', 'Histogram', 'IFFT', 'ImageAnalyzeParticles', - 'ImageBlend', 'ImageBoundaryToMask', 'ImageEdgeDetection', - 'ImageFileInfo', 'ImageFilter', 'ImageFocus', 'ImageGenerateROIMask', - 'ImageHistModification', 'ImageHistogram', 'ImageInterpolate', - 'ImageLineProfile', 'ImageLoad', 'ImageMorphology', 'ImageRegistration', - 'ImageRemoveBackground', 'ImageRestore', 'ImageRotate', 'ImageSave', - 'ImageSeedFill', 'ImageSnake', 'ImageStats', 'ImageThreshold', - 'ImageTransform', 'ImageUnwrapPhase', 'ImageWindow', 'IndexSort', - 'InsertPoints', 'Integrate', 'IntegrateODE', 'Interp3DPath', - 'Interpolate3D', 'KillBackground', 'KillControl', 'KillDataFolder', - 'KillFIFO', 'KillFreeAxis', 'KillPath', 'KillPICTs', 'KillStrings', - 'KillVariables', 'KillWaves', 'KillWindow', 'KMeans', 'Label', 'Layout', - 'Legend', 'LinearFeedbackShiftRegister', 'ListBox', 'LoadData', - 'LoadPackagePreferences', 'LoadPICT', 'LoadWave', 'Loess', - 'LombPeriodogram', 'Make', 'MakeIndex', 'MarkPerfTestTime', - 'MatrixConvolve', 'MatrixCorr', 'MatrixEigenV', 'MatrixFilter', - 'MatrixGaussJ', 'MatrixInverse', 'MatrixLinearSolve', - 'MatrixLinearSolveTD', 'MatrixLLS', 'MatrixLUBkSub', 'MatrixLUD', - 'MatrixMultiply', 'MatrixOP', 'MatrixSchur', 'MatrixSolve', - 'MatrixSVBkSub', 'MatrixSVD', 'MatrixTranspose', 'MeasureStyledText', - 'Modify', 'ModifyContour', 'ModifyControl', 'ModifyControlList', - 'ModifyFreeAxis', 'ModifyGraph', 'ModifyImage', 'ModifyLayout', - 'ModifyPanel', 'ModifyTable', 'ModifyWaterfall', 'MoveDataFolder', - 'MoveFile', 'MoveFolder', 'MoveString', 'MoveSubwindow', 'MoveVariable', - 'MoveWave', 'MoveWindow', 'NeuralNetworkRun', 'NeuralNetworkTrain', - 'NewDataFolder', 'NewFIFO', 'NewFIFOChan', 'NewFreeAxis', 'NewImage', - 'NewLayout', 'NewMovie', 'NewNotebook', 'NewPanel', 'NewPath', - 'NewWaterfall', 'Note', 'Notebook', 'NotebookAction', 'Open', - 'OpenNotebook', 'Optimize', 'ParseOperationTemplate', 'PathInfo', - 'PauseForUser', 'PauseUpdate', 'PCA', 'PlayMovie', 'PlayMovieAction', - 'PlaySnd', 'PlaySound', 'PopupContextualMenu', 'PopupMenu', - 'Preferences', 'PrimeFactors', 'Print', 'printf', 'PrintGraphs', - 'PrintLayout', 'PrintNotebook', 'PrintSettings', 'PrintTable', - 'Project', 'PulseStats', 'PutScrapText', 'pwd', 'Quit', - 'RatioFromNumber', 'Redimension', 'Remove', 'RemoveContour', + 'Abort', 'AddFIFOData', 'AddFIFOVectData', 'AddMovieAudio', 'AddMovieFrame', + 'AdoptFiles', 'APMath', 'Append', 'AppendImage', 'AppendLayoutObject', + 'AppendMatrixContour', 'AppendText', 'AppendToGizmo', 'AppendToGraph', + 'AppendToLayout', 'AppendToTable', 'AppendXYZContour', 'AutoPositionWindow', + 'BackgroundInfo', 'Beep', 'BoundingBall', 'BoxSmooth', 'BrowseURL', 'BuildMenu', + 'Button', 'cd', 'Chart', 'CheckBox', 'CheckDisplayed', 'ChooseColor', 'Close', + 'CloseHelp', 'CloseMovie', 'CloseProc', 'ColorScale', 'ColorTab2Wave', + 'Concatenate', 'ControlBar', 'ControlInfo', 'ControlUpdate', + 'ConvertGlobalStringTextEncoding', 'ConvexHull', 'Convolve', 'CopyFile', + 'CopyFolder', 'CopyScales', 'Correlate', 'CreateAliasShortcut', 'CreateBrowser', + 'Cross', 'CtrlBackground', 'CtrlFIFO', 'CtrlNamedBackground', 'Cursor', + 'CurveFit', 'CustomControl', 'CWT', 'Debugger', 'DebuggerOptions', 'DefaultFont', + 'DefaultGuiControls', 'DefaultGuiFont', 'DefaultTextEncoding', 'DefineGuide', + 'DelayUpdate', 'DeleteAnnotations', 'DeleteFile', 'DeleteFolder', 'DeletePoints', + 'Differentiate', 'dir', 'Display', 'DisplayHelpTopic', 'DisplayProcedure', + 'DoAlert', 'DoIgorMenu', 'DoUpdate', 'DoWindow', 'DoXOPIdle', 'DPSS', + 'DrawAction', 'DrawArc', 'DrawBezier', 'DrawLine', 'DrawOval', 'DrawPICT', + 'DrawPoly', 'DrawRect', 'DrawRRect', 'DrawText', 'DrawUserShape', 'DSPDetrend', + 'DSPPeriodogram', 'Duplicate', 'DuplicateDataFolder', 'DWT', 'EdgeStats', 'Edit', + 'ErrorBars', 'EstimatePeakSizes', 'Execute', 'ExecuteScriptText', + 'ExperimentModified', 'ExportGizmo', 'Extract', 'FastGaussTransform', 'FastOp', + 'FBinRead', 'FBinWrite', 'FFT', 'FIFOStatus', 'FIFO2Wave', 'FilterFIR', + 'FilterIIR', 'FindAPeak', 'FindContour', 'FindDuplicates', 'FindLevel', + 'FindLevels', 'FindPeak', 'FindPointsInPoly', 'FindRoots', 'FindSequence', + 'FindValue', 'FPClustering', 'fprintf', 'FReadLine', 'FSetPos', 'FStatus', + 'FTPCreateDirectory', 'FTPDelete', 'FTPDownload', 'FTPUpload', 'FuncFit', + 'FuncFitMD', 'GBLoadWave', 'GetAxis', 'GetCamera', 'GetFileFolderInfo', + 'GetGizmo', 'GetLastUserMenuInfo', 'GetMarquee', 'GetMouse', 'GetSelection', + 'GetWindow', 'GPIBReadBinaryWave2', 'GPIBReadBinary2', 'GPIBReadWave2', + 'GPIBRead2', 'GPIBWriteBinaryWave2', 'GPIBWriteBinary2', 'GPIBWriteWave2', + 'GPIBWrite2', 'GPIB2', 'GraphNormal', 'GraphWaveDraw', 'GraphWaveEdit', 'Grep', + 'GroupBox', 'Hanning', 'HDF5CloseFile', 'HDF5CloseGroup', 'HDF5ConvertColors', + 'HDF5CreateFile', 'HDF5CreateGroup', 'HDF5CreateLink', 'HDF5Dump', + 'HDF5DumpErrors', 'HDF5DumpState', 'HDF5ListAttributes', 'HDF5ListGroup', + 'HDF5LoadData', 'HDF5LoadGroup', 'HDF5LoadImage', 'HDF5OpenFile', 'HDF5OpenGroup', + 'HDF5SaveData', 'HDF5SaveGroup', 'HDF5SaveImage', 'HDF5TestOperation', + 'HDF5UnlinkObject', 'HideIgorMenus', 'HideInfo', 'HideProcedures', 'HideTools', + 'HilbertTransform', 'Histogram', 'ICA', 'IFFT', 'ImageAnalyzeParticles', + 'ImageBlend', 'ImageBoundaryToMask', 'ImageEdgeDetection', 'ImageFileInfo', + 'ImageFilter', 'ImageFocus', 'ImageFromXYZ', 'ImageGenerateROIMask', 'ImageGLCM', + 'ImageHistModification', 'ImageHistogram', 'ImageInterpolate', 'ImageLineProfile', + 'ImageLoad', 'ImageMorphology', 'ImageRegistration', 'ImageRemoveBackground', + 'ImageRestore', 'ImageRotate', 'ImageSave', 'ImageSeedFill', 'ImageSkeleton3d', + 'ImageSnake', 'ImageStats', 'ImageThreshold', 'ImageTransform', + 'ImageUnwrapPhase', 'ImageWindow', 'IndexSort', 'InsertPoints', 'Integrate', + 'IntegrateODE', 'Integrate2D', 'Interpolate2', 'Interpolate3D', 'Interp3DPath', + 'JCAMPLoadWave', 'JointHistogram', 'KillBackground', 'KillControl', + 'KillDataFolder', 'KillFIFO', 'KillFreeAxis', 'KillPath', 'KillPICTs', + 'KillStrings', 'KillVariables', 'KillWaves', 'KillWindow', 'KMeans', 'Label', + 'Layout', 'LayoutPageAction', 'LayoutSlideShow', 'Legend', + 'LinearFeedbackShiftRegister', 'ListBox', 'LoadData', 'LoadPackagePreferences', + 'LoadPICT', 'LoadWave', 'Loess', 'LombPeriodogram', 'Make', 'MakeIndex', + 'MarkPerfTestTime', 'MatrixConvolve', 'MatrixCorr', 'MatrixEigenV', + 'MatrixFilter', 'MatrixGaussJ', 'MatrixGLM', 'MatrixInverse', 'MatrixLinearSolve', + 'MatrixLinearSolveTD', 'MatrixLLS', 'MatrixLUBkSub', 'MatrixLUD', 'MatrixLUDTD', + 'MatrixMultiply', 'MatrixOP', 'MatrixSchur', 'MatrixSolve', 'MatrixSVBkSub', + 'MatrixSVD', 'MatrixTranspose', 'MeasureStyledText', 'MLLoadWave', 'Modify', + 'ModifyBrowser', 'ModifyCamera', 'ModifyContour', 'ModifyControl', + 'ModifyControlList', 'ModifyFreeAxis', 'ModifyGizmo', 'ModifyGraph', + 'ModifyImage', 'ModifyLayout', 'ModifyPanel', 'ModifyTable', 'ModifyWaterfall', + 'MoveDataFolder', 'MoveFile', 'MoveFolder', 'MoveString', 'MoveSubwindow', + 'MoveVariable', 'MoveWave', 'MoveWindow', 'MultiTaperPSD', + 'MultiThreadingControl', 'NeuralNetworkRun', 'NeuralNetworkTrain', 'NewCamera', + 'NewDataFolder', 'NewFIFO', 'NewFIFOChan', 'NewFreeAxis', 'NewGizmo', 'NewImage', + 'NewLayout', 'NewMovie', 'NewNotebook', 'NewPanel', 'NewPath', 'NewWaterfall', + 'NI4882', 'Note', 'Notebook', 'NotebookAction', 'Open', 'OpenHelp', + 'OpenNotebook', 'Optimize', 'ParseOperationTemplate', 'PathInfo', 'PauseForUser', + 'PauseUpdate', 'PCA', 'PlayMovie', 'PlayMovieAction', 'PlaySound', + 'PopupContextualMenu', 'PopupMenu', 'Preferences', 'PrimeFactors', 'Print', + 'printf', 'PrintGraphs', 'PrintLayout', 'PrintNotebook', 'PrintSettings', + 'PrintTable', 'Project', 'PulseStats', 'PutScrapText', 'pwd', 'Quit', + 'RatioFromNumber', 'Redimension', 'Remove', 'RemoveContour', 'RemoveFromGizmo', 'RemoveFromGraph', 'RemoveFromLayout', 'RemoveFromTable', 'RemoveImage', - 'RemoveLayoutObjects', 'RemovePath', 'Rename', 'RenameDataFolder', - 'RenamePath', 'RenamePICT', 'RenameWindow', 'ReorderImages', - 'ReorderTraces', 'ReplaceText', 'ReplaceWave', 'Resample', - 'ResumeUpdate', 'Reverse', 'Rotate', 'Save', 'SaveData', - 'SaveExperiment', 'SaveGraphCopy', 'SaveNotebook', - 'SavePackagePreferences', 'SavePICT', 'SaveTableCopy', - 'SetActiveSubwindow', 'SetAxis', 'SetBackground', 'SetDashPattern', - 'SetDataFolder', 'SetDimLabel', 'SetDrawEnv', 'SetDrawLayer', - 'SetFileFolderInfo', 'SetFormula', 'SetIgorHook', 'SetIgorMenuMode', - 'SetIgorOption', 'SetMarquee', 'SetProcessSleep', 'SetRandomSeed', - 'SetScale', 'SetVariable', 'SetWaveLock', 'SetWindow', 'ShowIgorMenus', - 'ShowInfo', 'ShowTools', 'Silent', 'Sleep', 'Slider', 'Smooth', - 'SmoothCustom', 'Sort', 'SoundInRecord', 'SoundInSet', - 'SoundInStartChart', 'SoundInStatus', 'SoundInStopChart', - 'SphericalInterpolate', 'SphericalTriangulate', 'SplitString', - 'sprintf', 'sscanf', 'Stack', 'StackWindows', + 'RemoveLayoutObjects', 'RemovePath', 'Rename', 'RenameDataFolder', 'RenamePath', + 'RenamePICT', 'RenameWindow', 'ReorderImages', 'ReorderTraces', 'ReplaceText', + 'ReplaceWave', 'Resample', 'ResumeUpdate', 'Reverse', 'Rotate', 'Save', + 'SaveData', 'SaveExperiment', 'SaveGraphCopy', 'SaveNotebook', + 'SavePackagePreferences', 'SavePICT', 'SaveTableCopy', 'SetActiveSubwindow', + 'SetAxis', 'SetBackground', 'SetDashPattern', 'SetDataFolder', 'SetDimLabel', + 'SetDrawEnv', 'SetDrawLayer', 'SetFileFolderInfo', 'SetFormula', 'SetIgorHook', + 'SetIgorMenuMode', 'SetIgorOption', 'SetMarquee', 'SetProcessSleep', + 'SetRandomSeed', 'SetScale', 'SetVariable', 'SetWaveLock', 'SetWaveTextEncoding', + 'SetWindow', 'ShowIgorMenus', 'ShowInfo', 'ShowTools', 'Silent', 'Sleep', + 'Slider', 'Smooth', 'SmoothCustom', 'Sort', 'SortColumns', 'SoundInRecord', + 'SoundInSet', 'SoundInStartChart', 'SoundInStatus', 'SoundInStopChart', + 'SoundLoadWave', 'SoundSaveWave', 'SphericalInterpolate', 'SphericalTriangulate', + 'SplitString', 'SplitWave', 'sprintf', 'sscanf', 'Stack', 'StackWindows', 'StatsAngularDistanceTest', 'StatsANOVA1Test', 'StatsANOVA2NRTest', 'StatsANOVA2RMTest', 'StatsANOVA2Test', 'StatsChiTest', - 'StatsCircularCorrelationTest', 'StatsCircularMeans', - 'StatsCircularMoments', 'StatsCircularTwoSampleTest', - 'StatsCochranTest', 'StatsContingencyTable', 'StatsDIPTest', - 'StatsDunnettTest', 'StatsFriedmanTest', 'StatsFTest', - 'StatsHodgesAjneTest', 'StatsJBTest', 'StatsKendallTauTest', + 'StatsCircularCorrelationTest', 'StatsCircularMeans', 'StatsCircularMoments', + 'StatsCircularTwoSampleTest', 'StatsCochranTest', 'StatsContingencyTable', + 'StatsDIPTest', 'StatsDunnettTest', 'StatsFriedmanTest', 'StatsFTest', + 'StatsHodgesAjneTest', 'StatsJBTest', 'StatsKDE', 'StatsKendallTauTest', 'StatsKSTest', 'StatsKWTest', 'StatsLinearCorrelationTest', - 'StatsLinearRegression', 'StatsMultiCorrelationTest', - 'StatsNPMCTest', 'StatsNPNominalSRTest', 'StatsQuantiles', - 'StatsRankCorrelationTest', 'StatsResample', 'StatsSample', - 'StatsScheffeTest', 'StatsSignTest', 'StatsSRTest', 'StatsTTest', - 'StatsTukeyTest', 'StatsVariancesTest', 'StatsWatsonUSquaredTest', - 'StatsWatsonWilliamsTest', 'StatsWheelerWatsonTest', - 'StatsWilcoxonRankTest', 'StatsWRCorrelationTest', 'String', - 'StructGet', 'StructPut', 'TabControl', 'Tag', 'TextBox', 'Tile', - 'TileWindows', 'TitleBox', 'ToCommandLine', 'ToolsGrid', - 'Triangulate3d', 'Unwrap', 'ValDisplay', 'Variable', 'WaveMeanStdv', - 'WaveStats', 'WaveTransform', 'wfprintf', 'WignerTransform', - 'WindowFunction', + 'StatsLinearRegression', 'StatsMultiCorrelationTest', 'StatsNPMCTest', + 'StatsNPNominalSRTest', 'StatsQuantiles', 'StatsRankCorrelationTest', + 'StatsResample', 'StatsSample', 'StatsScheffeTest', 'StatsShapiroWilkTest', + 'StatsSignTest', 'StatsSRTest', 'StatsTTest', 'StatsTukeyTest', + 'StatsVariancesTest', 'StatsWatsonUSquaredTest', 'StatsWatsonWilliamsTest', + 'StatsWheelerWatsonTest', 'StatsWilcoxonRankTest', 'StatsWRCorrelationTest', + 'String', 'StructGet', 'StructPut', 'SumDimension', 'SumSeries', 'TabControl', + 'Tag', 'TextBox', 'ThreadGroupPutDF', 'ThreadStart', 'Tile', 'TileWindows', + 'TitleBox', 'ToCommandLine', 'ToolsGrid', 'Triangulate3d', 'Unwrap', 'URLRequest', + 'ValDisplay', 'Variable', 'VDTClosePort2', 'VDTGetPortList2', 'VDTGetStatus2', + 'VDTOpenPort2', 'VDTOperationsPort2', 'VDTReadBinaryWave2', 'VDTReadBinary2', + 'VDTReadHexWave2', 'VDTReadHex2', 'VDTReadWave2', 'VDTRead2', 'VDTTerminalPort2', + 'VDTWriteBinaryWave2', 'VDTWriteBinary2', 'VDTWriteHexWave2', 'VDTWriteHex2', + 'VDTWriteWave2', 'VDTWrite2', 'VDT2', 'WaveMeanStdv', 'WaveStats', + 'WaveTransform', 'wfprintf', 'WignerTransform', 'WindowFunction', 'XLLoadWave' ) functions = ( - 'abs', 'acos', 'acosh', 'AiryA', 'AiryAD', 'AiryB', 'AiryBD', 'alog', - 'area', 'areaXY', 'asin', 'asinh', 'atan', 'atan2', 'atanh', - 'AxisValFromPixel', 'Besseli', 'Besselj', 'Besselk', 'Bessely', 'bessi', - 'bessj', 'bessk', 'bessy', 'beta', 'betai', 'BinarySearch', + 'abs', 'acos', 'acosh', 'AddListItem', 'AiryA', 'AiryAD', 'AiryB', 'AiryBD', + 'alog', 'AnnotationInfo', 'AnnotationList', 'area', 'areaXY', 'asin', 'asinh', + 'atan', 'atanh', 'atan2', 'AxisInfo', 'AxisList', 'AxisValFromPixel', 'Besseli', + 'Besselj', 'Besselk', 'Bessely', 'beta', 'betai', 'BinarySearch', 'BinarySearchInterp', 'binomial', 'binomialln', 'binomialNoise', 'cabs', - 'CaptureHistoryStart', 'ceil', 'cequal', 'char2num', 'chebyshev', - 'chebyshevU', 'CheckName', 'cmplx', 'cmpstr', 'conj', 'ContourZ', 'cos', - 'cosh', 'cot', 'CountObjects', 'CountObjectsDFR', 'cpowi', - 'CreationDate', 'csc', 'DataFolderExists', 'DataFolderRefsEqual', - 'DataFolderRefStatus', 'date2secs', 'datetime', 'DateToJulian', - 'Dawson', 'DDEExecute', 'DDEInitiate', 'DDEPokeString', 'DDEPokeWave', - 'DDERequestWave', 'DDEStatus', 'DDETerminate', 'defined', 'deltax', 'digamma', - 'DimDelta', 'DimOffset', 'DimSize', 'ei', 'enoise', 'equalWaves', 'erf', - 'erfc', 'exists', 'exp', 'expInt', 'expNoise', 'factorial', 'fakedata', - 'faverage', 'faverageXY', 'FindDimLabel', 'FindListItem', 'floor', + 'CaptureHistory', 'CaptureHistoryStart', 'ceil', 'cequal', 'char2num', + 'chebyshev', 'chebyshevU', 'CheckName', 'ChildWindowList', 'CleanupName', 'cmplx', + 'cmpstr', 'conj', 'ContourInfo', 'ContourNameList', 'ContourNameToWaveRef', + 'ContourZ', 'ControlNameList', 'ConvertTextEncoding', 'cos', 'cosh', + 'cosIntegral', 'cot', 'coth', 'CountObjects', 'CountObjectsDFR', 'cpowi', + 'CreationDate', 'csc', 'csch', 'CsrInfo', 'CsrWave', 'CsrWaveRef', 'CsrXWave', + 'CsrXWaveRef', 'CTabList', 'DataFolderDir', 'DataFolderExists', + 'DataFolderRefsEqual', 'DataFolderRefStatus', 'date', 'datetime', 'DateToJulian', + 'date2secs', 'Dawson', 'DDERequestString', 'defined', 'deltax', 'digamma', + 'dilogarithm', 'DimDelta', 'DimOffset', 'DimSize', 'ei', 'enoise', 'equalWaves', + 'erf', 'erfc', 'erfcw', 'exists', 'exp', 'ExpConvExp', 'ExpConvExpFit', + 'ExpConvExpFitBL', 'ExpConvExpFit1Shape', 'ExpConvExpFit1ShapeBL', 'ExpGauss', + 'ExpGaussFit', 'ExpGaussFitBL', 'ExpGaussFit1Shape', 'ExpGaussFit1ShapeBL', + 'expInt', 'expIntegralE1', 'expNoise', 'factorial', 'fakedata', 'faverage', + 'faverageXY', 'FetchURL', 'FindDimLabel', 'FindListItem', 'floor', 'FontList', 'FontSizeHeight', 'FontSizeStringWidth', 'FresnelCos', 'FresnelSin', - 'gamma', 'gammaInc', 'gammaNoise', 'gammln', 'gammp', 'gammq', 'Gauss', - 'Gauss1D', 'Gauss2D', 'gcd', 'GetDefaultFontSize', - 'GetDefaultFontStyle', 'GetKeyState', 'GetRTError', 'gnoise', - 'GrepString', 'hcsr', 'hermite', 'hermiteGauss', 'HyperG0F1', - 'HyperG1F1', 'HyperG2F1', 'HyperGNoise', 'HyperGPFQ', 'IgorVersion', - 'ilim', 'imag', 'Inf', 'Integrate1D', 'interp', 'Interp2D', 'Interp3D', - 'inverseERF', 'inverseERFC', 'ItemsInList', 'jlim', 'Laguerre', - 'LaguerreA', 'LaguerreGauss', 'leftx', 'LegendreA', 'limit', 'ln', - 'log', 'logNormalNoise', 'lorentzianNoise', 'magsqr', 'MandelbrotPoint', - 'MarcumQ', 'MatrixDet', 'MatrixDot', 'MatrixRank', 'MatrixTrace', 'max', - 'mean', 'min', 'mod', 'ModDate', 'NaN', 'norm', 'NumberByKey', - 'numpnts', 'numtype', 'NumVarOrDefault', 'NVAR_Exists', 'p2rect', - 'ParamIsDefault', 'pcsr', 'Pi', 'PixelFromAxisVal', 'pnt2x', - 'poissonNoise', 'poly', 'poly2D', 'PolygonArea', 'qcsr', 'r2polar', - 'real', 'rightx', 'round', 'sawtooth', 'ScreenResolution', 'sec', - 'SelectNumber', 'sign', 'sin', 'sinc', 'sinh', 'SphericalBessJ', - 'SphericalBessJD', 'SphericalBessY', 'SphericalBessYD', - 'SphericalHarmonics', 'sqrt', 'StartMSTimer', 'StatsBetaCDF', - 'StatsBetaPDF', 'StatsBinomialCDF', 'StatsBinomialPDF', - 'StatsCauchyCDF', 'StatsCauchyPDF', 'StatsChiCDF', 'StatsChiPDF', - 'StatsCMSSDCDF', 'StatsCorrelation', 'StatsDExpCDF', 'StatsDExpPDF', - 'StatsErlangCDF', 'StatsErlangPDF', 'StatsErrorPDF', 'StatsEValueCDF', - 'StatsEValuePDF', 'StatsExpCDF', 'StatsExpPDF', 'StatsFCDF', - 'StatsFPDF', 'StatsFriedmanCDF', 'StatsGammaCDF', 'StatsGammaPDF', - 'StatsGeometricCDF', 'StatsGeometricPDF', 'StatsHyperGCDF', - 'StatsHyperGPDF', 'StatsInvBetaCDF', 'StatsInvBinomialCDF', - 'StatsInvCauchyCDF', 'StatsInvChiCDF', 'StatsInvCMSSDCDF', - 'StatsInvDExpCDF', 'StatsInvEValueCDF', 'StatsInvExpCDF', - 'StatsInvFCDF', 'StatsInvFriedmanCDF', 'StatsInvGammaCDF', - 'StatsInvGeometricCDF', 'StatsInvKuiperCDF', 'StatsInvLogisticCDF', - 'StatsInvLogNormalCDF', 'StatsInvMaxwellCDF', 'StatsInvMooreCDF', - 'StatsInvNBinomialCDF', 'StatsInvNCChiCDF', 'StatsInvNCFCDF', - 'StatsInvNormalCDF', 'StatsInvParetoCDF', 'StatsInvPoissonCDF', - 'StatsInvPowerCDF', 'StatsInvQCDF', 'StatsInvQpCDF', + 'FuncRefInfo', 'FunctionInfo', 'FunctionList', 'FunctionPath', 'gamma', + 'gammaEuler', 'gammaInc', 'gammaNoise', 'gammln', 'gammp', 'gammq', 'Gauss', + 'GaussFit', 'GaussFitBL', 'GaussFit1Width', 'GaussFit1WidthBL', 'Gauss1D', + 'Gauss2D', 'gcd', 'GetBrowserLine', 'GetBrowserSelection', 'GetDataFolder', + 'GetDataFolderDFR', 'GetDefaultFont', 'GetDefaultFontSize', 'GetDefaultFontStyle', + 'GetDimLabel', 'GetEnvironmentVariable', 'GetErrMessage', 'GetFormula', + 'GetIndependentModuleName', 'GetIndexedObjName', 'GetIndexedObjNameDFR', + 'GetKeyState', 'GetRTErrMessage', 'GetRTError', 'GetRTLocation', 'GetRTLocInfo', + 'GetRTStackInfo', 'GetScrapText', 'GetUserData', 'GetWavesDataFolder', + 'GetWavesDataFolderDFR', 'GizmoInfo', 'GizmoScale', 'gnoise', 'GrepList', + 'GrepString', 'GuideInfo', 'GuideNameList', 'Hash', 'hcsr', 'HDF5AttributeInfo', + 'HDF5DatasetInfo', 'HDF5LibraryInfo', 'HDF5TypeInfo', 'hermite', 'hermiteGauss', + 'HyperGNoise', 'HyperGPFQ', 'HyperG0F1', 'HyperG1F1', 'HyperG2F1', 'IgorInfo', + 'IgorVersion', 'imag', 'ImageInfo', 'ImageNameList', 'ImageNameToWaveRef', + 'IndependentModuleList', 'IndexedDir', 'IndexedFile', 'Inf', 'Integrate1D', + 'interp', 'Interp2D', 'Interp3D', 'inverseERF', 'inverseERFC', 'ItemsInList', + 'JacobiCn', 'JacobiSn', 'JulianToDate', 'Laguerre', 'LaguerreA', 'LaguerreGauss', + 'LambertW', 'LayoutInfo', 'leftx', 'LegendreA', 'limit', 'ListMatch', + 'ListToTextWave', 'ListToWaveRefWave', 'ln', 'log', 'logNormalNoise', + 'LorentzianFit', 'LorentzianFitBL', 'LorentzianFit1Width', + 'LorentzianFit1WidthBL', 'lorentzianNoise', 'LowerStr', 'MacroList', 'magsqr', + 'MandelbrotPoint', 'MarcumQ', 'MatrixCondition', 'MatrixDet', 'MatrixDot', + 'MatrixRank', 'MatrixTrace', 'max', 'mean', 'median', 'min', 'mod', 'ModDate', + 'MPFXEMGPeak', 'MPFXExpConvExpPeak', 'MPFXGaussPeak', 'MPFXLorenzianPeak', + 'MPFXVoigtPeak', 'NameOfWave', 'NaN', 'NewFreeDataFolder', 'NewFreeWave', 'norm', + 'NormalizeUnicode', 'note', 'NumberByKey', 'numpnts', 'numtype', + 'NumVarOrDefault', 'num2char', 'num2istr', 'num2str', 'NVAR_Exists', + 'OperationList', 'PadString', 'PanelResolution', 'ParamIsDefault', + 'ParseFilePath', 'PathList', 'pcsr', 'Pi', 'PICTInfo', 'PICTList', + 'PixelFromAxisVal', 'pnt2x', 'poissonNoise', 'poly', 'PolygonArea', 'poly2D', + 'PossiblyQuoteName', 'ProcedureText', 'p2rect', 'qcsr', 'real', 'RemoveByKey', + 'RemoveEnding', 'RemoveFromList', 'RemoveListItem', 'ReplaceNumberByKey', + 'ReplaceString', 'ReplaceStringByKey', 'rightx', 'round', 'r2polar', 'sawtooth', + 'scaleToIndex', 'ScreenResolution', 'sec', 'sech', 'Secs2Date', 'Secs2Time', + 'SelectNumber', 'SelectString', 'SetEnvironmentVariable', 'sign', 'sin', 'sinc', + 'sinh', 'sinIntegral', 'SortList', 'SpecialCharacterInfo', 'SpecialCharacterList', + 'SpecialDirPath', 'SphericalBessJ', 'SphericalBessJD', 'SphericalBessY', + 'SphericalBessYD', 'SphericalHarmonics', 'sqrt', 'StartMSTimer', 'StatsBetaCDF', + 'StatsBetaPDF', 'StatsBinomialCDF', 'StatsBinomialPDF', 'StatsCauchyCDF', + 'StatsCauchyPDF', 'StatsChiCDF', 'StatsChiPDF', 'StatsCMSSDCDF', + 'StatsCorrelation', 'StatsDExpCDF', 'StatsDExpPDF', 'StatsErlangCDF', + 'StatsErlangPDF', 'StatsErrorPDF', 'StatsEValueCDF', 'StatsEValuePDF', + 'StatsExpCDF', 'StatsExpPDF', 'StatsFCDF', 'StatsFPDF', 'StatsFriedmanCDF', + 'StatsGammaCDF', 'StatsGammaPDF', 'StatsGeometricCDF', 'StatsGeometricPDF', + 'StatsGEVCDF', 'StatsGEVPDF', 'StatsHyperGCDF', 'StatsHyperGPDF', + 'StatsInvBetaCDF', 'StatsInvBinomialCDF', 'StatsInvCauchyCDF', 'StatsInvChiCDF', + 'StatsInvCMSSDCDF', 'StatsInvDExpCDF', 'StatsInvEValueCDF', 'StatsInvExpCDF', + 'StatsInvFCDF', 'StatsInvFriedmanCDF', 'StatsInvGammaCDF', 'StatsInvGeometricCDF', + 'StatsInvKuiperCDF', 'StatsInvLogisticCDF', 'StatsInvLogNormalCDF', + 'StatsInvMaxwellCDF', 'StatsInvMooreCDF', 'StatsInvNBinomialCDF', + 'StatsInvNCChiCDF', 'StatsInvNCFCDF', 'StatsInvNormalCDF', 'StatsInvParetoCDF', + 'StatsInvPoissonCDF', 'StatsInvPowerCDF', 'StatsInvQCDF', 'StatsInvQpCDF', 'StatsInvRayleighCDF', 'StatsInvRectangularCDF', 'StatsInvSpearmanCDF', 'StatsInvStudentCDF', 'StatsInvTopDownCDF', 'StatsInvTriangularCDF', 'StatsInvUsquaredCDF', 'StatsInvVonMisesCDF', 'StatsInvWeibullCDF', - 'StatsKuiperCDF', 'StatsLogisticCDF', 'StatsLogisticPDF', - 'StatsLogNormalCDF', 'StatsLogNormalPDF', 'StatsMaxwellCDF', - 'StatsMaxwellPDF', 'StatsMedian', 'StatsMooreCDF', 'StatsNBinomialCDF', - 'StatsNBinomialPDF', 'StatsNCChiCDF', 'StatsNCChiPDF', 'StatsNCFCDF', - 'StatsNCFPDF', 'StatsNCTCDF', 'StatsNCTPDF', 'StatsNormalCDF', - 'StatsNormalPDF', 'StatsParetoCDF', 'StatsParetoPDF', 'StatsPermute', - 'StatsPoissonCDF', 'StatsPoissonPDF', 'StatsPowerCDF', - 'StatsPowerNoise', 'StatsPowerPDF', 'StatsQCDF', 'StatsQpCDF', - 'StatsRayleighCDF', 'StatsRayleighPDF', 'StatsRectangularCDF', - 'StatsRectangularPDF', 'StatsRunsCDF', 'StatsSpearmanRhoCDF', - 'StatsStudentCDF', 'StatsStudentPDF', 'StatsTopDownCDF', + 'StatsKuiperCDF', 'StatsLogisticCDF', 'StatsLogisticPDF', 'StatsLogNormalCDF', + 'StatsLogNormalPDF', 'StatsMaxwellCDF', 'StatsMaxwellPDF', 'StatsMedian', + 'StatsMooreCDF', 'StatsNBinomialCDF', 'StatsNBinomialPDF', 'StatsNCChiCDF', + 'StatsNCChiPDF', 'StatsNCFCDF', 'StatsNCFPDF', 'StatsNCTCDF', 'StatsNCTPDF', + 'StatsNormalCDF', 'StatsNormalPDF', 'StatsParetoCDF', 'StatsParetoPDF', + 'StatsPermute', 'StatsPoissonCDF', 'StatsPoissonPDF', 'StatsPowerCDF', + 'StatsPowerNoise', 'StatsPowerPDF', 'StatsQCDF', 'StatsQpCDF', 'StatsRayleighCDF', + 'StatsRayleighPDF', 'StatsRectangularCDF', 'StatsRectangularPDF', 'StatsRunsCDF', + 'StatsSpearmanRhoCDF', 'StatsStudentCDF', 'StatsStudentPDF', 'StatsTopDownCDF', 'StatsTriangularCDF', 'StatsTriangularPDF', 'StatsTrimmedMean', - 'StatsUSquaredCDF', 'StatsVonMisesCDF', 'StatsVonMisesNoise', - 'StatsVonMisesPDF', 'StatsWaldCDF', 'StatsWaldPDF', 'StatsWeibullCDF', - 'StatsWeibullPDF', 'StopMSTimer', 'str2num', 'stringCRC', 'stringmatch', - 'strlen', 'strsearch', 'StudentA', 'StudentT', 'sum', 'SVAR_Exists', - 'TagVal', 'tan', 'tanh', 'ThreadGroupCreate', 'ThreadGroupRelease', - 'ThreadGroupWait', 'ThreadProcessorCount', 'ThreadReturnValue', 'ticks', - 'trunc', 'Variance', 'vcsr', 'WaveCRC', 'WaveDims', 'WaveExists', - 'WaveMax', 'WaveMin', 'WaveRefsEqual', 'WaveType', 'WhichListItem', - 'WinType', 'WNoise', 'x2pnt', 'xcsr', 'zcsr', 'ZernikeR', - ) - functions += ( - 'AddListItem', 'AnnotationInfo', 'AnnotationList', 'AxisInfo', - 'AxisList', 'CaptureHistory', 'ChildWindowList', 'CleanupName', - 'ContourInfo', 'ContourNameList', 'ControlNameList', 'CsrInfo', - 'CsrWave', 'CsrXWave', 'CTabList', 'DataFolderDir', 'date', - 'DDERequestString', 'FontList', 'FuncRefInfo', 'FunctionInfo', - 'FunctionList', 'FunctionPath', 'GetDataFolder', 'GetDefaultFont', - 'GetDimLabel', 'GetErrMessage', 'GetFormula', - 'GetIndependentModuleName', 'GetIndexedObjName', 'GetIndexedObjNameDFR', - 'GetRTErrMessage', 'GetRTStackInfo', 'GetScrapText', 'GetUserData', - 'GetWavesDataFolder', 'GrepList', 'GuideInfo', 'GuideNameList', 'Hash', - 'IgorInfo', 'ImageInfo', 'ImageNameList', 'IndexedDir', 'IndexedFile', - 'JulianToDate', 'LayoutInfo', 'ListMatch', 'LowerStr', 'MacroList', - 'NameOfWave', 'note', 'num2char', 'num2istr', 'num2str', - 'OperationList', 'PadString', 'ParseFilePath', 'PathList', 'PICTInfo', - 'PICTList', 'PossiblyQuoteName', 'ProcedureText', 'RemoveByKey', - 'RemoveEnding', 'RemoveFromList', 'RemoveListItem', - 'ReplaceNumberByKey', 'ReplaceString', 'ReplaceStringByKey', - 'Secs2Date', 'Secs2Time', 'SelectString', 'SortList', - 'SpecialCharacterInfo', 'SpecialCharacterList', 'SpecialDirPath', - 'StringByKey', 'StringFromList', 'StringList', 'StrVarOrDefault', - 'TableInfo', 'TextFile', 'ThreadGroupGetDF', 'time', 'TraceFromPixel', - 'TraceInfo', 'TraceNameList', 'UniqueName', 'UnPadString', 'UpperStr', - 'VariableList', 'WaveInfo', 'WaveList', 'WaveName', 'WaveUnits', - 'WinList', 'WinName', 'WinRecreation', 'XWaveName', - 'ContourNameToWaveRef', 'CsrWaveRef', 'CsrXWaveRef', - 'ImageNameToWaveRef', 'NewFreeWave', 'TagWaveRef', 'TraceNameToWaveRef', - 'WaveRefIndexed', 'XWaveRefFromTrace', 'GetDataFolderDFR', - 'GetWavesDataFolderDFR', 'NewFreeDataFolder', 'ThreadGroupGetDFR', + 'StatsUSquaredCDF', 'StatsVonMisesCDF', 'StatsVonMisesNoise', 'StatsVonMisesPDF', + 'StatsWaldCDF', 'StatsWaldPDF', 'StatsWeibullCDF', 'StatsWeibullPDF', + 'StopMSTimer', 'StringByKey', 'stringCRC', 'StringFromList', 'StringList', + 'stringmatch', 'strlen', 'strsearch', 'StrVarOrDefault', 'str2num', 'StudentA', + 'StudentT', 'sum', 'SVAR_Exists', 'TableInfo', 'TagVal', 'TagWaveRef', 'tan', + 'tanh', 'TextEncodingCode', 'TextEncodingName', 'TextFile', 'ThreadGroupCreate', + 'ThreadGroupGetDF', 'ThreadGroupGetDFR', 'ThreadGroupRelease', 'ThreadGroupWait', + 'ThreadProcessorCount', 'ThreadReturnValue', 'ticks', 'time', 'TraceFromPixel', + 'TraceInfo', 'TraceNameList', 'TraceNameToWaveRef', 'trunc', 'UniqueName', + 'UnPadString', 'UnsetEnvironmentVariable', 'UpperStr', 'URLDecode', 'URLEncode', + 'VariableList', 'Variance', 'vcsr', 'Voigt', 'VoigtFit', 'VoigtFitBL', + 'VoigtFit1Shape', 'VoigtFit1ShapeBL', 'VoigtFit1Shape1Width', + 'VoigtFit1Shape1WidthBL', 'VoigtFunc', 'WaveCRC', 'WaveDims', 'WaveExists', + 'WaveInfo', 'WaveList', 'WaveMax', 'WaveMin', 'WaveName', 'WaveRefIndexed', + 'WaveRefIndexedDFR', 'WaveRefsEqual', 'WaveRefWaveToList', 'WaveTextEncoding', + 'WaveType', 'WaveUnits', 'WhichListItem', 'WinList', 'WinName', 'WinRecreation', + 'WinType', 'WMFindWholeWord', 'WNoise', 'xcsr', 'XWaveName', 'XWaveRefFromTrace', + 'x2pnt', 'zcsr', 'ZernikeR', 'zeta' ) tokens = { @@ -272,7 +280,7 @@ class IgorLexer(RegexLexer): # Built-in functions. (words(functions, prefix=r'\b', suffix=r'\b'), Name.Function), # Compiler directives. - (r'^#(include|pragma|define|ifdef|ifndef|endif)', + (r'^#(include|pragma|define|undef|ifdef|ifndef|if|elif|else|endif)', Name.Decorator), (r'[^a-z"/]+$', Text), (r'.', Text), diff --git a/pygments/lexers/julia.py b/pygments/lexers/julia.py index cf7c7d61..d0aa6d35 100644 --- a/pygments/lexers/julia.py +++ b/pygments/lexers/julia.py @@ -65,7 +65,7 @@ class JuliaLexer(RegexLexer): bygroups(Keyword, Name.Function), 'funcname'), # types - (r'(type|typealias|abstract)((?:\s|\\\s)+)', + (r'(type|typealias|abstract|immutable)((?:\s|\\\s)+)', bygroups(Keyword, Name.Class), 'typename'), # operators @@ -132,14 +132,23 @@ class JuliaLexer(RegexLexer): 'string': [ (r'"', String, '#pop'), (r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings - (r'\$(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?', - String.Interpol), - (r'[^\\"$]+', String), - # quotes, dollar signs, and backslashes must be parsed one at a time - (r'["\\]', String), - # unhandled string formatting sign - (r'\$', String) + # Interpolation is defined as "$" followed by the shortest full + # expression, which is something we can't parse. + # Include the most common cases here: $word, and $(paren'd expr). + (r'\$[a-zA-Z_]+', String.Interpol), + (r'\$\(', String.Interpol, 'in-intp'), + # @printf and @sprintf formats + (r'%[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[diouxXeEfFgGcrs%]', + String.Interpol), + (r'[^$%"\\]+', String), + # unhandled special signs + (r'[$%"\\]', String), ], + 'in-intp': [ + (r'[^()]+', String.Interpol), + (r'\(', String.Interpol, '#push'), + (r'\)', String.Interpol, '#pop'), + ] } def analyse_text(text): diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py index c05c8ae0..9433f7fd 100644 --- a/pygments/lexers/python.py +++ b/pygments/lexers/python.py @@ -213,6 +213,26 @@ class Python3Lexer(RegexLexer): uni_name = "[%s][%s]*" % (uni.xid_start, uni.xid_continue) + def innerstring_rules(ttype): + return [ + # the old style '%s' % (...) string formatting (still valid in Py3) + (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?' + '[hlL]?[diouxXeEfFgGcrs%]', String.Interpol), + # the new style '{}'.format(...) string formatting + (r'\{' + '((\w+)((\.\w+)|(\[[^\]]+\]))*)?' # field name + '(\![sra])?' # conversion + '(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[bcdeEfFgGnosxX%]?)?' + '\}', String.Interpol), + + # backslashes, quotes and formatting signs must be parsed one at a time + (r'[^\\\'"%\{\n]+', ttype), + (r'[\'"\\]', ttype), + # unhandled string formatting sign + (r'%|(\{{1,2})', ttype) + # newlines are an error (use "nl" state) + ] + tokens = PythonLexer.tokens.copy() tokens['keywords'] = [ (words(( @@ -295,23 +315,8 @@ class Python3Lexer(RegexLexer): (uni_name, Name.Namespace), default('#pop'), ] - tokens['strings'] = [ - # the old style '%s' % (...) string formatting (still valid in Py3) - (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?' - '[hlL]?[diouxXeEfFgGcrs%]', String.Interpol), - # the new style '{}'.format(...) string formatting - (r'\{' - '((\w+)((\.\w+)|(\[[^\]]+\]))*)?' # field name - '(\![sra])?' # conversion - '(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[bcdeEfFgGnosxX%]?)?' - '\}', String.Interpol), - # backslashes, quotes and formatting signs must be parsed one at a time - (r'[^\\\'"%\{\n]+', String), - (r'[\'"\\]', String), - # unhandled string formatting sign - (r'%|(\{{1,2})', String) - # newlines are an error (use "nl" state) - ] + tokens['strings-single'] = innerstring_rules(String.Single) + tokens['strings-double'] = innerstring_rules(String.Double) def analyse_text(text): return shebang_matches(text, r'pythonw?3(\.\d)?') diff --git a/pygments/lexers/rdf.py b/pygments/lexers/rdf.py index cb634ee0..103b4ad0 100644 --- a/pygments/lexers/rdf.py +++ b/pygments/lexers/rdf.py @@ -29,43 +29,56 @@ class SparqlLexer(RegexLexer): filenames = ['*.rq', '*.sparql'] mimetypes = ['application/sparql-query'] + # character group definitions :: + + PN_CHARS_BASE_GRP = (u'a-zA-Z' + u'\u00c0-\u00d6' + u'\u00d8-\u00f6' + u'\u00f8-\u02ff' + u'\u0370-\u037d' + u'\u037f-\u1fff' + u'\u200c-\u200d' + u'\u2070-\u218f' + u'\u2c00-\u2fef' + u'\u3001-\ud7ff' + u'\uf900-\ufdcf' + u'\ufdf0-\ufffd' + u'\U00010000-\U000effff') + + PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_') + + PN_CHARS_GRP = (PN_CHARS_U_GRP + + r'\-' + + r'0-9' + + u'\u00b7' + + u'\u0300-\u036f' + + u'\u203f-\u2040') + + HEX_GRP = '0-9A-Fa-f' + + PN_LOCAL_ESC_CHARS_GRP = r' _~.\-!$&""()*+,;=/?#@%' + # terminal productions :: - PN_CHARS_BASE = (u'(?:[a-zA-Z' - u'\u00c0-\u00d6' - u'\u00d8-\u00f6' - u'\u00f8-\u02ff' - u'\u0370-\u037d' - u'\u037f-\u1fff' - u'\u200c-\u200d' - u'\u2070-\u218f' - u'\u2c00-\u2fef' - u'\u3001-\ud7ff' - u'\uf900-\ufdcf' - u'\ufdf0-\ufffd]|' - u'[^\u0000-\uffff]|' - u'[\ud800-\udbff][\udc00-\udfff])') + PN_CHARS_BASE = '[' + PN_CHARS_BASE_GRP + ']' - PN_CHARS_U = '(?:' + PN_CHARS_BASE + '|_)' + PN_CHARS_U = '[' + PN_CHARS_U_GRP + ']' - PN_CHARS = ('(?:' + PN_CHARS_U + r'|[\-0-9' + - u'\u00b7' + - u'\u0300-\u036f' + - u'\u203f-\u2040])') + PN_CHARS = '[' + PN_CHARS_GRP + ']' - HEX = '[0-9A-Fa-f]' + HEX = '[' + HEX_GRP + ']' - PN_LOCAL_ESC_CHARS = r'[ _~.\-!$&""()*+,;=/?#@%]' + PN_LOCAL_ESC_CHARS = '[' + PN_LOCAL_ESC_CHARS_GRP + ']' IRIREF = r'<(?:[^<>"{}|^`\\\x00-\x20])*>' - BLANK_NODE_LABEL = '_:(?:' + PN_CHARS_U + '|[0-9])(?:(?:' + PN_CHARS + '|\.)*' + \ - PN_CHARS + ')?' + BLANK_NODE_LABEL = '_:[0-9' + PN_CHARS_U_GRP + '](?:[' + PN_CHARS_GRP + \ + '.]*' + PN_CHARS + ')?' - PN_PREFIX = PN_CHARS_BASE + '(?:(?:' + PN_CHARS + '|\.)*' + PN_CHARS + ')?' + PN_PREFIX = PN_CHARS_BASE + '(?:[' + PN_CHARS_GRP + '.]*' + PN_CHARS + ')?' - VARNAME = '(?:' + PN_CHARS_U + '|[0-9])(?:' + PN_CHARS_U + \ - u'|[0-9\u00b7\u0300-\u036f\u203f-\u2040])*' + VARNAME = u'[0-9' + PN_CHARS_U_GRP + '][' + PN_CHARS_U_GRP + \ + u'0-9\u00b7\u0300-\u036f\u203f-\u2040]*' PERCENT = '%' + HEX + HEX @@ -73,9 +86,9 @@ class SparqlLexer(RegexLexer): PLX = '(?:' + PERCENT + ')|(?:' + PN_LOCAL_ESC + ')' - PN_LOCAL = ('(?:(?:' + PN_CHARS_U + '|[:0-9])|' + PLX + ')' + - '(?:(?:(?:' + PN_CHARS + '|[.:])|' + PLX + ')*(?:(?:' + - PN_CHARS + '|:)|' + PLX + '))?') + PN_LOCAL = ('(?:[' + PN_CHARS_U_GRP + ':0-9' + ']|' + PLX + ')' + + '(?:(?:[' + PN_CHARS_GRP + '.:]|' + PLX + ')*(?:[' + + PN_CHARS_GRP + ':]|' + PLX + '))?') EXPONENT = r'[eE][+-]?\d+' diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index dc23d018..4145939e 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -35,6 +35,7 @@ class BashLexer(RegexLexer): name = 'Bash' aliases = ['bash', 'sh', 'ksh', 'shell'] filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', + '*.exheres-0', '*.exlib', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'PKGBUILD'] mimetypes = ['application/x-sh', 'application/x-shellscript'] diff --git a/pygments/lexers/templates.py b/pygments/lexers/templates.py index 1f2322cc..3e55b6ad 100644 --- a/pygments/lexers/templates.py +++ b/pygments/lexers/templates.py @@ -251,7 +251,7 @@ class VelocityLexer(RegexLexer): 'funcparams': [ (r'\$\{?', Punctuation, 'variable'), (r'\s+', Text), - (r',', Punctuation), + (r'[,:]', Punctuation), (r'"(\\\\|\\"|[^"])*"', String.Double), (r"'(\\\\|\\'|[^'])*'", String.Single), (r"0[xX][0-9a-fA-F]+[Ll]?", Number), @@ -259,6 +259,8 @@ class VelocityLexer(RegexLexer): (r'(true|false|null)\b', Keyword.Constant), (r'\(', Punctuation, '#push'), (r'\)', Punctuation, '#pop'), + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), (r'\[', Punctuation, '#push'), (r'\]', Punctuation, '#pop'), ] @@ -875,7 +877,7 @@ class GenshiMarkupLexer(RegexLexer): # yield style and script blocks as Other (r'<\s*(script|style)\s*.*?>.*?<\s*/\1\s*>', Other), (r'<\s*py:[a-zA-Z0-9]+', Name.Tag, 'pytag'), - (r'<\s*[a-zA-Z0-9:]+', Name.Tag, 'tag'), + (r'<\s*[a-zA-Z0-9:.]+', Name.Tag, 'tag'), include('variable'), (r'[<$]', Other), ], diff --git a/pygments/lexers/typoscript.py b/pygments/lexers/typoscript.py new file mode 100644 index 00000000..25bfef9c --- /dev/null +++ b/pygments/lexers/typoscript.py @@ -0,0 +1,225 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers.typoscript + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for TypoScript + + `TypoScriptLexer` + A TypoScript lexer. + + `TypoScriptCssDataLexer` + Lexer that highlights markers, constants and registers within css. + + `TypoScriptHtmlDataLexer` + Lexer that highlights markers, constants and registers within html tags. + + :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, using +from pygments.token import Keyword, Text, Comment, Name, String, Number, \ + Operator, Punctuation +from pygments.lexer import DelegatingLexer +from pygments.lexers.web import HtmlLexer, CssLexer + +__all__ = ['TypoScriptLexer', 'TypoScriptCssDataLexer', 'TypoScriptHtmlDataLexer'] + + +class TypoScriptCssDataLexer(RegexLexer): + """ + Lexer that highlights markers, constants and registers within css blocks. + + .. versionadded:: 2.2 + """ + + name = 'TypoScriptCssData' + aliases = ['typoscriptcssdata'] + + tokens = { + 'root': [ + # marker: ###MARK### + (r'(.*)(###\w+###)(.*)', bygroups(String, Name.Constant, String)), + # constant: {$some.constant} + (r'(\{)(\$)((?:[\w\-_]+\.)*)([\w\-_]+)(\})', + bygroups(String.Symbol, Operator, Name.Constant, + Name.Constant, String.Symbol)), # constant + # constant: {register:somevalue} + (r'(.*)(\{)([\w\-_]+)(\s*:\s*)([\w\-_]+)(\})(.*)', + bygroups(String, String.Symbol, Name.Constant, Operator, + Name.Constant, String.Symbol, String)), # constant + # whitespace + (r'\s+', Text), + # comments + (r'/\*(?:(?!\*/).)*\*/', Comment), + (r'(?<!(#|\'|"))(?:#(?!(?:[a-fA-F0-9]{6}|[a-fA-F0-9]{3}))[^\n#]+|//[^\n]*)', + Comment), + # other + (r'[<>,:=\.\*%+\|]', String), + (r'[\w"_\-!\/&;\(\)\{\}]+', String), + ] + } + + +class TypoScriptHtmlDataLexer(RegexLexer): + """ + Lexer that highlights markers, constants and registers within html tags. + + .. versionadded:: 2.2 + """ + + name = 'TypoScriptHtmlData' + aliases = ['typoscripthtmldata'] + + tokens = { + 'root': [ + # INCLUDE_TYPOSCRIPT + (r'(INCLUDE_TYPOSCRIPT)', Name.Class), + # Language label or extension resource FILE:... or LLL:... or EXT:... + (r'(EXT|FILE|LLL):[^\}\n"]*', String), + # marker: ###MARK### + (r'(.*)(###\w+###)(.*)', bygroups(String, Name.Constant, String)), + # constant: {$some.constant} + (r'(\{)(\$)((?:[\w\-_]+\.)*)([\w\-_]+)(\})', + bygroups(String.Symbol, Operator, Name.Constant, + Name.Constant, String.Symbol)), # constant + # constant: {register:somevalue} + (r'(.*)(\{)([\w\-_]+)(\s*:\s*)([\w\-_]+)(\})(.*)', + bygroups(String, String.Symbol, Name.Constant, Operator, + Name.Constant, String.Symbol, String)), # constant + # whitespace + (r'\s+', Text), + # other + (r'[<>,:=\.\*%+\|]', String), + (r'[\w"_\-!\/&;\(\)\{\}#]+', String), + ] + } + + +class TypoScriptLexer(RegexLexer): + """ + Lexer for TypoScript code. + + http://docs.typo3.org/typo3cms/TyposcriptReference/ + + .. versionadded:: 2.2 + """ + + name = 'TypoScript' + aliases = ['typoscript'] + filenames = ['*.ts', '*.txt'] + mimetypes = ['text/x-typoscript'] + + flags = re.DOTALL | re.MULTILINE + + tokens = { + 'root': [ + include('comment'), + include('constant'), + include('html'), + include('label'), + include('whitespace'), + include('keywords'), + include('punctuation'), + include('operator'), + include('structure'), + include('literal'), + include('other'), + ], + 'keywords': [ + # Conditions + (r'(\[)(?i)(browser|compatVersion|dayofmonth|dayofweek|dayofyear|' + r'device|ELSE|END|GLOBAL|globalString|globalVar|hostname|hour|IP|' + r'language|loginUser|loginuser|minute|month|page|PIDinRootline|' + r'PIDupinRootline|system|treeLevel|useragent|userFunc|usergroup|' + r'version)([^\]]*)(\])', + bygroups(String.Symbol, Name.Constant, Text, String.Symbol)), + # Functions + (r'(?=[\w\-_])(HTMLparser|HTMLparser_tags|addParams|cache|encapsLines|' + r'filelink|if|imageLinkWrap|imgResource|makelinks|numRows|numberFormat|' + r'parseFunc|replacement|round|select|split|stdWrap|strPad|tableStyle|' + r'tags|textStyle|typolink)(?![\w\-_])', Name.Function), + # Toplevel objects and _* + (r'(?:(=?\s*<?\s+|^\s*))(cObj|field|config|content|constants|FEData|' + r'file|frameset|includeLibs|lib|page|plugin|register|resources|sitemap|' + r'sitetitle|styles|temp|tt_[^:\.\n\s]*|types|xmlnews|INCLUDE_TYPOSCRIPT|' + r'_CSS_DEFAULT_STYLE|_DEFAULT_PI_VARS|_LOCAL_LANG)(?![\w\-_])', + bygroups(Operator, Name.Builtin)), + # Content objects + (r'(?=[\w\-_])(CASE|CLEARGIF|COA|COA_INT|COBJ_ARRAY|COLUMNS|CONTENT|' + r'CTABLE|EDITPANEL|FILE|FILES|FLUIDTEMPLATE|FORM|HMENU|HRULER|HTML|' + r'IMAGE|IMGTEXT|IMG_RESOURCE|LOAD_REGISTER|MEDIA|MULTIMEDIA|OTABLE|' + r'PAGE|QTOBJECT|RECORDS|RESTORE_REGISTER|SEARCHRESULT|SVG|SWFOBJECT|' + r'TEMPLATE|TEXT|USER|USER_INT)(?![\w\-_])', Name.Class), + # Menu states + (r'(?=[\w\-_])(ACT|ACTIFSUB|ACTIFSUBRO|ACTRO|CUR|CURIFSUB|CURIFSUBRO|' + r'CURRO|IFSUB|IFSUBRO|NO|SPC|USERDEF1|USERDEF1RO|USERDEF2|USERDEF2RO|' + r'USR|USRRO)', Name.Class), + # Menu objects + (r'(?=[\w\-_])(GMENU|GMENU_FOLDOUT|GMENU_LAYERS|IMGMENU|IMGMENUITEM|' + r'JSMENU|JSMENUITEM|TMENU|TMENUITEM|TMENU_LAYERS)', Name.Class), + # PHP objects + (r'(?=[\w\-_])(PHP_SCRIPT(_EXT|_INT)?)', Name.Class), + (r'(?=[\w\-_])(userFunc)(?![\w\-_])', Name.Function), + ], + 'whitespace': [ + (r'\s+', Text), + ], + 'html':[ + (r'<[^\s][^\n>]*>', using(TypoScriptHtmlDataLexer)), + (r'&[^;\n]*;', String), + (r'(_CSS_DEFAULT_STYLE)(\s*)(\()(?s)(.*(?=\n\)))', + bygroups(Name.Class, Text, String.Symbol, using(TypoScriptCssDataLexer))), + ], + 'literal': [ + (r'0x[0-9A-Fa-f]+t?',Number.Hex), + # (r'[0-9]*\.[0-9]+([eE][0-9]+)?[fd]?\s*(?:[^=])', Number.Float), + (r'[0-9]+', Number.Integer), + (r'(###\w+###)', Name.Constant), + ], + 'label': [ + # Language label or extension resource FILE:... or LLL:... or EXT:... + (r'(EXT|FILE|LLL):[^\}\n"]*', String), + # Path to a resource + (r'(?![^\w\-_])([\w\-_]+(?:/[\w\-_]+)+/?)([^\s]*\n)', + bygroups(String, String)), + ], + 'punctuation': [ + (r'[,\.]', Punctuation), + ], + 'operator': [ + (r'[<>,:=\.\*%+\|]', Operator), + ], + 'structure': [ + # Brackets and braces + (r'[\{\}\(\)\[\]\\\\]', String.Symbol), + ], + 'constant': [ + # Constant: {$some.constant} + (r'(\{)(\$)((?:[\w\-_]+\.)*)([\w\-_]+)(\})', + bygroups(String.Symbol, Operator, Name.Constant, + Name.Constant, String.Symbol)), # constant + # Constant: {register:somevalue} + (r'(\{)([\w\-_]+)(\s*:\s*)([\w\-_]+)(\})', + bygroups(String.Symbol, Name.Constant, Operator, + Name.Constant, String.Symbol)), # constant + # Hex color: #ff0077 + (r'(#[a-fA-F0-9]{6}\b|#[a-fA-F0-9]{3}\b)', String.Char) + ], + 'comment': [ + (r'(?<!(#|\'|"))(?:#(?!(?:[a-fA-F0-9]{6}|[a-fA-F0-9]{3}))[^\n#]+|//[^\n]*)', + Comment), + (r'/\*(?:(?!\*/).)*\*/', Comment), + (r'(\s*#\s*\n)', Comment), + ], + 'other': [ + (r'[\w"\-_!\/&;]+', Text), + ], + } + + def analyse_text(text): + if '<INCLUDE_TYPOSCRIPT:' in text: + return 1.0 diff --git a/pygments/styles/__init__.py b/pygments/styles/__init__.py index d7a0564a..4efd196e 100644 --- a/pygments/styles/__init__.py +++ b/pygments/styles/__init__.py @@ -41,6 +41,7 @@ STYLE_MAP = { 'lovelace': 'lovelace::LovelaceStyle', 'algol': 'algol::AlgolStyle', 'algol_nu': 'algol_nu::Algol_NuStyle', + 'arduino': 'arduino::ArduinoStyle' } diff --git a/pygments/styles/arduino.py b/pygments/styles/arduino.py index cb4d17b0..5b31bb84 100644 --- a/pygments/styles/arduino.py +++ b/pygments/styles/arduino.py @@ -29,7 +29,7 @@ class ArduinoStyle(Style): Comment: "#95a5a6", # class: 'c' Comment.Multiline: "", # class: 'cm' - Comment.Preproc: "#434f54", # class: 'cp' + Comment.Preproc: "#728E00", # class: 'cp' Comment.Single: "", # class: 'c1' Comment.Special: "", # class: 'cs' @@ -38,15 +38,15 @@ class ArduinoStyle(Style): Keyword.Declaration: "", # class: 'kd' Keyword.Namespace: "", # class: 'kn' Keyword.Pseudo: "#00979D", # class: 'kp' - Keyword.Reserved: "", # class: 'kr' + Keyword.Reserved: "#00979D", # class: 'kr' Keyword.Type: "#00979D", # class: 'kt' - Operator: "#434f54", # class: 'o' + Operator: "#728E00", # class: 'o' Operator.Word: "", # class: 'ow' Name: "#434f54", # class: 'n' Name.Attribute: "", # class: 'na' - Name.Builtin: "", # class: 'nb' + Name.Builtin: "#728E00", # class: 'nb' Name.Builtin.Pseudo: "", # class: 'bp' Name.Class: "", # class: 'nc' Name.Constant: "", # class: 'no' @@ -64,7 +64,7 @@ class ArduinoStyle(Style): Name.Variable.Global: "", # class: 'vg' Name.Variable.Instance: "", # class: 'vi' - Number: "#434f54", # class: 'm' + Number: "#8A7B52", # class: 'm' Number.Float: "", # class: 'mf' Number.Hex: "", # class: 'mh' Number.Integer: "", # class: 'mi' @@ -95,4 +95,4 @@ class ArduinoStyle(Style): Generic.Strong: "", # class: 'gs' Generic.Subheading: "", # class: 'gu' Generic.Traceback: "", # class: 'gt' - } + }
\ No newline at end of file diff --git a/pygments/styles/perldoc.py b/pygments/styles/perldoc.py index 47a097ca..eae6170d 100644 --- a/pygments/styles/perldoc.py +++ b/pygments/styles/perldoc.py @@ -41,7 +41,7 @@ class PerldocStyle(Style): Operator.Word: '#8B008B', Keyword: '#8B008B bold', - Keyword.Type: '#a7a7a7', + Keyword.Type: '#00688B', Name.Class: '#008b45 bold', Name.Exception: '#008b45 bold', diff --git a/pygments/token.py b/pygments/token.py index f31625ed..fa3b1e11 100644 --- a/pygments/token.py +++ b/pygments/token.py @@ -43,6 +43,14 @@ class _TokenType(tuple): def __repr__(self): return 'Token' + (self and '.' or '') + '.'.join(self) + def __copy__(self): + # These instances are supposed to be singletons + return self + + def __deepcopy__(self, memo): + # These instances are supposed to be singletons + return self + Token = _TokenType() diff --git a/scripts/debug_lexer.py b/scripts/debug_lexer.py index cedd0988..4b7db41a 100755 --- a/scripts/debug_lexer.py +++ b/scripts/debug_lexer.py @@ -109,6 +109,8 @@ def main(fn, lexer=None, options={}): lxcls = find_lexer_class(name) if lxcls is None: raise AssertionError('no lexer found for file %r' % fn) + print('Using lexer: %s (%s.%s)' % (lxcls.name, lxcls.__module__, + lxcls.__name__)) debug_lexer = False # if profile: # # does not work for e.g. ExtendedRegexLexers @@ -5,3 +5,6 @@ tag_date = true [aliases] release = egg_info -RDb '' upload = upload --sign --identity=36580288 + +[bdist_wheel] +universal = 1
\ No newline at end of file diff --git a/tests/examplefiles/99_bottles_of_beer.chpl b/tests/examplefiles/99_bottles_of_beer.chpl index 3629028d..cdc1e650 100644 --- a/tests/examplefiles/99_bottles_of_beer.chpl +++ b/tests/examplefiles/99_bottles_of_beer.chpl @@ -4,7 +4,7 @@ * by Brad Chamberlain and Steve Deitz * 07/13/2006 in Knoxville airport while waiting for flight home from * HPLS workshop - * compiles and runs with chpl compiler version 1.7.0 + * compiles and runs with chpl compiler version 1.12.0 * for more information, contact: chapel_info@cray.com * * @@ -71,10 +71,13 @@ proc computeAction(bottleNum) { // Modules... module M1 { var x = 10; + + var y = 13.0; } module M2 { - use M1; + use M1 except y; + use M1 only y; proc main() { writeln("M2 -> M1 -> x " + x); } @@ -148,10 +151,10 @@ class IntPair { var ip = new IntPair(17,2); write(ip); -var targetDom: {1..10}, +var targetDom = {1..10}, target: [targetDom] int; coforall i in targetDom with (ref target) { - targetDom[i] = i ** 3; + target[i] = i ** 3; } var wideOpen = 0o777, @@ -166,9 +169,11 @@ private module M3 { } private iter bar() { - + for i in 1..10 { + yield i; + } } private var x: int; -}
\ No newline at end of file +} diff --git a/tests/examplefiles/sparql.rq b/tests/examplefiles/sparql.rq index 70b594e1..d979d203 100644 --- a/tests/examplefiles/sparql.rq +++ b/tests/examplefiles/sparql.rq @@ -29,8 +29,8 @@ SELECT ?person (COUNT(?nick) AS ?nickCount) { ex:float5 .0e1 ; ex:float6 5e11 ; ex:float7 1. ; - ex:Ć "" ; - ex:č± "" ; + ex:aUnicodeĆExample "somestring" ; + ex:catName "Kitty", "Kitty_" ; # object list ex:escape "\n\u00c0\U00010000"; ex:catAge ?catage ; dcterms:description "Someone with a cat called \"cat\"."@en . # language tag diff --git a/tests/examplefiles/test.erl b/tests/examplefiles/test.erl index 5b983e75..d4ab4825 100644 --- a/tests/examplefiles/test.erl +++ b/tests/examplefiles/test.erl @@ -152,6 +152,18 @@ a_binary() -> a_list_comprehension() -> [X*2 || X <- [1,2,3]]. +a_map() -> + M0 = #{ a => 1, b => 2 }, + M1 = M0#{ b := 200 }. + +escape_sequences() -> + [ "\b\d\e\f\n\r\s\t\v\'\"\\" + , "\1\12\123" % octal + , "\x01" % short hex + , "\x{fff}" % long hex + , "\^a\^A" % control characters + ]. + map(Fun, [H|T]) -> [Fun(H) | map(Fun, T)]; diff --git a/tests/examplefiles/test.escript b/tests/examplefiles/test.escript new file mode 100644 index 00000000..3fafb803 --- /dev/null +++ b/tests/examplefiles/test.escript @@ -0,0 +1,4 @@ +#!/usr/bin/env escript + +main(_Args) -> + ok. diff --git a/tests/examplefiles/example.ts b/tests/examplefiles/typescript_example index 760e2543..760e2543 100644 --- a/tests/examplefiles/example.ts +++ b/tests/examplefiles/typescript_example diff --git a/tests/examplefiles/typoscript_example b/tests/examplefiles/typoscript_example new file mode 100644 index 00000000..e2fccf5d --- /dev/null +++ b/tests/examplefiles/typoscript_example @@ -0,0 +1,1930 @@ +# *************************************************************************** +# Notice: "styles." (and "temp.") objects are UNSET after template parsing! +# Use "lib." for persisting storage of objects. +# *************************************************************************** + +<INCLUDE_TYPOSCRIPT: source="FILE: EXT:www_tue_nl/Configuration/TypoScript/Setup/Root.ts"> + +page.80 = RECORDS +page.80 { + source = 1 + tables = tt_address + conf.tt_address = COA + conf.tt_address { + 20 = TEXT + 20.field = email + 20.typolink.parameter.field = email + } +} + + /* +page.200 = PHP_SCRIPT_EXT +page.200 { + 1 = TMENU + 1.wrap = <div style="width:200px; border: 1px solid;">|</div> + 1.expAll = 1 + 1.submenuObjSuffixes = a |*| |*| b + 1.NO.allWrap = <b>|</b><br/> + + 2 = TMENU + 2.NO.allWrap = <div style="background:red;">|</div> + + 2a = TMENU + 2a.NO.allWrap = <div style="background:yellow;">|</div> +* + 2b = TMENU + 2b.NO.allWrap = <div style="background:green;">|</div> +} +*/ + + # Add the CSS and JS files +page { + includeCSS { # comment at the end of a line + file99 = fileadmin/your-fancybox.css + } + includeJSFooter { + fancybox = fileadmin/your-fancybox.js + } +} + + # Change the default rendering of images to match lightbox requirements +tt_content.image.20.1.imageLinkWrap { + JSwindow = 0 + test = MyExtension\Path\To\Class + + directImageLink = 1 + linkParams.ATagParams { + dataWrap = class= "lightbox" rel="fancybox{field:uid}" + } +} + +tt_content.image.20.1.imageLinkWrap > +tt_content.image.20.1.imageLinkWrap = 1 +tt_content.image.20.1.imageLinkWrap { + enable = 1 + typolink { + # directly link to the recent image + parameter.cObject = IMG_RESOURCE + parameter.cObject.file.import.data = TSFE:lastImageInfo|origFile + parameter.cObject.file.maxW = {$styles.content.imgtext.maxW} + parameter.override.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT + title.field = imagecaption // title + title.split.token.char = 10 + title.if.isTrue.field = imagecaption // header + title.split.token.char = 10 + title.split.returnKey.data = register : IMAGE_NUM_CURRENT + parameter.cObject = IMG_RESOURCE + parameter.cObject.file.import.data = TSFE:lastImageInfo|origFile + ATagParams = target="_blank" + } +} + +10 = IMAGE +10 { + # point to the image + file = fileadmin/demo/lorem_ipsum/images/a4.jpg + # make it rather small + file.width = 80 + # add a link to tx_cms_showpic.php that shows the original image + imageLinkWrap = 1 + imageLinkWrap { + enable = 1 + # JSwindow = 1 + } +} + +# Clear out any constants in this reserved room! +styles.content > + +# get content +styles.content.get = CONTENT +styles.content.get { + table = tt_content + select.orderBy = sorting + select.where = colPos=0 + select.languageField = sys_language_uid +} + +# get content, left +styles.content.getLeft < styles.content.get +styles.content.getLeft.select.where = colPos=1 + +# get content, right +styles.content.getRight < styles.content.get +styles.content.getRight.select.where = colPos=2 + +# get content, margin +styles.content.getBorder < styles.content.get +styles.content.getBorder.select.where = colPos=3 + +# get news +styles.content.getNews < styles.content.get +styles.content.getNews.select.pidInList = {$styles.content.getNews.newsPid} + +# Edit page object: +styles.content.editPanelPage = COA +styles.content.editPanelPage { + 10 = EDITPANEL + 10 { + allow = toolbar,move,hide + label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.page + label.wrap = | <b>%s</b> + } +} + + + + + + + + + + + +# ********************************************************************* +# "lib." objects are preserved from unsetting after template parsing +# ********************************************************************* + +# Creates persistent ParseFunc setup for non-HTML content. This is recommended to use (as a reference!) +lib.parseFunc { + makelinks = 1 + makelinks.http.keep = {$styles.content.links.keep} + makelinks.http.extTarget = {$styles.content.links.extTarget} + makelinks.mailto.keep = path + tags { + link = TEXT + link { + current = 1 + typolink.parameter.data = parameters : allParams + typolink.extTarget = {$styles.content.links.extTarget} + typolink.target = {$styles.content.links.target} + parseFunc.constants =1 + } + } + allowTags = {$styles.content.links.allowTags} + denyTags = * + sword = <span class="csc-sword">|</span> + constants = 1 + + nonTypoTagStdWrap.HTMLparser = 1 + nonTypoTagStdWrap.HTMLparser { + keepNonMatchedTags = 1 + htmlSpecialChars = 2 + } +} + +# good old parsefunc in "styles.content.parseFunc" is created for backwards compatibility. Don't use it, just ignore. +styles.content.parseFunc < lib.parseFunc + +# Creates persistent ParseFunc setup for RTE content (which is mainly HTML) based on the "ts_css" transformation. +lib.parseFunc_RTE < lib.parseFunc +lib.parseFunc_RTE { + // makelinks > + # Processing <table> and <blockquote> blocks separately + externalBlocks = table, blockquote, dd, dl, ol, ul, div + externalBlocks { + # The blockquote content is passed into parseFunc again... + blockquote.stripNL=1 + blockquote.callRecursive=1 + blockquote.callRecursive.tagStdWrap.HTMLparser = 1 + blockquote.callRecursive.tagStdWrap.HTMLparser.tags.blockquote.overrideAttribs = style="margin-bottom:0;margin-top:0;" + + ol.stripNL=1 + ol.stdWrap.parseFunc = < lib.parseFunc + + ul.stripNL=1 + ul.stdWrap.parseFunc = < lib.parseFunc + + table.stripNL=1 + table.stdWrap.HTMLparser = 1 + table.stdWrap.HTMLparser.tags.table.fixAttrib.class { + default = contenttable + always = 1 + list = contenttable + } + table.stdWrap.HTMLparser.keepNonMatchedTags = 1 + table.HTMLtableCells=1 + table.HTMLtableCells { + default.callRecursive=1 + addChr10BetweenParagraphs=1 + } + div.stripNL = 1 + div.callRecursive = 1 + + # Definition list processing + dl < .div + dd < .div + } + nonTypoTagStdWrap.encapsLines { + encapsTagList = p,pre,h1,h2,h3,h4,h5,h6,hr,dt + remapTag.DIV = P + nonWrappedTag = P + innerStdWrap_all.ifBlank = + addAttributes.P.class = bodytext + addAttributes.P.class.setOnly=blank + } + nonTypoTagStdWrap.HTMLparser = 1 + nonTypoTagStdWrap.HTMLparser { + keepNonMatchedTags = 1 + htmlSpecialChars = 2 + } +} + + +# Content header: +lib.stdheader = COA +lib.stdheader { + + # Create align style-attribute for <Hx> tags + 2 = LOAD_REGISTER + 2.headerStyle.field = header_position + 2.headerStyle.required = 1 + 2.headerStyle.noTrimWrap = | style="text-align:|;"| + + # Create class="csc-firstHeader" attribute for <Hx> tags + 3 = LOAD_REGISTER + 3.headerClass = csc-firstHeader + 3.headerClass.if.value=1 + 3.headerClass.if.equals.data = cObj:parentRecordNumber + 3.headerClass.noTrimWrap = | class="|"| + + # Date format: + 5 = TEXT + 5.field = date + 5.if.isTrue.field = date + 5.strftime = %x + 5.wrap = <p class="csc-header-date">|</p> + 5.prefixComment = 2 | Header date: + + # This CASE cObject renders the header content: + # currentValue is set to the header data, possibly wrapped in link-tags. + 10 = CASE + 10.setCurrent { + field = header + htmlSpecialChars = 1 + typolink.parameter.field = header_link + } + 10.key.field = header_layout + 10.key.ifEmpty = {$content.defaultHeaderType} + 10.key.ifEmpty.override.data = register: defaultHeaderType + + 10.1 = TEXT + 10.1.current = 1 + 10.1.dataWrap = <h1{register:headerStyle}{register:headerClass}>|</h1> + + 10.2 < .10.1 + 10.2.dataWrap = <h2{register:headerStyle}{register:headerClass}>|</h2> + + 10.3 < .10.1 + 10.3.dataWrap = <h3{register:headerStyle}{register:headerClass}>|</h3> + + 10.4 < .10.1 + 10.4.dataWrap = <h4{register:headerStyle}{register:headerClass}>|</h4> + + 10.5 < .10.1 + 10.5.dataWrap = <h5{register:headerStyle}{register:headerClass}>|</h5> + + # Pops the used registers off the stack: + 98 = RESTORE_REGISTER + 99 = RESTORE_REGISTER + + # Post-processing: + stdWrap.fieldRequired = header + stdWrap.if { + equals.field = header_layout + value = 100 + negate = 1 + } + + stdWrap.editIcons = tt_content : header, [header_layout | header_position], [header_link|date] + stdWrap.editIcons.beforeLastTag = 1 + stdWrap.editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.header + + stdWrap.dataWrap = <div class="csc-header csc-header-n{cObj:parentRecordNumber}">|</div> + stdWrap.prefixComment = 2 | Header: +} + + + + + + + + + + + + + + + +#****************************************************** +# Including library for processing of some elements: +#****************************************************** +includeLibs.tx_cssstyledcontent_pi1 = EXT:css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php + + +#********************************** +# tt_content is started +#********************************** +tt_content > +tt_content = CASE +tt_content.key.field = CType +tt_content.stdWrap { + innerWrap.cObject = CASE + innerWrap.cObject { + key.field = section_frame + + default = COA + default { + 10 = TEXT + 10 { + value = <div id="c{field:uid}" + override.cObject = TEXT + override.cObject { + value = <div + if.value = div + if.equals.field = CType + } + insertData = 1 + } + + 15 = TEXT + 15 { + value = csc-default + noTrimWrap = | class="|" | + required = 1 + } + + 20 = COA + 20 { + 10 = COA + 10 { + 10 = TEXT + 10 { + value = {$content.spaceBefore} + wrap = |+ + if.isTrue = {$content.spaceBefore} + } + + 20 = TEXT + 20 { + field = spaceBefore + } + + stdWrap { + prioriCalc = intval + wrap = margin-top:|px; + required = 1 + ifEmpty.value = + } + } + + 20 = COA + 20 { + 10 = TEXT + 10 { + value = {$content.spaceAfter} + wrap = |+ + if.isTrue = {$content.spaceAfter} + } + + 20 = TEXT + 20 { + field = spaceAfter + } + + stdWrap { + prioriCalc = intval + wrap = margin-bottom:|px; + required = 1 + ifEmpty.value = + } + } + + stdWrap.noTrimWrap = | style="|" | + stdWrap.required = 1 + } + 30 = TEXT + 30.value = >|</div> + } + + 1 =< tt_content.stdWrap.innerWrap.cObject.default + 1.15.value = csc-frame csc-frame-invisible + + 5 =< tt_content.stdWrap.innerWrap.cObject.default + 5.15.value = csc-frame csc-frame-rulerBefore + + 6 =< tt_content.stdWrap.innerWrap.cObject.default + 6.15.value = csc-frame csc-frame-rulerAfter + + 10 =< tt_content.stdWrap.innerWrap.cObject.default + 10.15.value = csc-frame csc-frame-indent + + 11 =< tt_content.stdWrap.innerWrap.cObject.default + 11.15.value = csc-frame csc-frame-indent3366 + + 12 =< tt_content.stdWrap.innerWrap.cObject.default + 12.15.value = csc-frame csc-frame-indent6633 + + 20 =< tt_content.stdWrap.innerWrap.cObject.default + 20.15.value = csc-frame csc-frame-frame1 + + 21 =< tt_content.stdWrap.innerWrap.cObject.default + 21.15.value = csc-frame csc-frame-frame2 + + 66 = COA + 66 { + 10 = TEXT + 10 { + value = <a id="c{field:uid}"></a> + insertData = 1 + } + + 20 = COA + 20 { + 10 = TEXT + 10 { + value = {$content.spaceBefore} + wrap = |+ + if.isTrue = {$content.spaceBefore} + } + + 20 = TEXT + 20 { + field = spaceBefore + } + + stdWrap { + prioriCalc = intval + wrap = margin-top:|px; + required = 1 + ifEmpty.value = + wrap2 = <div style="|"></div> + } + } + + 30 = TEXT + 30 { + value = | + } + + 40 < .20 + 40 { + 10 { + value = {$content.spaceAfter} + if.isTrue = {$content.spaceAfter} + } + 20.field = spaceAfter + stdWrap.wrap = margin-bottom:|px; + } + } + + } + + innerWrap2 = | <p class="csc-linkToTop"><a href="#">{LLL:EXT:css_styled_content/pi1/locallang.xml:label.toTop}</a></p> + innerWrap2.insertData = 1 + innerWrap2.fieldRequired = linkToTop + + prepend = TEXT + prepend.dataWrap = <a id="c{field:_LOCALIZED_UID}"></a> + prepend.if.isTrue.field = _LOCALIZED_UID + + editPanel = 1 + editPanel { + allow = move,new,edit,hide,delete + line = 5 + label = %s + onlyCurrentPid = 1 + previewBorder = 4 + edit.displayRecord = 1 + } + + prefixComment = 1 | CONTENT ELEMENT, uid:{field:uid}/{field:CType} +} + + + +# ***************** +# CType: header +# ***************** +# See Object path "lib.stdheader" +tt_content.header = COA +tt_content.header { + 10 = < lib.stdheader + + 20 = TEXT + 20 { + field = subheader + required = 1 + + dataWrap = <p class="csc-subheader csc-subheader-{field:layout}">|</p> + htmlSpecialChars = 1 + + editIcons = tt_content:subheader,layout + editIcons.beforeLastTag = 1 + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.subheader + + prefixComment = 2 | Subheader: + } +} + + + +# ***************** +# CType: text +# ***************** +tt_content.text = COA +tt_content.text { + 10 = < lib.stdheader + + 20 = TEXT + 20 { + field = bodytext + required = 1 + + parseFunc = < lib.parseFunc_RTE + + editIcons = tt_content:bodytext, rte_enabled + editIcons.beforeLastTag = 1 + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.bodytext + + prefixComment = 2 | Text: + } +} + + + +# ***************** +# CType: image +# ***************** +# (also used for rendering 'textpic' type): +tt_content.image = COA +tt_content.image.10 = < lib.stdheader +tt_content.image.20 = USER +tt_content.image.20 { + userFunc = tx_cssstyledcontent_pi1->render_textpic + + # Image source + imgList.field = image + imgPath = uploads/pics/ + + # Single image rendering + imgObjNum = 1 + 1 { + file.import.current = 1 + file.width.field = imagewidth + imageLinkWrap = 1 + imageLinkWrap { + bodyTag = <body style="margin:0; background:#fff;"> + wrap = <a href="javascript:close();"> | </a> + width = {$styles.content.imgtext.linkWrap.width} + height = {$styles.content.imgtext.linkWrap.height} + effects = {$styles.content.imgtext.linkWrap.effects} + + JSwindow = 1 + JSwindow.newWindow = {$styles.content.imgtext.linkWrap.newWindow} + JSwindow.if.isFalse = {$styles.content.imgtext.linkWrap.lightboxEnabled} + + directImageLink = {$styles.content.imgtext.linkWrap.lightboxEnabled} + + enable.field = image_zoom + enable.ifEmpty.typolink.parameter.field = image_link + enable.ifEmpty.typolink.parameter.listNum.splitChar = 10 + enable.ifEmpty.typolink.parameter.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT + enable.ifEmpty.typolink.returnLast = url + + typolink.parameter.field = image_link + typolink.parameter.listNum.splitChar = 10 + typolink.parameter.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT + typolink.target = {$styles.content.links.target} + typolink.extTarget = {$styles.content.links.extTarget} + + linkParams.ATagParams.dataWrap = class="{$styles.content.imgtext.linkWrap.lightboxCssClass}" rel="{$styles.content.imgtext.linkWrap.lightboxRelAttribute}" + } + + altText = TEXT + altText { + field = altText + stripHtml = 1 + split.token.char = 10 + split.token.if.isTrue = {$styles.content.imgtext.imageTextSplit} + split.returnKey.data = register : IMAGE_NUM_CURRENT + } + + titleText < .altText + titleText.field = titleText + + longdescURL < .altText + longdescURL.field = longdescURL + + emptyTitleHandling = {$styles.content.imgtext.emptyTitleHandling} + titleInLink = {$styles.content.imgtext.titleInLink} + titleInLinkAndImg = {$styles.content.imgtext.titleInLinkAndImg} + } + + textPos.field = imageorient + maxW = {$styles.content.imgtext.maxW} + maxW.override.data = register:maxImageWidth + maxWInText = {$styles.content.imgtext.maxWInText} + maxWInText.override.data = register:maxImageWidthInText + + equalH.field = imageheight + + image_compression.field = image_compression + image_effects.field = image_effects + + noRows.field = image_noRows + + cols.field = imagecols + border.field = imageborder + + caption { + 1 = TEXT + 1 { + field = imagecaption + required = 1 + parseFunc =< lib.parseFunc + br = 1 + split.token.char = 10 + split.token.if.isPositive = {$styles.content.imgtext.imageTextSplit} + {$styles.content.imgtext.captionSplit} + split.returnKey.data = register : IMAGE_NUM_CURRENT + } + } + # captionSplit is deprecated, use imageTextSplit instead + captionSplit = {$styles.content.imgtext.captionSplit} + captionAlign.field = imagecaption_position + # caption/alttext/title/longdescURL splitting + imageTextSplit = {$styles.content.imgtext.imageTextSplit} + + borderCol = {$styles.content.imgtext.borderColor} + borderThick = {$styles.content.imgtext.borderThick} + borderClass = {$styles.content.imgtext.borderClass} + colSpace = {$styles.content.imgtext.colSpace} + rowSpace = {$styles.content.imgtext.rowSpace} + textMargin = {$styles.content.imgtext.textMargin} + + borderSpace = {$styles.content.imgtext.borderSpace} + separateRows = {$styles.content.imgtext.separateRows} + addClasses = + addClassesImage = + addClassesImage.ifEmpty = csc-textpic-firstcol csc-textpic-lastcol + addClassesImage.override = csc-textpic-firstcol |*| |*| csc-textpic-lastcol + addClassesImage.override.if { + isGreaterThan.field = imagecols + value = 1 + } + + # + imageStdWrap.dataWrap = <div class="csc-textpic-imagewrap" style="width:{register:totalwidth}px;"> | </div> + imageStdWrapNoWidth.wrap = <div class="csc-textpic-imagewrap"> | </div> + + # if noRows is set, wrap around each column: + imageColumnStdWrap.dataWrap = <div class="csc-textpic-imagecolumn" style="width:{register:columnwidth}px;"> | </div> + + layout = CASE + layout { + key.field = imageorient + # above-center + default = TEXT + default.value = <div class="csc-textpic csc-textpic-center csc-textpic-above###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div> + # above-right + 1 = TEXT + 1.value = <div class="csc-textpic csc-textpic-right csc-textpic-above###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div> + # above-left + 2 = TEXT + 2.value = <div class="csc-textpic csc-textpic-left csc-textpic-above###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div> + # below-center + 8 = TEXT + 8.value = <div class="csc-textpic csc-textpic-center csc-textpic-below###CLASSES###">###TEXT######IMAGES###</div><div class="csc-textpic-clear"><!-- --></div> + # below-right + 9 = TEXT + 9.value = <div class="csc-textpic csc-textpic-right csc-textpic-below###CLASSES###">###TEXT######IMAGES###</div><div class="csc-textpic-clear"><!-- --></div> + # below-left + 10 = TEXT + 10.value = <div class="csc-textpic csc-textpic-left csc-textpic-below###CLASSES###">###TEXT######IMAGES###</div><div class="csc-textpic-clear"><!-- --></div> + # intext-right + 17 = TEXT + 17.value = <div class="csc-textpic csc-textpic-intext-right###CLASSES###">###IMAGES######TEXT###</div> + 17.override = <div class="csc-textpic csc-textpic-intext-right###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div> + 17.override.if.isTrue = {$styles.content.imgtext.addIntextClearer} + # intext-left + 18 = TEXT + 18.value = <div class="csc-textpic csc-textpic-intext-left###CLASSES###">###IMAGES######TEXT###</div> + 18.override = <div class="csc-textpic csc-textpic-intext-left###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div> + 18.override.if.isTrue = {$styles.content.imgtext.addIntextClearer} + # intext-right-nowrap + 25 = TEXT + 25.value = <div class="csc-textpic csc-textpic-intext-right-nowrap###CLASSES###">###IMAGES###<div style="margin-right:{register:rowWidthPlusTextMargin}px;">###TEXT###</div></div><div class="csc-textpic-clear"><!-- --></div> + 25.insertData = 1 + # intext-left-nowrap + 26 = TEXT + 26.value = <div class="csc-textpic csc-textpic-intext-left-nowrap###CLASSES###">###IMAGES###<div style="margin-left:{register:rowWidthPlusTextMargin}px;">###TEXT###</div></div><div class="csc-textpic-clear"><!-- --></div> + 26.insertData = 1 + } + + rendering { + dl { + # Choose another rendering for special edge cases + fallbackRendering = COA + fallbackRendering { + # Just one image without a caption => don't need the dl-overhead, use the "simple" rendering + 10 = TEXT + 10 { + if { + isFalse.field = imagecaption + value = 1 + equals.data = register:imageCount + } + value = simple + } + + # Multiple images and one global caption => "ul" + 20 = TEXT + 20 { + if { + value = 1 + isGreaterThan.data = register:imageCount + isTrue.if.isTrue.data = register:renderGlobalCaption + isTrue.field = imagecaption + } + value = ul + } + + # Multiple images and no caption at all => "ul" + 30 = TEXT + 30 { + if { + value = 1 + isGreaterThan.data = register:imageCount + isFalse.field = imagecaption + } + value = ul + } + } + imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow" style="width:{register:rowwidth}px;"> | </div> + imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last" style="width:{register:rowwidth}px;"> | </div> + noRowsStdWrap.wrap = + oneImageStdWrap.dataWrap = <dl class="csc-textpic-image###CLASSES###" style="width:{register:imagespace}px;"> | </dl> + imgTagStdWrap.wrap = <dt> | </dt> + editIconsStdWrap.wrap = <dd> | </dd> + caption { + required = 1 + wrap = <dd class="csc-textpic-caption"> | </dd> + } + } + ul { + # Just one image without a caption => don't need the ul-overhead, use the "simple" rendering + fallbackRendering < tt_content.image.20.rendering.dl.fallbackRendering.10 + imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow" style="width:{register:rowwidth}px;"><ul> | </ul></div> + imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last" style="width:{register:rowwidth}px;"><ul> | </ul></div> + noRowsStdWrap.wrap = <ul> | </ul> + oneImageStdWrap.dataWrap = <li class="csc-textpic-image###CLASSES###" style="width:{register:imagespace}px;"> | </li> + imgTagStdWrap.wrap = + editIconsStdWrap.wrap = <div> | </div> + caption.wrap = <div class="csc-textpic-caption"> | </div> + } + div { + # Just one image without a caption => don't need the div-overhead, use the "simple" rendering + fallbackRendering < tt_content.image.20.rendering.dl.fallbackRendering.10 + imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow" style="width:{register:rowwidth}px;"> | </div> + imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last" style="width:{register:rowwidth}px;"> | </div> + noRowsStdWrap.wrap = + oneImageStdWrap.dataWrap = <div class="csc-textpic-image###CLASSES###" style="width:{register:imagespace}px;"> | </div> + imgTagStdWrap.wrap = <div> | </div> + editIconsStdWrap.wrap = <div> | </div> + caption.wrap = <div class="csc-textpic-caption"> | </div> + } + simple { + imageRowStdWrap.dataWrap = | + imageLastRowStdWrap.dataWrap = | + noRowsStdWrap.wrap = + oneImageStdWrap.dataWrap = | + imgTagStdWrap.wrap = | + editIconsStdWrap.wrap = | + caption.wrap = <div class="csc-textpic-caption"> | </div> + imageStdWrap.dataWrap = <div class="csc-textpic-imagewrap csc-textpic-single-image" style="width:{register:totalwidth}px;"> | </div> + imageStdWrapNoWidth.wrap = <div class="csc-textpic-imagewrap csc-textpic-single-image"> | </div> + } + } + renderMethod = dl + + editIcons = tt_content : image [imageorient|imagewidth|imageheight], [imagecols|image_noRows|imageborder],[image_link|image_zoom],[image_compression|image_effects|image_frames],imagecaption[imagecaption_position] + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.images + + caption.editIcons = tt_content : imagecaption[imagecaption_position] + caption.editIcons.beforeLastTag=1 + caption.editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.caption + + stdWrap.prefixComment = 2 | Image block: +} + +# ***************** +# CType: textpic +# ***************** +tt_content.textpic = COA +tt_content.textpic { + 10 = COA + 10.if.value = 25 + 10.if.isLessThan.field = imageorient + 10.10 = < lib.stdheader + + 20 = < tt_content.image.20 + 20 { + text.10 = COA + text.10 { + if.value = 24 + if.isGreaterThan.field = imageorient + 10 = < lib.stdheader + 10.stdWrap.dataWrap = <div class="csc-textpicHeader csc-textpicHeader-{field:imageorient}">|</div> + } + text.20 = < tt_content.text.20 + text.wrap = <div class="csc-textpic-text"> | </div> + } +} + + + +# ***************** +# CType: bullet +# ***************** +tt_content.bullets = COA +tt_content.bullets { + 10 = < lib.stdheader + + 20 = TEXT + 20 { + field = bodytext + trim = 1 + split{ + token.char = 10 + cObjNum = |*|1|| 2|*| + 1.current = 1 + 1.parseFunc =< lib.parseFunc + 1.wrap = <li class="odd">|</li> + + 2.current = 1 + 2.parseFunc =< lib.parseFunc + 2.wrap = <li class="even">|</li> + } + dataWrap = <ul class="csc-bulletlist csc-bulletlist-{field:layout}">|</ul> + editIcons = tt_content: bodytext, [layout] + editIcons.beforeLastTag = 1 + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.php:eIcon.bullets + + prefixComment = 2 | Bullet list: + } +} + + + +# ***************** +# CType: table +# ***************** +# Rendered by a PHP function specifically written to handle CE tables. See css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php +tt_content.table = COA +tt_content.table { + 10 = < lib.stdheader + + 20 = USER + 20.userFunc = tx_cssstyledcontent_pi1->render_table + 20.field = bodytext + + 20.color { + default = + 1 = #EDEBF1 + 2 = #F5FFAA + } + 20.tableParams_0 { + border = + cellpadding = + cellspacing = + } + 20.tableParams_1 { + border = + cellpadding = + cellspacing = + } + 20.tableParams_2 { + border = + cellpadding = + cellspacing = + } + 20.tableParams_3 { + border = + cellpadding = + cellspacing = + } + 20.innerStdWrap.wrap = | + 20.innerStdWrap.parseFunc = < lib.parseFunc + + 20.stdWrap { + editIcons = tt_content: cols, bodytext, [layout], [table_bgColor|table_border|table_cellspacing|table_cellpadding] + editIcons.beforeLastTag = 1 + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.table + + prefixComment = 2 | Table: + } +} + + +# ***************** +# CType: uploads +# ***************** +# Rendered by a PHP function specifically written to handle CE filelists. See css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php +tt_content.uploads = COA +tt_content.uploads { + 10 = < lib.stdheader + + 20 = USER + 20.userFunc = tx_cssstyledcontent_pi1->render_uploads + 20.field = media + 20.filePath.field = select_key + + 20 { + # Rendering for each file (e.g. rows of the table) as a cObject + itemRendering = COA + itemRendering { + wrap = <tr class="tr-odd tr-first">|</tr> |*| <tr class="tr-even">|</tr> || <tr class="tr-odd">|</tr> |*| + + 10 = TEXT + 10.data = register:linkedIcon + 10.wrap = <td class="csc-uploads-icon">|</td> + 10.if.isPositive.field = layout + + 20 = COA + 20.wrap = <td class="csc-uploads-fileName">|</td> + 20.1 = TEXT + 20.1 { + data = register:linkedLabel + wrap = <p>|</p> + } + 20.2 = TEXT + 20.2 { + data = register:description + wrap = <p class="csc-uploads-description">|</p> + required = 1 + htmlSpecialChars = 1 + } + + 30 = TEXT + 30.if.isTrue.field = filelink_size + 30.data = register:fileSize + 30.wrap = <td class="csc-uploads-fileSize">|</td> + 30.bytes = 1 + 30.bytes.labels = {$styles.content.uploads.filesizeBytesLabels} + } + useSpacesInLinkText = 0 + stripFileExtensionFromLinkText = 0 + } + + 20.color { + default = + 1 = #EDEBF1 + 2 = #F5FFAA + } + 20.tableParams_0 { + border = + cellpadding = + cellspacing = + } + 20.tableParams_1 { + border = + cellpadding = + cellspacing = + } + 20.tableParams_2 { + border = + cellpadding = + cellspacing = + } + 20.tableParams_3 { + border = + cellpadding = + cellspacing = + } + + 20.linkProc { + target = _blank + jumpurl = {$styles.content.uploads.jumpurl} + jumpurl.secure = {$styles.content.uploads.jumpurl_secure} + jumpurl.secure.mimeTypes = {$styles.content.uploads.jumpurl_secure_mimeTypes} + removePrependedNumbers = 1 + + iconCObject = IMAGE + iconCObject.file.import.data = register : ICON_REL_PATH + iconCObject.file.width = 150 + } + + 20.filesize { + bytes = 1 + bytes.labels = {$styles.content.uploads.filesizeBytesLabels} + } + + 20.stdWrap { + editIcons = tt_content: media, layout [table_bgColor|table_border|table_cellspacing|table_cellpadding], filelink_size, imagecaption + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.filelist + + prefixComment = 2 | File list: + } +} + + +# ****************** +# CType: multimedia +# ****************** +tt_content.multimedia = COA +tt_content.multimedia { + 10 = < lib.stdheader + + 20 = MULTIMEDIA + 20.file.field = multimedia + 20.file.wrap = uploads/media/ + 20.file.listNum = 0 + 20.params.field = bodytext + + 20.stdWrap { + editIcons = tt_content: multimedia, bodytext + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia + + prefixComment = 2 | Multimedia element: + } +} + +# ***************** +# CType: swfobject +# ***************** +tt_content.swfobject = COA +tt_content.swfobject { + 10 = < lib.stdheader + + 20 = SWFOBJECT + 20 { + file = + width = + height = + + flexParams.field = pi_flexform + + alternativeContent.field = bodytext + + layout = ###SWFOBJECT### + + video { + player = {$styles.content.media.videoPlayer} + + defaultWidth = {$styles.content.media.defaultVideoWidth} + defaultHeight = {$styles.content.media.defaultVideoHeight} + + default { + params.quality = high + params.menu = false + params.allowScriptAccess = sameDomain + params.allowFullScreen = true + } + mapping { + + } + } + + audio { + player = {$styles.content.media.audioPlayer} + + defaultWidth = {$styles.content.media.defaultAudioWidth} + defaultHeight = {$styles.content.media.defaultAudioHeight} + + default { + params.quality = high + params.allowScriptAccess = sameDomain + params.menu = false + } + mapping { + flashvars.file = soundFile + } + } + + } + 20.stdWrap { + editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia + + prefixComment = 2 | SWFobject element: + } +} + +# ***************** +# CType: qtobject +# ***************** +tt_content.qtobject = COA +tt_content.qtobject { + 10 = < lib.stdheader + + 20 = QTOBJECT + 20 { + file = + width = + height = + + flexParams.field = pi_flexform + + alternativeContent.field = bodytext + + layout = ###QTOBJECT### + + video { + player = {$styles.content.media.videoPlayer} + + defaultWidth = {$styles.content.media.defaultVideoWidth} + defaultHeight = {$styles.content.media.defaultVideoHeight} + + default { + params.quality = high + params.menu = false + params.allowScriptAccess = sameDomain + params.allowFullScreen = true + } + mapping { + + } + } + + audio { + player = {$styles.content.media.audioPlayer} + + defaultWidth = {$styles.content.media.defaultAudioWidth} + defaultHeight = {$styles.content.media.defaultAudioHeight} + + default { + params.quality = high + params.allowScriptAccess = sameDomain + params.menu = false + } + mapping { + flashvars.file = soundFile + } + } + } + 20.stdWrap { + editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia + + prefixComment = 2 | QTobject element: + } +} + +# ***************** +# CType: media +# ***************** +tt_content.media = COA +tt_content.media { + 10 = < lib.stdheader + + 20 = MEDIA + 20 { + + flexParams.field = pi_flexform + alternativeContent < tt_content.text.20 + alternativeContent.field = bodytext + + type = video + renderType = auto + allowEmptyUrl = 0 + forcePlayer = 1 + + fileExtHandler { + default = MEDIA + avi = MEDIA + asf = MEDIA + class = MEDIA + wmv = MEDIA + mp3 = SWF + mp4 = SWF + m4v = SWF + swa = SWF + flv = SWF + swf = SWF + mov = QT + m4v = QT + m4a = QT + } + + mimeConf.swfobject < tt_content.swfobject.20 + mimeConf.qtobject < tt_content.qtobject.20 + + } + 20.stdWrap { + editIcons = tt_content: pi_flexform, bodytext + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia + + prefixComment = 2 | Media element: + } +} + +# ****************** +# CType: mailform +# ****************** +tt_content.mailform = COA +tt_content.mailform.10 = < lib.stdheader +tt_content.mailform.20 = FORM +tt_content.mailform.20 { + accessibility = 1 + noWrapAttr=1 + formName = mailform + dontMd5FieldNames = 1 + layout = <div class="csc-mailform-field">###LABEL### ###FIELD###</div> + labelWrap.wrap = | + commentWrap.wrap = | + radioWrap.wrap = |<br /> + radioWrap.accessibilityWrap = <fieldset###RADIO_FIELD_ID###><legend>###RADIO_GROUP_LABEL###</legend>|</fieldset> + REQ = 1 + REQ.labelWrap.wrap = | + COMMENT.layout = <div class="csc-mailform-label">###LABEL###</div> + RADIO.layout = <div class="csc-mailform-field">###LABEL### <span class="csc-mailform-radio">###FIELD###</span></div> + LABEL.layout = <div class="csc-mailform-field">###LABEL### <span class="csc-mailform-label">###FIELD###</span></div> + target = {$styles.content.mailform.target} + goodMess = {$styles.content.mailform.goodMess} + badMess = {$styles.content.mailform.badMess} + redirect.field = pages + redirect.listNum = 0 + recipient.field = subheader + data.field = bodytext + locationData = 1 + hiddenFields.stdWrap.wrap = <div style="display:none;">|</div> + + params.radio = class="csc-mailform-radio" + params.check = class="csc-mailform-check" + params.submit = class="csc-mailform-submit" + + stdWrap.wrap = <fieldset class="csc-mailform"> | </fieldset> + stdWrap { + editIcons = tt_content: bodytext, pages, subheader + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.form + + prefixComment = 2 | Mail form inserted: + } +} + + +# ****************** +# CType: search +# ****************** +tt_content.search = COA +tt_content.search.10 = < lib.stdheader +# Result: +tt_content.search.20 = SEARCHRESULT +tt_content.search.20 { + allowedCols = pages.title-subtitle-keywords-description : tt_content.header-bodytext-imagecaption : tt_address.name-title-address-email-company-city-country : tt_links.title-note-note2-url : tt_board.subject-message-author-email : tt_calender.title-note : tt_products.title-note-itemnumber + languageField.tt_content = sys_language_uid + renderObj = COA + renderObj { + + 10 = TEXT + 10.field = pages_title + 10.htmlSpecialChars = 1 + 10.typolink { + parameter.field = uid + target = {$styles.content.searchresult.resultTarget} + additionalParams.data = register:SWORD_PARAMS + additionalParams.required = 1 + additionalParams.wrap = &no_cache=1 + } + 10.htmlSpecialChars = 1 + 10.wrap = <h3 class="csc-searchResultHeader">|</h3> + + 20 = COA + 20 { + 10 = TEXT + 10.field = tt_content_bodytext + 10.stripHtml = 1 + 10.htmlSpecialChars = 1 + } + 20.stdWrap.crop = 200 | ... + 20.stdWrap.wrap = <p class="csc-searchResult">|</p> + } + + layout = COA + layout { + wrap = <table border="0" cellspacing="0" cellpadding="2" class="csc-searchResultInfo"><tr> | </tr></table> ###RESULT### + + 10 = TEXT + 10.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.resultRange + 10.wrap = <td class="csc-searchResultRange"><p>|</p></td> + + 20 = TEXT + 20.value = ###PREV### ###NEXT### + 20.wrap = <td class="csc-searchResultPrevNext"><p>|</p></td> + } + + noResultObj = COA + noResultObj { + 10 = TEXT + 10.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.emptySearch + 10.wrap = <h3 class="csc-noSearchResultMsg">|</h3> + } + + next = TEXT + next.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchResultNext + + prev = TEXT + prev.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchResultPrev + + target = {$styles.content.searchresult.target} + range = 20 + + stdWrap.prefixComment = 2 | Search result: +} + +# Form: +tt_content.search.30 < tt_content.mailform.20 +tt_content.search.30 { + goodMess = {$styles.content.searchform.goodMess} + redirect > + recipient > + data > + dataArray { + 10.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchWord + 10.type = sword=input + 20.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchIn + 20.type = scols=select + 20.valueArray { + 10.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.headersKeywords + 10.value = pages.title-subtitle-keywords-description:tt_content.header + 20.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.pageContent + 20.value = tt_content.header-bodytext-imagecaption + } + 30.type = stype=hidden + 30.value = L0 + 40.type = submit=submit + 40.value.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchButton + } + type.field = pages + type.listNum = 0 + locationData = HTTP_POST_VARS + no_cache = 1 + + stdWrap.wrap = <table border="0" cellspacing="1" cellpadding="1" class="csc-searchform"> | </table> + stdWrap { + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.search + + prefixComment = 2 | Search form inserted: + } +} + + +# ****************** +# CType: login +# ****************** +tt_content.login < tt_content.mailform +tt_content.login.10 = < lib.stdheader +tt_content.login.20 { + goodMess = {$styles.content.loginform.goodMess} + redirect > + recipient > + data > + dataArray { + 10.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.username + 10.type = *user=input + 20.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.password + 20.type = *pass=password + 30.type = logintype=hidden + 30.value = login + 40.type = submit=submit + 40.value.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.login + } + type.field = pages + type.listNum = 0 + target = {$styles.content.loginform.target} + locationData = 0 + hiddenFields.pid = TEXT + hiddenFields.pid { + value = {$styles.content.loginform.pid} + override.field = pages + override.listNum = 1 + } + + stdWrap.wrap = <div class="csc-loginform"> | </div> + stdWrap { + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.login + + prefixComment = 2 | Login/Logout form: + } +} +[loginUser = *] +tt_content.login.20 { + dataArray > + dataArray { + 10.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.username + 10.label.wrap = | <!--###USERNAME###--> + 30.type = logintype=hidden + 30.value = logout + 40.type = submit=submit + 40.value.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.logout + } +} +[global] + + +# ****************** +# CType: splash +# ****************** +# Deprecated element. +# Still here for backwards compliance with plugins using the "text box" type. +tt_content.splash = CASE +tt_content.splash.key.field = splash_layout +tt_content.splash.stdWrap { + prefixComment = 2 | Textbox inserted (Deprecated) +} +tt_content.splash.default = COA +tt_content.splash.default { + 20 = CTABLE + 20 { + c.1 = < tt_content.text + lm.1 = IMAGE + lm.1.file { + import = uploads/pics/ + import.field = image + import.listNum = 0 + maxW.field = imagewidth + maxW.ifEmpty = 200 + } + cMargins = 30,0,0,0 + } +} +tt_content.splash.1 < tt_content.splash.default +tt_content.splash.1.20.lm.1.file > +tt_content.splash.1.20.lm.1.file = GIFBUILDER +tt_content.splash.1.20.lm.1.file { + XY = [10.w]+10,[10.h]+10 + backColor = {$content.splash.bgCol} + backColor.override.data = register:pageColor + format = jpg + 5 = BOX + 5.dimensions = 3,3,[10.w],[10.h] + 5.color = #333333 + 7 = EFFECT + 7.value = blur=99|blur=99|blur=99|blur=99|blur=99|blur=99|blur=99 + 10 = IMAGE + 10.file { + import = uploads/pics/ + import.field = image + import.listNum = 0 + maxW.field = imagewidth + maxW.ifEmpty = 200 + } +} +// The image frames are not available unless TypoScript code from styles.content.imgFrames.x is provided manually: +tt_content.splash.2 < tt_content.splash.default +#tt_content.splash.2.20.lm.1.file.m < styles.content.imgFrames.1 +tt_content.splash.3 < tt_content.splash.default +#tt_content.splash.3.20.lm.1.file.m < styles.content.imgFrames.2 + +// From plugin.postit1, if included: +tt_content.splash.20 = < plugin.postit1 + + + +# **************** +# CType: menu +# **************** +tt_content.menu = COA +tt_content.menu { + 10 = < lib.stdheader + + 20 = CASE + 20 { + key.field = menu_type + + # "Menu of these pages" + default = HMENU + default { + special = list + special.value.field = pages + wrap = <ul class="csc-menu csc-menu-def">|</ul> + 1 = TMENU + 1 { + target = {$PAGE_TARGET} + NO { + stdWrap.htmlSpecialChars = 1 + wrapItemAndSub = <li>|</li> + ATagTitle.field = description // title + } + noBlur = 1 + } + } + + # "Menu of subpages to these pages" + 1 < .default + 1 { + special = directory + wrap = <ul class="csc-menu csc-menu-1">|</ul> + } + + # "Sitemap - liststyle" + 2 = HMENU + 2 { + wrap = <div class="csc-sitemap">|</div> + 1 = TMENU + 1 { + target = {$PAGE_TARGET} + noBlur = 1 + expAll = 1 + wrap = <ul>|</ul> + NO { + stdWrap.htmlSpecialChars = 1 + wrapItemAndSub = <li>|</li> + ATagTitle.field = description // title + } + } + 2 < .1 + 3 < .1 + 4 < .1 + 5 < .1 + 6 < .1 + 7 < .1 + } + + # "Section index (pagecontent w/Index checked - liststyle)" + 3 < styles.content.get + 3 { + wrap = <ul class="csc-menu csc-menu-3">|</ul> + select.andWhere = sectionIndex!=0 + select.pidInList.override.field = pages + renderObj = TEXT + renderObj { + fieldRequired = header + trim = 1 + field = header + htmlSpecialChars = 1 + noBlur = 1 + wrap = <li class="csc-section">|</li> + typolink.parameter.field = pid + typolink.section.field = uid + } + } + + # "Menu of subpages to these pages (with abstract)" + 4 < .1 + 4 { + wrap = <dl class="csc-menu csc-menu-4">|</dl> + 1.NO { + wrapItemAndSub > + linkWrap = <dt>|</dt> + after { + data = field : abstract // field : description // field : subtitle + required = 1 + htmlSpecialChars = 1 + wrap = <dd>|</dd> + } + ATagTitle.field = description // title + } + } + + # "Recently updated pages" + 5 < .default + 5 { + wrap = <ul class="csc-menu csc-menu-5">|</ul> + special = updated + special { + maxAge = 3600*24*7 + excludeNoSearchPages = 1 + } + } + + # "Related pages (based on keywords)" + 6 < .default + 6 { + wrap = <ul class="csc-menu csc-menu-6">|</ul> + special = keywords + special { + excludeNoSearchPages = 1 + } + } + + # "Menu of subpages to these pages + sections - liststyle" + 7 < .1 + 7 { + wrap = <ul class="csc-menu csc-menu-7">|</ul> + 1.expAll = 1 + 2 < .1 + 2 { + sectionIndex = 1 + sectionIndex.type = header + wrap = <ul>|</ul> + NO.wrapItemAndSub = <li class="csc-section">|</li> + } + } + } + + 20.stdWrap { + editIcons = tt_content: menu_type, pages + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.menuSitemap + + prefixComment = 2 | Menu/Sitemap element: + } +} + + + +# **************** +# CType: shortcut +# **************** +# Should be a complete copy from the old static template "content (default)" +tt_content.shortcut = COA +tt_content.shortcut { + 20 = CASE + 20.key.field = layout + 20.0= RECORDS + 20.0 { + source.field = records + tables = {$content.shortcut.tables} + # THESE are OLD plugins. Modern plugins registers themselves automatically! + conf.tt_content = < tt_content + conf.tt_address = < tt_address + conf.tt_links = < tt_links + conf.tt_guest = < tt_guest + conf.tt_board = < tt_board + conf.tt_calender = < tt_calender + conf.tt_rating < tt_rating + conf.tt_products = < tt_products + conf.tt_news = < tt_news + conf.tt_poll = < plugin.tt_poll + } + 20.1= RECORDS + 20.1 { + source.field = records + tables = {$content.shortcut.tables} + conf.tt_poll = < plugin.tt_poll + conf.tt_poll.code = RESULT,SUBMITTEDVOTE + } + + 20.stdWrap { + editIcons = tt_content: records + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.recordList + + prefixComment = 2 | Inclusion of other records (by reference): + } +} + + +# **************** +# CType: list +# **************** +# Should be a complete copy from the old static template "content (default)" (except "lib.stdheader") +tt_content.list = COA +tt_content.list { + 10 = < lib.stdheader + + 20 = CASE + 20.key.field = list_type + 20 { + # LIST element references (NOT copy of objects!) + # THESE are OLD plugins. Modern plugins registers themselves automatically! + 3 = CASE + 3.key.field = layout + 3.0 = < plugin.tt_guest + + 4 = CASE + 4.key.field = layout + 4.0 = < plugin.tt_board_list + 4.1 = < plugin.tt_board_tree + + 2 = CASE + 2.key.field = layout + 2.0 = < plugin.tt_board_tree + + 5 = CASE + 5.key.field = layout + 5.0 = < plugin.tt_products + + 7 = CASE + 7.key.field = layout + 7.0 = < plugin.tt_calender + + 8 = CASE + 8.key.field = layout + 8.0 = < plugin.tt_rating + + 9 = CASE + 9.key.field = layout + 9.0 = < plugin.tt_news + + 11 = CASE + 11.key.field = layout + 11.0 = < plugin.tipafriend + + 20 = CASE + 20.key.field = layout + 20.0 = < plugin.feadmin.fe_users + + 21 = CASE + 21.key.field = layout + 21.0 = < plugin.feadmin.dmailsubscription + } + + 20.stdWrap { + editIcons = tt_content: list_type, layout, select_key, pages [recursive] + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.plugin + + prefixComment = 2 | Plugin inserted: + } +} + + +# **************** +# CType: script +# **************** +# OBSOLETE! Please make extensions instead. The "script" content element was meant for these custom purposes in the past. Today extensions will do the job better. +tt_content.script = TEXT +tt_content.script { + value = + + prefixComment = 2 | Script element (Deprecated) +} + + +# **************** +# CType: div +# **************** +tt_content.div = TEXT +tt_content.div { + value = <hr /> + wrap = <div class="divider">|</div> + prefixComment = 2 | Div element +} + + +# **************** +# CType: html +# **************** +# This truely IS a content object, launched from inside the PHP class of course. +# Should be a complete copy from the old static template "content (default)" +tt_content.html = TEXT +tt_content.html { + field = bodytext + + editIcons = tt_content: pages + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.html + + prefixComment = 2 | Raw HTML content: +} + + +# **************** +# Default error msg: +# **************** +tt_content.default = TEXT +tt_content.default { + field = CType + wrap = <p style="background-color: yellow;"><b>ERROR:</b> Content Element type "|" has no rendering definition!</p> + + prefixComment = 2 | Unknown element message: +} + +# ********************************************************************* +# ACCESSIBILTY MODE +# ********************************************************************* + + + + + + + +plugin.tx_cssstyledcontent._CSS_DEFAULT_STYLE ( + /* Captions */ + DIV.csc-textpic-caption-c .csc-textpic-caption { text-align: center; } + DIV.csc-textpic-caption-r .csc-textpic-caption { text-align: right; } + DIV.csc-textpic-caption-l .csc-textpic-caption { text-align: left; } + + /* Needed for noRows setting */ + DIV.csc-textpic DIV.csc-textpic-imagecolumn { float: left; display: inline; } + + /* Border just around the image */ + {$styles.content.imgtext.borderSelector} { + border: {$styles.content.imgtext.borderThick}px solid {$styles.content.imgtext.borderColor}; + padding: {$styles.content.imgtext.borderSpace}px {$styles.content.imgtext.borderSpace}px; + } + + DIV.csc-textpic-imagewrap { padding: 0; } + + DIV.csc-textpic IMG { border: none; } + + /* DIV: This will place the images side by side */ + DIV.csc-textpic DIV.csc-textpic-imagewrap DIV.csc-textpic-image { float: left; } + + /* UL: This will place the images side by side */ + DIV.csc-textpic DIV.csc-textpic-imagewrap UL { list-style: none; margin: 0; padding: 0; } + DIV.csc-textpic DIV.csc-textpic-imagewrap UL LI { float: left; margin: 0; padding: 0; } + + /* DL: This will place the images side by side */ + DIV.csc-textpic DIV.csc-textpic-imagewrap DL.csc-textpic-image { float: left; } + DIV.csc-textpic DIV.csc-textpic-imagewrap DL.csc-textpic-image DT { float: none; } + DIV.csc-textpic DIV.csc-textpic-imagewrap DL.csc-textpic-image DD { float: none; } + DIV.csc-textpic DIV.csc-textpic-imagewrap DL.csc-textpic-image DD IMG { border: none; } /* FE-Editing Icons */ + DL.csc-textpic-image { margin: 0; } + DL.csc-textpic-image DT { margin: 0; display: inline; } + DL.csc-textpic-image DD { margin: 0; } + + /* Clearer */ + DIV.csc-textpic-clear { clear: both; } + + /* Margins around images: */ + + /* Pictures on left, add margin on right */ + DIV.csc-textpic-left DIV.csc-textpic-imagewrap .csc-textpic-image, + DIV.csc-textpic-intext-left-nowrap DIV.csc-textpic-imagewrap .csc-textpic-image, + DIV.csc-textpic-intext-left DIV.csc-textpic-imagewrap .csc-textpic-image { + display: inline; /* IE fix for double-margin bug */ + margin-right: {$styles.content.imgtext.colSpace}px; + } + + /* Pictures on right, add margin on left */ + DIV.csc-textpic-right DIV.csc-textpic-imagewrap .csc-textpic-image, + DIV.csc-textpic-intext-right-nowrap DIV.csc-textpic-imagewrap .csc-textpic-image, + DIV.csc-textpic-intext-right DIV.csc-textpic-imagewrap .csc-textpic-image { + display: inline; /* IE fix for double-margin bug */ + margin-left: {$styles.content.imgtext.colSpace}px; + } + + /* Pictures centered, add margin on left */ + DIV.csc-textpic-center DIV.csc-textpic-imagewrap .csc-textpic-image { + display: inline; /* IE fix for double-margin bug */ + margin-left: {$styles.content.imgtext.colSpace}px; + } + DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-image .csc-textpic-caption { margin: 0; } + DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-image IMG { margin: 0; vertical-align:bottom; } + + /* Space below each image (also in-between rows) */ + DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-image { margin-bottom: {$styles.content.imgtext.rowSpace}px; } + DIV.csc-textpic-equalheight DIV.csc-textpic-imagerow { margin-bottom: {$styles.content.imgtext.rowSpace}px; display: block; } + DIV.csc-textpic DIV.csc-textpic-imagerow { clear: both; } + DIV.csc-textpic DIV.csc-textpic-single-image IMG { margin-bottom: {$styles.content.imgtext.rowSpace}px; } + + /* IE7 hack for margin between image rows */ + *+html DIV.csc-textpic DIV.csc-textpic-imagerow .csc-textpic-image { margin-bottom: 0; } + *+html DIV.csc-textpic DIV.csc-textpic-imagerow { margin-bottom: {$styles.content.imgtext.rowSpace}px; } + + /* No margins around the whole image-block */ + DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-firstcol { margin-left: 0px !important; } + DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-lastcol { margin-right: 0px !important; } + + /* Add margin from image-block to text (in case of "Text w/ images") */ + DIV.csc-textpic-intext-left DIV.csc-textpic-imagewrap, + DIV.csc-textpic-intext-left-nowrap DIV.csc-textpic-imagewrap { + margin-right: {$styles.content.imgtext.textMargin}px !important; + } + DIV.csc-textpic-intext-right DIV.csc-textpic-imagewrap, + DIV.csc-textpic-intext-right-nowrap DIV.csc-textpic-imagewrap { + margin-left: {$styles.content.imgtext.textMargin}px !important; + } + + /* Positioning of images: */ + + /* Above */ + DIV.csc-textpic-above DIV.csc-textpic-text { clear: both; } + + /* Center (above or below) */ + DIV.csc-textpic-center { text-align: center; /* IE-hack */ } + DIV.csc-textpic-center DIV.csc-textpic-imagewrap { margin: 0 auto; } + DIV.csc-textpic-center DIV.csc-textpic-imagewrap .csc-textpic-image { text-align: left; /* Remove IE-hack */ } + DIV.csc-textpic-center DIV.csc-textpic-text { text-align: left; /* Remove IE-hack */ } + + /* Right (above or below) */ + DIV.csc-textpic-right DIV.csc-textpic-imagewrap { float: right; } + DIV.csc-textpic-right DIV.csc-textpic-text { clear: right; } + + /* Left (above or below) */ + DIV.csc-textpic-left DIV.csc-textpic-imagewrap { float: left; } + DIV.csc-textpic-left DIV.csc-textpic-text { clear: left; } + + /* Left (in text) */ + DIV.csc-textpic-intext-left DIV.csc-textpic-imagewrap { float: left; } + + /* Right (in text) */ + DIV.csc-textpic-intext-right DIV.csc-textpic-imagewrap { float: right; } + + /* Right (in text, no wrap around) */ + DIV.csc-textpic-intext-right-nowrap DIV.csc-textpic-imagewrap { float: right; clear: both; } + /* Hide from IE5-mac. Only IE-win sees this. \*/ + * html DIV.csc-textpic-intext-right-nowrap .csc-textpic-text { height: 1%; } + /* End hide from IE5/mac */ + + /* Left (in text, no wrap around) */ + DIV.csc-textpic-intext-left-nowrap DIV.csc-textpic-imagewrap { float: left; clear: both; } + /* Hide from IE5-mac. Only IE-win sees this. \*/ + * html DIV.csc-textpic-intext-left-nowrap .csc-textpic-text, + * html .csc-textpic-intext-left ol, + * html .csc-textpic-intext-left ul { height: 1%; } + /* End hide from IE5/mac */ + + DIV.csc-textpic DIV.csc-textpic-imagerow-last { margin-bottom: 0; } + + /* Browser fixes: */ + + /* Fix for unordered and ordered list with image "In text, left" */ + .csc-textpic-intext-left ol, .csc-textpic-intext-left ul {padding-left: 40px; overflow: auto; } +) + +# TYPO3 SVN ID: $Id$ + diff --git a/tests/test_html_formatter.py b/tests/test_html_formatter.py index 567de51f..596d9fbc 100644 --- a/tests/test_html_formatter.py +++ b/tests/test_html_formatter.py @@ -116,7 +116,7 @@ class HtmlFormatterTest(unittest.TestCase): fmt = HtmlFormatter(**optdict) fmt.format(tokensource, outfile) html = outfile.getvalue() - self.assertTrue(re.search("<pre><a name=\"foo-1\">", html)) + self.assertTrue(re.search("<pre><span></span><a name=\"foo-1\">", html)) def test_lineanchors_with_startnum(self): optdict = dict(lineanchors="foo", linenostart=5) @@ -124,7 +124,7 @@ class HtmlFormatterTest(unittest.TestCase): fmt = HtmlFormatter(**optdict) fmt.format(tokensource, outfile) html = outfile.getvalue() - self.assertTrue(re.search("<pre><a name=\"foo-5\">", html)) + self.assertTrue(re.search("<pre><span></span><a name=\"foo-5\">", html)) def test_valid_output(self): # test all available wrappers diff --git a/tests/test_token.py b/tests/test_token.py index c96bd9ef..0c6b02bf 100644 --- a/tests/test_token.py +++ b/tests/test_token.py @@ -7,6 +7,7 @@ :license: BSD, see LICENSE for details. """ +import copy import unittest from pygments import token @@ -44,3 +45,10 @@ class TokenTest(unittest.TestCase): for k, v in t.items(): if len(v) > 1: self.fail("%r has more than one key: %r" % (k, v)) + + def test_copying(self): + # Token instances are supposed to be singletons, so copying or even + # deepcopying should return themselves + t = token.String + self.assertIs(t, copy.copy(t)) + self.assertIs(t, copy.deepcopy(t)) |