Closed Jeremi360 closed 1 year ago
even if I added prints()
to check it in parser it self it didn't print any thing :/ even if I added !
or @
before show
and hide
:
_:
prints("Unhandled regex: ", line[0], result)
Rakugo.emit_signal("parser_unhandled_regex", line[0], result)
it seam like parser don't see show
and hide
at all - I thouthg that maybe it was intercepted by another regex, however, when he added prints to the parser, nothing appeared with it.
Here is part of my Rkscript:
hello_world
character test_ch "Test Character"
first_dialogue:
"Hello, world !"
show test show
hide test hide
jump menu_emily
menu menu_emily:
"Talk with emily" > emily_talk
"Wait"
"Blop" > test_dialog
and here is result from console:
CHARACTER_DEF: character test_ch "Test Character"
SAY: "Hello, world !"
JUMP: jump menu_emily
MENU: menu menu_emily:
SAY: "How are you ?"
Hello :) !
I use https://regex101.com/ to test Regex. I like possibility to hover tokens and explanations on right.
If I try "^show\s+(?\
Use a "\n" is not good, it wait a carriage return and a new line.
Use "\s+" inside
Maybe you can test with "^show (?\
$ for waiting end of line. Something like \n but it did not wait carriage return or new line. It is better.
I use https://regex101.com/ to test Regex. I like possibility to hover tokens and explanations on right.
I use this one https://regexr.com
If I try "^show\s+(?
[a-z]\s+)\n" with "show test show" not works. Use a "\n" is not good, it wait a carriage return and a new line.
Use "\s+" inside group is not good too.
Maybe you can test with "^show (?{NAME})$", it works with "show test". You have some exemples of regex in Parser.gd.
$ for waiting end of line. Something like \n but it did not wait carriage return or new line. It is better.
Okey I see and I tried this with "^show (?{NAME})$"
and as I expeted result is the same :(
CHARACTER_DEF: character test_ch "Test Character"
SAY: "Hello, world !"
JUMP: jump menu_emily
MENU: menu menu_emily:
I want to point out again part that my rkscript look like this:
hello_world # this an unhandled regex
character test_ch "Test Character"
first_dialogue:
"Hello, world !"
show test show # unhandled regex
hide test hide # unhandled regex
jump menu_emily
menu menu_emily:
"Talk with emily" > emily_talk
"Wait"
"Blop" > test_dialog
As you see there are 3 unhandled regexes and one is printed out by debug print I added to parser it self:
_:
prints("Unhandled regex: ", line[0], result)
Rakugo.emit_signal("parser_unhandled_regex", line[0], result)
@theludovyc You were right when I changed my regex to have NAME
only in {}
without []
then it worked :D
But this means also that unfortunately, now there is no error when the script has unsupported regex, do you think it can be solved somehow?
@Jeremi360 already handle error
You regex have no error, is just do not match what you want :)
@Jeremi360 already handle error
You regex have no error, is just do not match what you want :)
@theludovyc No, you totally misunderstood me, I didn't mean a bug in the regex, but that in the example script at the very beginning I had a totally unsupported expression hello_world
. I totally didn't notice it until this issue, because I didn't get any error about it and my point is that expressions not registered in the system are ignored instead of giving an error.
I think I get it. We have no error when parser read something it do not handle ?
I think I get it. We have no error when parser read something it do not handle ?
Exactly @theludovyc
I opened an issue #149
I think we can close this one
@theludovyc I have problem with
Rakugo.parser_add_regex_at_runtime()
: Here is my code:and in RkScript I added:
But nothing is printed and rest of script executes with out any problems. I also try using
\\s+(?<layers>[a-zA-Z0-9_s]+)
or even.+
instead of{NAME}
and still nothing in output. What I'm doing wrong ?