Author Topic: Lexer not loaded with error  (Read 4000 times)

Offline JsProof

  • Single posting newcomer
  • *
  • Posts: 5
Lexer not loaded with error
« on: April 12, 2018, 08:53:47 am »
Hi! I wrote a lexer in xml for Javascript and added it to the lexers folder. When loading, Codeblocks says: "Scanning for lexers in C:\OJI\CodeBlocks\share\codeblocks/lexers/...
Found 47 lexers" and starts enumerating then, but when it reaches lexer_javascript is also prints
"failed
 TinyXML Error: Error document empty"

Due to my instalation of codeblocks, I was not able to find any scintilla folder (My school teacher gave me the link to install a kit that contained codeblocks) so I used index 64 instead for the lexer. But I don't think that is what causes the error.

How can I fix it? This is my xml file:

<?xml version="1.0" ?>
  <!DOCTYPE CodeBlocks_lexer_properties (View Source for full doctype...)>
- <CodeBlocks_lexer_properties>
- <Lexer name="Javascript" index="64" filemasks="*.js, *.ts">
  <Style name="Default" index="0" fg="0,0,0" bg="255,255,255" bold="0" italics="0" underlined="0" />
  <Style name="Comment" index="18" fg="180,180,180" />
  <Style name="Line Comment" index="11" fg="180,180,180" />
  <Style name="Doc comment" index="22" fg="0,127,0" bold="1" />
  <Style name="Number" index="123" fg="0,0,127" />
  <Style name="Word" index="7" fg="0,0,0" />
  <Style name="Keyword" index="1" fg="0,0,127" bold="1" />
  <Style name="Double quoted string" index="44" fg="74,119,67" />
  <Style name="Single quoted string" index="55" fg="74,119,67" />
  <Style name="Symbols" index="50" fg="127,0,0" bold="1" />
  <Style name="EOL" index="51" bg="180,180,0" />
  <Style name="RegEx" index="52" fg="255,230,50" />
  <Style name="Constructors/Capital letter Functions" index="9" fg="0,191,255" />
  <Style name="Global objects" index="5" fg="0,149,148" />
- <Keywords>
  <Set index="1" value="abstract as boolean break byte case catch char class const continue debugger default delete do double else enum export extends false final finally float for from function goto if implements import in instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with" />
  <Set index="9" value="Number String Boolean Array Object Function Symbol RegExp Math UInt8Array Worker Atomics [A-Z]\w+" />
  <Set index="5" value="" />
  </Keywords>
  <SampleCode value="lexer_javascript.sample" breakpoint_line="20" debug_line="22" error_line="23" />
  </Lexer>
  </CodeBlocks_lexer_properties>

(It's not finnished yet)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Lexer not loaded with error
« Reply #1 on: April 12, 2018, 09:08:25 am »
Are these '-' characters really there? At the start of 3 lines?
Have you tried if a xml validator will accept your file?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline JsProof

  • Single posting newcomer
  • *
  • Posts: 5
Re: Lexer not loaded with error
« Reply #2 on: April 12, 2018, 09:12:21 am »
No, those '-' are not there. I just copied and pasted the rendering of the xml file. (It renders, so I guess it's valid)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Lexer not loaded with error
« Reply #3 on: April 12, 2018, 10:41:49 am »
Please upload the whole file. It could be an encoding problem...
Also, what is the exact location of this file?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1562
Re: Lexer not loaded with error
« Reply #4 on: April 12, 2018, 12:28:33 pm »
You must remove the text in parentheses, change:

Code
<!DOCTYPE CodeBlocks_lexer_properties (View Source for full doctype...)>

to:

Code
<!DOCTYPE CodeBlocks_lexer_properties>

because DOCTYPE only accepts PUBLIC or SYSTEM keywords after the name

Offline JsProof

  • Single posting newcomer
  • *
  • Posts: 5
Re: Lexer not loaded with error
« Reply #5 on: April 12, 2018, 08:51:47 pm »
I do not have that part (between the paranthesis) nor the hyphens in the source file. That was just the rendering. I will edit the question

Offline JsProof

  • Single posting newcomer
  • *
  • Posts: 5
Re: Lexer not loaded with error
« Reply #6 on: April 12, 2018, 08:52:49 pm »
It looks like I can't edit the question  :(

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org