499 Private method to generate a dummy filename for binding a lexer. |
499 Private method to generate a dummy filename for binding a lexer. |
500 |
500 |
501 @param line0 first line of text to use in the generation process (string) |
501 @param line0 first line of text to use in the generation process (string) |
502 """ |
502 """ |
503 bindName = "" |
503 bindName = "" |
504 |
504 line0 = line0.lower() |
505 if line0.startswith("<?xml"): |
505 |
506 # override extension for XML files |
506 # check first line if it does not start with #! |
|
507 if line0.startswith(("<html", "<!doctype html", "<?php")): |
|
508 bindName = "dummy.html" |
|
509 elif line0.startswith(("<?xml", "<!doctype")): |
507 bindName = "dummy.xml" |
510 bindName = "dummy.xml" |
|
511 elif line0.startswith("index: "): |
|
512 bindName = "dummy.diff" |
|
513 elif line0.startswith("\\documentclass"): |
|
514 bindName = "dummy.tex" |
508 |
515 |
509 # check filetype |
516 # check filetype |
510 if not bindName and self.filetype: |
517 if not bindName and self.filetype: |
511 if self.filetype in ["Python", "Python2"]: |
518 if self.filetype in ["Python", "Python2"]: |
512 bindName = "dummy.py" |
519 bindName = "dummy.py" |