]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Document the from statement
authorKevin <github@kevin-brown.com>
Wed, 22 May 2024 16:16:13 +0000 (12:16 -0400)
committerKevin <github@kevin-brown.com>
Wed, 22 May 2024 16:16:13 +0000 (12:16 -0400)
grammar/jinja.ohm

index 8818d60f6cac3dc34775eb7585b55e0b73a11e5c..c5f49ffbc2dfce8dff20234be3a23271016cf854 100644 (file)
@@ -13,6 +13,7 @@ Jinja {
     
     inlineStatementContent
     = statement_extends
+    | statement_from
     | statement_import
     | statement_include
     
@@ -23,6 +24,13 @@ Jinja {
     = stringLiteral
     | variableName
     
+    statement_from
+    = statementId_from sp statementImport_file sp statementId_import sp statementFrom_variables (sp importOptions_contextManagement)?
+    
+    statementFrom_variables
+    = (statementFrom_variable sp? comma sp?)* statementFrom_variable
+    statementFrom_variable = variableName (sp statementModifier_as sp variableName)?
+    
     statement_import
     = statementId_import sp statementImport_file sp statementModifier_as sp variableName
     
@@ -44,6 +52,7 @@ Jinja {
     statementClose = "%}"
     
     statementId_extends = "extends"
+    statementId_from = "from"
     statementId_import = "import"
     statementId_include = "include"