mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-11-04 09:32:00 +00:00 
			
		
		
		
	grammar : add comments to new grammar file
This commit is contained in:
		@@ -1,6 +1,15 @@
 | 
				
			|||||||
 | 
					# This is the same as json.gbnf but we restrict whitespaces at the end of the root array
 | 
				
			||||||
 | 
					# Useful for generating JSON arrays
 | 
				
			||||||
 | 
					
 | 
				
			||||||
root   ::= arr
 | 
					root   ::= arr
 | 
				
			||||||
value  ::= object | array | string | number | ("true" | "false" | "null") ws
 | 
					value  ::= object | array | string | number | ("true" | "false" | "null") ws
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					arr  ::=
 | 
				
			||||||
 | 
					  "{\n\t[\n" ws (
 | 
				
			||||||
 | 
					            value
 | 
				
			||||||
 | 
					    (",\n" ws value)*
 | 
				
			||||||
 | 
					  )? "\t]\n}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
object ::=
 | 
					object ::=
 | 
				
			||||||
  "{" ws (
 | 
					  "{" ws (
 | 
				
			||||||
            string ":" ws value
 | 
					            string ":" ws value
 | 
				
			||||||
@@ -13,12 +22,6 @@ array  ::=
 | 
				
			|||||||
    ("," ws value)*
 | 
					    ("," ws value)*
 | 
				
			||||||
  )? "]" ws
 | 
					  )? "]" ws
 | 
				
			||||||
 | 
					
 | 
				
			||||||
arr  ::=
 | 
					 | 
				
			||||||
  "[\n" ws (
 | 
					 | 
				
			||||||
            value
 | 
					 | 
				
			||||||
    (",\n" ws value)*
 | 
					 | 
				
			||||||
  )? "]"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
string ::=
 | 
					string ::=
 | 
				
			||||||
  "\"" (
 | 
					  "\"" (
 | 
				
			||||||
    [^"\\] |
 | 
					    [^"\\] |
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user