Seperate styler from delimiter
-
Hello, I’m writing a BBCode-esque Language to make Flight Rising descriptions easier to write, and so far it’s pretty solid - I’m able to fold columns and lists, and highlight different BBCode in different colors.
Except there’s one minor problem and it’s I can’t fold indent.I have each BBCode as delimiters by doing
Open: [u [/uthenClose: ] ]because it’s the… only way I managed to get the language to work the way I hoped to achieve, but because I have [i] [/i] under delimiters, trying to add [indent] [/indent] in folding is overwritten by [i] [/i] delimiter all because both start with [i. If I doOpen: [ [andClose: i] /i], it messes with everything, removing the [i] [/i] from the delimiters fixes it but I too want to hightlight [i] [/i]. And I have yet to figure out how to make the Operators work with the Keywords and Delimiters, I read the entire document and I still have no idea.I was wondering how do I seperate them to allow [indent] [/indent] be foldable but also highlight [i] [/i]? Or better yet, if anyone has a better format/organization for the language to get what I hope to achieve work? Here’s the format and the delimiters, the ----- is under keywords as a non-prefix.
-
Delimiters are meant when you want the contents between a pair of tokens, along with those tokens, all syntax-highlighted the same color. So if you wanted all of
[i]random text in here[/i]to be the same style, then your open delimiter would be[i]and your close delimiter would be[/i]. But since you seem to not want the stuff in between to be colored/styled, just the tags themselves, then I would say “don’t use delimiters for those”. You would just make[i]and[/i]as keywordsAbout the only one, in your examples, that would make sense as a delimiter would be
[urlas the open and]as the close, because you want[url=blahblahblah]to all be the same styling.BTW: the User Defined Language Repository already has a BB Code UDL: you might want to look at how they did it
-
@PeterJones Ohhh, that’s why that’d happen, makes so much sense now. And the other BB Code xlm helped out on a few things, thank you very much! :D

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login