silvadias22 / snippely

Automatically exported from code.google.com/p/snippely
0 stars 0 forks source link

PHP Syntax bug #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Define a set of strings as default values for PHP class variables.
2. Remove input focus from the code field.

What is the expected output? What do you see instead?
See attached screenshot showing both expected output and actual output.

What version of the product are you using? On what operating system?
XP SP2, whatever Snippely version is available.

Please provide any additional information below.
Seems to happen in other places as well.  This is probably a bug in
whatever syntax highlighting library you are using, I doubt you wrote your
own.  If you let me know what library that is I can report this bug there,
or you guys can report it, or whatever lol.

Original issue reported on code.google.com by TJLeahy...@gmail.com on 31 Mar 2008 at 2:40

Attachments:

GoogleCodeExporter commented 8 years ago
"I doubt you wrote your own."

actually, Valerio did write it himself ;), though it is based on 
dp.SyntaxHighlighter. 
(http://googlecode.com/p/syntaxhighlighter)

the bug is in the regexp we are using for double quoted strings... thanks for 
the report, we're looking into a fix.

Original comment by tomocch...@gmail.com on 31 Mar 2008 at 2:52

GoogleCodeExporter commented 8 years ago
The problem is not just PHP.  To fix it change the RegExp in highlighter.js 
line 136 to:

doubleQuotedString: (/"(?:\.|(\\\\\")|[^\""\n])*"/g),

Original comment by mdes...@gmail.com on 10 Apr 2008 at 10:37

GoogleCodeExporter commented 8 years ago
By the way, is anyone maintaining snippely?  It has the potential to be an 
awesome
tool for devs of all kinds.

If someone is, here is the start of C# highlighter:

Brushes.CSharp = {

    'comment': [Highlighter.RegExps.singleLineComment,
Highlighter.RegExps.multiLineComment],

    'string': [Highlighter.RegExps.singleQuotedString,
Highlighter.RegExps.doubleQuotedString],

    'integer': Highlighter.RegExps.integer,

    'preprocessor': Highlighter.RegExps.preprocessor,

    'special': (/\$\w+/g),

    'keyword': 'abstract as base bool break byte case catch char checked class const ' +
        'continue decimal default delegate do double else enum event explicit ' +
        'extern false finally fixed float for foreach get goto if implicit in int ' +
        'interface internal is lock long namespace new null object operator out ' +
        'override params private protected public readonly ref return sbyte sealed set ' +
        'short sizeof stackalloc static string struct switch this throw true try ' +
        'typeof uint ulong unchecked unsafe ushort using virtual void while'
};

Original comment by mdes...@gmail.com on 10 Apr 2008 at 10:45

GoogleCodeExporter commented 8 years ago
fixed in r132

Original comment by tomocch...@gmail.com on 21 May 2008 at 11:01