Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schemedef does not handle dashed for comments #6

Closed
ravecoyote opened this issue Jan 19, 2014 · 9 comments
Closed

schemedef does not handle dashed for comments #6

ravecoyote opened this issue Jan 19, 2014 · 9 comments

Comments

@ravecoyote
Copy link

Trying desperately to create a schemedef for AlanIF - an adventure language like Inform6.

For this I have to declare a double dash -- as the beginning of a line comment.
This seems to be completely ignored by PN. PN tries to parse the comment lines without recognizing them as comments.

Please help. This bug is driving me nuts.

@simonsteele
Copy link
Owner

Please attach the schemedef you're trying to use, I'll see if I can work out what's happening when I get some time.

@ravecoyote
Copy link
Author

Hi Simon,

attached you find the schemedef file.
I'd be really happy if you could help.

Thanks
Kristo

Simon Steele mailto:notifications@github.com
Mittwoch, 22. Januar 2014 11:51

Please attach the schemedef you're trying to use, I'll see if I can
work out what's happening when I get some time.


Reply to this email directly or view it on GitHub
#6 (comment).

@simonsteele
Copy link
Owner

Hmm, sadly attachments don't work for the github tracker. Please either put it in the text, or (better) follow the instructions here to create a gist and send me the link: ned14/BEurtle#1

@ravecoyote
Copy link
Author

Here's the download link for the relevant schemedef and a source sample
file:

http://ge.tt/5M1wwDG1?c

Cheers

Simon Steele mailto:notifications@github.com
Mittwoch, 22. Januar 2014 11:51

Please attach the schemedef you're trying to use, I'll see if I can
work out what's happening when I get some time.


Reply to this email directly or view it on GitHub
#6 (comment).

@simonsteele
Copy link
Owner

Ok, I think in this case it's because numbers have a higher priority than comments (which is perhaps a mistake). -- matches both your comment configuration, and also your number configuration (starts with -, contains -).

I think if you remove the ability to start a number with -, then it should work?

e.g.

<numbers start="[0-9]" content="[0-9.]" />

Let me know!

@ravecoyote
Copy link
Author

Hi Simon,

I've already tried that countless times.
But that doesn't seem to make any difference at all.

Cheers

Simon Steele schrieb:

||

@simonsteele
Copy link
Owner

Ah, apologies, so it's not just numbers that take preference but also keywords. If unspecified keywords have a start set that includes '-' as well. So the combination of these two works for me:

<keywords start="[a-zA-Z0-9_]" />
<numbers start="[0-9]" content="[0-9.]" />

@ravecoyote
Copy link
Author

Aaaaah... now that did it!
I'm really glad you could help me here.

One more question though:
Please take a quick look at this piece of Alan3 code:

Exit south To bar
Does
If cloak In hero Then
Locate hero At dark_bar.
Else
Locate hero At bar.
End If.
End Exit.

Can I somehow make PN recognize the integrity of such control structures.
Something like

Begin_keywords: If then in
Middle_keywords: else
End_keywords:"end if"

Cheers

Simon Steele schrieb:

@simonsteele
Copy link
Owner

There's no way to do this with a custom schemedef, you'd need to write a Scintilla lexer in C++ and it would be non-trivial - most lexers avoid needing to keep much state between lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants