]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Support basic include inline statement
authorKevin <github@kevin-brown.com>
Wed, 22 May 2024 15:33:20 +0000 (11:33 -0400)
committerKevin <github@kevin-brown.com>
Wed, 22 May 2024 15:33:20 +0000 (11:33 -0400)
grammar/jinja.ohm

index 0b72ea086af714880d2d68d3ece38cc019ee7663..d42db811d2abf291c6ee05ab038f3b257fbebbe5 100644 (file)
@@ -13,15 +13,25 @@ Jinja {
     
     inlineStatementContent
     = statement_extends
+    | statement_include
     
     statement_extends
     = statementId_extends sp stringLiteral
     
+    statement_include
+    = statementId_include sp stringLiteral (sp importOptions_ignoreMissing)? (sp importOptions_contextManagement)?
+    
     statementOpen = "{%"
     statementClose = "%}"
     
     statementId_extends = "extends"
+    statementId_include = "include"
     
+    importOptions_ignoreMissing = "ignore missing"
+    importOptions_contextManagement = importOptions_withContext | importOptions_withoutContext
+    importOptions_withContext = "with context"
+    importOptions_withoutContext = "without context"
+      
     stringLiteral = stringLiteral_single | stringLiteral_double
     
     stringLiteral_single = quote_single (~quote_single any)* quote_single