Discussion:
merge html5 tags into generic html
Olivier Sessink
2014-08-22 12:06:02 UTC
Permalink
Hi all,

we've had this discussion before: should we merge html5 into generic html?

who is willing to help with that?

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Abdelrahman Ayman
2014-08-22 23:59:22 UTC
Permalink
would you please explain more?

repsectfully
Olivier Sessink
2014-08-24 19:46:24 UTC
Permalink
Post by Abdelrahman Ayman
would you please explain more?
repsectfully
currently we have two different syntax modes, one for generic html
(without html5 tags) and one for html5. The proposal is to merge the
html5 tags into the generic html language file.

Information on language definition files can be found here:
http://bfwiki.tellefsen.net/index.php/Writing_language_definition_files

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius Rinkevicius
2014-08-24 04:52:11 UTC
Permalink
Olivier,
I already made too many promises for code fixing, one more would be
difficult to me.
At the moment I am trying to crack regex highlighting (there are also more
issues) in javascript bflang2 files. I fixed most of issues, like correct
highlighting of
document.location.search.match(/module=([a-zA-Z0-9_]*)/)) ? tmp[1] : '';
and so on.
There is one pattern that still do not works, like
var test = /word\//; - here I am trying to search for pattern "word/". The
point is that when we have two "//" the code always selects the first "/".
I could not find the way to define context for "\/" since it can have any
context symbol. If pattern scanner would have negated lookahead capability
like /(?!/) that would solve issue.
The definition I am current using is
<element id="js.regex" pattern="(=|+|-|\*)[ #&#9;&#10;&#13;]*/"
is_regex="1" highlight="js-brackets" >
<context symbols="/ ;.#&#9;&#10;&#13;" highlight="js-string">
<element pattern="/[gimy]*" is_regex="1" highlight="js-brackets"
ends_context="1" />
</context>
</element>
Any suggestions?
Andrius


On Fri, Aug 22, 2014 at 3:06 PM, Olivier Sessink <
Post by Olivier Sessink
Hi all,
we've had this discussion before: should we merge html5 into generic html?
who is willing to help with that?
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe bluefish-dev" in
panel at http://www.ems.ru/cgi-bin/listargate.cgi
Bluefish web site: http://bluefish.openoffice.nl/
Olivier Sessink
2014-08-24 19:51:00 UTC
Permalink
Post by Andrius Rinkevicius
Olivier,
I already made too many promises for code fixing, one more would be
difficult to me.
At the moment I am trying to crack regex highlighting (there are also
more issues) in javascript bflang2 files. I fixed most of issues, like
correct highlighting of
document.location.search.match(/module=([a-zA-Z0-9_]*)/)) ? tmp[1] : '';
and so on.
There is one pattern that still do not works, like
var test = /word\//; - here I am trying to search for pattern
"word/". The point is that when we have two "//" the code always
selects the first "/". I could not find the way to define context for
"\/" since it can have any context symbol. If pattern scanner would
have negated lookahead capability like /(?!/) that would solve issue.
The definition I am current using is
<element id="js.regex" pattern="(=|+|-|\*)[ #&#9;&#10;&#13;]*/"
is_regex="1" highlight="js-brackets" >
<context symbols="/ ;.#&#9;&#10;&#13;" highlight="js-string">
<element pattern="/[gimy]*" is_regex="1" highlight="js-brackets"
ends_context="1" />
</context>
</element>
Any suggestions?
do you have some test files so I can see the working and non-working
examples?

(this reminds me that we should really start to collect test-files in
subversion, so we can test various language files before release)

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius Rinkevicius
2014-08-26 18:09:39 UTC
Permalink
Olievier,
please find attached test file (which was prepared by Ur Balazs). I added
number of regex expressions at the end of the file.
I also including my latest versions of lang definitions I am complaining
about, which generally highlights regex correctly, but introduces other
issues: note colouring of objects and constants after '= '. Hopefully with
more debugging output we will be able to find the cause.
Andrius


On Sun, Aug 24, 2014 at 10:51 PM, Olivier Sessink <
Post by Andrius Rinkevicius
Olivier,
I already made too many promises for code fixing, one more would be
difficult to me.
At the moment I am trying to crack regex highlighting (there are also more
issues) in javascript bflang2 files. I fixed most of issues, like correct
highlighting of
document.location.search.match(/module=([a-zA-Z0-9_]*)/)) ? tmp[1] : '';
and so on.
There is one pattern that still do not works, like
var test = /word\//; - here I am trying to search for pattern "word/".
The point is that when we have two "//" the code always selects the first
"/". I could not find the way to define context for "\/" since it can have
any context symbol. If pattern scanner would have negated lookahead
capability like /(?!/) that would solve issue.
The definition I am current using is
<element id="js.regex" pattern="(=|+|-|\*)[ #&#9;&#10;&#13;]*/"
is_regex="1" highlight="js-brackets" >
<context symbols="/ ;.#&#9;&#10;&#13;" highlight="js-string">
<element pattern="/[gimy]*" is_regex="1" highlight="js-brackets"
ends_context="1" />
</context>
</element>
Any suggestions?
do you have some test files so I can see the working and non-working
examples?
(this reminds me that we should really start to collect test-files in
subversion, so we can test various language files before release)
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Olivier Sessink
2014-08-30 07:32:05 UTC
Permalink
Sorry for my late reply, I was very busy the last days.

I think I understand the issue. Your pattern makes the DFA engine go
into a separate path of states after it encounters =+-\*. It will then
scan for spacing until it encounters a /. If it encounters something
else than a /, there is no match, so it will reset the DFA state to the
startstate of the context.

So if you have the text "a=1;" it will reset to the startstate *after*
it has encountered the '1'. So the 1 is not scanned, the scanning
resumes at ';'. And thus the text 1 is not detected as 'js-value'.

So this pattern concept what you use cannot be used in Bluefish,
essentially because we use a pure DFA implementation, without lookahead
or lookbehind or backtracking. Very fast but limited if you want to use
these kind of constructions....

Can we in some way create a pattern that starts at the first '/' character?

Olivier
Post by Andrius Rinkevicius
Olivier,
please find attached test file (which was prepared by Ur Balazs). I
added number of regex expressions at the end of the file.
I also including my latest versions of lang definitions I am
complaining about, which generally highlights regex correctly, but
introduces other issues: note colouring of objects and constants after
'= '. Hopefully with more debugging output we will be able to find the
cause.
Andrius
On Sun, Aug 24, 2014 at 10:51 PM, Olivier Sessink
Post by Andrius Rinkevicius
Olivier,
I already made too many promises for code fixing, one more would
be difficult to me.
At the moment I am trying to crack regex highlighting (there are
also more issues) in javascript bflang2 files. I fixed most of
issues, like correct highlighting of
document.location.search.match(/module=([a-zA-Z0-9_]*)/)) ? tmp[1] : '';
and so on.
There is one pattern that still do not works, like
var test = /word\//; - here I am trying to search for pattern
"word/". The point is that when we have two "//" the code always
selects the first "/". I could not find the way to define context
for "\/" since it can have any context symbol. If pattern scanner
would have negated lookahead capability like /(?!/) that would
solve issue.
The definition I am current using is
<element id="js.regex" pattern="(=|+|-|\*)[ #&#9;&#10;&#13;]*/"
is_regex="1" highlight="js-brackets" >
<context symbols="/ ;.#&#9;&#10;&#13;" highlight="js-string">
<element pattern="/[gimy]*" is_regex="1" highlight="js-brackets"
ends_context="1" />
</context>
</element>
Any suggestions?
do you have some test files so I can see the working and
non-working examples?
(this reminds me that we should really start to collect test-files
in subversion, so we can test various language files before release)
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius Rinkevicius
2014-08-30 16:45:47 UTC
Permalink
Olivier,
thank for explanation. Now I see why I could not get it working.
The problem with "/" as pattern is that / is also division sign. Compare
this
test1 = /abc/;
test2 = abc / hello /gmi;
The second line is just division of variables, the only difference I am
seeing is that regex follows immediately after "=", without any extra
letters. For test2 type of expressions, even patters like
/[a-zA-Z0-9\?......]+/ might not work correctly.
Other issue, but maybe solvable" with /....../ type patters, is that
colouring will apply to both / and what is inside /.../ . Would be that OK?
Is there any way to change colours inside matched pattern? I could not find
any example with such a colour manipulation inside found pattern...
Andrius


On Sat, Aug 30, 2014 at 10:32 AM, Olivier Sessink <
Post by Olivier Sessink
Sorry for my late reply, I was very busy the last days.
I think I understand the issue. Your pattern makes the DFA engine go into
a separate path of states after it encounters =+-\*. It will then scan for
spacing until it encounters a /. If it encounters something else than a /,
there is no match, so it will reset the DFA state to the startstate of the
context.
So if you have the text "a=1;" it will reset to the startstate *after* it
has encountered the '1'. So the 1 is not scanned, the scanning resumes at
';'. And thus the text 1 is not detected as 'js-value'.
So this pattern concept what you use cannot be used in Bluefish,
essentially because we use a pure DFA implementation, without lookahead or
lookbehind or backtracking. Very fast but limited if you want to use these
kind of constructions....
Can we in some way create a pattern that starts at the first '/' character?
Olivier
Olivier,
please find attached test file (which was prepared by Ur Balazs). I added
number of regex expressions at the end of the file.
I also including my latest versions of lang definitions I am complaining
about, which generally highlights regex correctly, but introduces other
issues: note colouring of objects and constants after '= '. Hopefully with
more debugging output we will be able to find the cause.
Andrius
On Sun, Aug 24, 2014 at 10:51 PM, Olivier Sessink <
Post by Andrius Rinkevicius
Olivier,
I already made too many promises for code fixing, one more would be
difficult to me.
At the moment I am trying to crack regex highlighting (there are also
more issues) in javascript bflang2 files. I fixed most of issues, like
correct highlighting of
document.location.search.match(/module=([a-zA-Z0-9_]*)/)) ? tmp[1] : '';
and so on.
There is one pattern that still do not works, like
var test = /word\//; - here I am trying to search for pattern "word/".
The point is that when we have two "//" the code always selects the first
"/". I could not find the way to define context for "\/" since it can have
any context symbol. If pattern scanner would have negated lookahead
capability like /(?!/) that would solve issue.
The definition I am current using is
<element id="js.regex" pattern="(=|+|-|\*)[ #&#9;&#10;&#13;]*/"
is_regex="1" highlight="js-brackets" >
<context symbols="/ ;.#&#9;&#10;&#13;" highlight="js-string">
<element pattern="/[gimy]*" is_regex="1" highlight="js-brackets"
ends_context="1" />
</context>
</element>
Any suggestions?
do you have some test files so I can see the working and non-working
examples?
(this reminds me that we should really start to collect test-files in
subversion, so we can test various language files before release)
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius Rinkevicius
2014-08-31 16:41:35 UTC
Permalink
Olivier,
I made more testing with a = 1; and results looks a little bit confusing.
a = 1; - all letters black.
a = +1; - all letters black.
a = 0xAAAA; - all letters black.
a = .1; - "1" is blue, rest are black.
a = ,1; - "1" is blue, rest are black.
but
a = -1; "-1" is blue as it should be. Why "-" is so special? There are
regex patterns for js-value at the end of all-javascript.binc file, but
only pattern with "-" seems to produce correct result.
Any idea?
Andrius


On Sat, Aug 30, 2014 at 10:32 AM, Olivier Sessink <
Post by Olivier Sessink
Sorry for my late reply, I was very busy the last days.
I think I understand the issue. Your pattern makes the DFA engine go into
a separate path of states after it encounters =+-\*. It will then scan for
spacing until it encounters a /. If it encounters something else than a /,
there is no match, so it will reset the DFA state to the startstate of the
context.
So if you have the text "a=1;" it will reset to the startstate *after* it
has encountered the '1'. So the 1 is not scanned, the scanning resumes at
';'. And thus the text 1 is not detected as 'js-value'.
So this pattern concept what you use cannot be used in Bluefish,
essentially because we use a pure DFA implementation, without lookahead or
lookbehind or backtracking. Very fast but limited if you want to use these
kind of constructions....
Can we in some way create a pattern that starts at the first '/' character?
Olivier
Olivier,
please find attached test file (which was prepared by Ur Balazs). I added
number of regex expressions at the end of the file.
I also including my latest versions of lang definitions I am complaining
about, which generally highlights regex correctly, but introduces other
issues: note colouring of objects and constants after '= '. Hopefully with
more debugging output we will be able to find the cause.
Andrius
On Sun, Aug 24, 2014 at 10:51 PM, Olivier Sessink <
Post by Andrius Rinkevicius
Olivier,
I already made too many promises for code fixing, one more would be
difficult to me.
At the moment I am trying to crack regex highlighting (there are also
more issues) in javascript bflang2 files. I fixed most of issues, like
correct highlighting of
document.location.search.match(/module=([a-zA-Z0-9_]*)/)) ? tmp[1] : '';
and so on.
There is one pattern that still do not works, like
var test = /word\//; - here I am trying to search for pattern "word/".
The point is that when we have two "//" the code always selects the first
"/". I could not find the way to define context for "\/" since it can have
any context symbol. If pattern scanner would have negated lookahead
capability like /(?!/) that would solve issue.
The definition I am current using is
<element id="js.regex" pattern="(=|+|-|\*)[ #&#9;&#10;&#13;]*/"
is_regex="1" highlight="js-brackets" >
<context symbols="/ ;.#&#9;&#10;&#13;" highlight="js-string">
<element pattern="/[gimy]*" is_regex="1" highlight="js-brackets"
ends_context="1" />
</context>
</element>
Any suggestions?
do you have some test files so I can see the working and non-working
examples?
(this reminds me that we should really start to collect test-files in
subversion, so we can test various language files before release)
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Continue reading on narkive:
Loading...