File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ $ export OPENAI_API_KEY=<your-openai-api-key>
5757
5858$ cat web .ai
5959get / {
60- " " " A api to ask LLM" " "
60+ " " " An api to ask LLM" " "
6161
6262 query {
6363 " " " the question to ask" " "
Original file line number Diff line number Diff line change @@ -198,6 +198,18 @@ impl<'a> Parser<'a> {
198198 validators : validators. into_boxed_slice ( ) ,
199199 docs,
200200 } ) ;
201+
202+ // If this is not the last field (not followed by a closing brace),
203+ // then a comma is required
204+ if !self . check ( TokenType :: CloseBrace ) {
205+ self . consume ( TokenType :: Comma , "Expected ',' after field definition" ) ?;
206+ } else {
207+ // We've reached the closing brace, we can optionally have a comma
208+ if self . check ( TokenType :: Comma ) {
209+ self . advance ( ) ; // consume the optional trailing comma
210+ }
211+ break ;
212+ }
201213 }
202214
203215 self . consume ( TokenType :: CloseBrace , "Expected '}' after fields" ) ?;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments