BenjaminSchaaf / sbnf

A BNF-style language for writing sublime-syntax files
MIT License
58 stars 6 forks source link

Represent indented blocks #17

Closed AmjadHD closed 3 years ago

AmjadHD commented 3 years ago

This is more of a support question, how to represent an indented block in sbnf. I'm trying to implement a Nim syntax using it's grammar spec and sbnf but I'm stuck in expressing indentation. How do I go about this ?

BenjaminSchaaf commented 3 years ago

I don't see a way of parsing indentation without a context-sensitive grammar - ie. it's not possible to express in SBNF.

AmjadHD commented 3 years ago

So I can't make a nim syntax (or python etc.) with sbnf ?

BenjaminSchaaf commented 3 years ago

You can't make one that understands indentation for Sublime Text in general. The Python syntax for instance ignores indentation.

AmjadHD commented 3 years ago

The point is I don't understand how to ignore indentation terminals and still use sbnf to make the syntax.

BenjaminSchaaf commented 3 years ago

Could you maybe provide an example of what you don't understand?