Sublime Forum

Repeat begin-end rule in syntax definition

#1

Hey all,

I’m working on a syntax definition for the Kinetic Rules Language. To start, here is a skeleton “program”:

ruleset RulesetName {
	meta {
		....
	}
	global {
   
	}
	dispatch {

	}
	rule ruleName1 {
		....
	}
	rule ruleName2 {
		....
	}
	rule ruleName3 {
		....
	}
}

This is my first time writing a syntax definition. I’ve been defining the syntax using begin-end blocks, starting with the ruleset block. The meta, global, and dispatch blocks can only appear once, but there can be an arbitrary number of rule blocks. The syntax only picks up on the first one however. What is the right way to signal that the rule block can be repeated?

Cheers!

0 Likes

#2

My mistake, this actually already works. The way I had defined the first rule block caused the syntax to not pick up on the rule blocks that followed. :unamused: Thanks anyways for reading!

0 Likes