Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: JsProof on April 12, 2018, 08:53:47 am

Title: Lexer not loaded with error
Post by: JsProof 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)
Title: Re: Lexer not loaded with error
Post by: oBFusCATed 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?
Title: Re: Lexer not loaded with error
Post by: JsProof 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)
Title: Re: Lexer not loaded with error
Post by: BlueHazzard 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?
Title: Re: Lexer not loaded with error
Post by: Miguel Gimenez 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
Title: Re: Lexer not loaded with error
Post by: JsProof 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
Title: Re: Lexer not loaded with error
Post by: JsProof on April 12, 2018, 08:52:49 pm
It looks like I can't edit the question  :(
Title: Re: Lexer not loaded with error
Post by: stahta01 on April 13, 2018, 05:18:47 am
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)

The link says how to use code tags.

Tim S.