Skip to content

Commit

Permalink
Fix typo in prompt and added one more test case
Browse files Browse the repository at this point in the history
  • Loading branch information
valkjsaaa committed Nov 7, 2023
1 parent 5b72cbe commit c60db72
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
5 changes: 5 additions & 0 deletions lib/dsl/__test__/parser.gen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,8 @@ test("parse", () => {
type: "access",
});
});

test("parser error test", () => {
const result = parse("Booking.Current().payment.setProperty(method: \"MasterCard\"); Booking.Current().confirm();");
console.log(result);
});
30 changes: 15 additions & 15 deletions lib/nl/prompt-res.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ import { ExampleParse } from "./prompt-gen";
export const pre_section_separator = "\n";
export const post_section_separator = "\n\n\n";

export const class_prequel = "// Here are all the function that we have";
export const class_prequel = "// Here are all the functions";

export const array_definition =
"extension Array<Type> {\n" +
" // find items with matching field in an array\n" +
" Array<Type> matching(field: Field, value: Value);\n" +
" \n" +
" // find items with exact field in an array\n" +
" Array<Type> equal(field: Field, value: Value);\n" +
" \n" +
" // find items with field between two values in an array\n" +
" Array<Type> between(field: Field, from: Value, to: Value);\n" +
" \n" +
" // find items with field contains the value in an array\n" +
" Array<Type> contains(field: Field, value: Value);\n" +
" \n" +
" // sort items according the field in an array\n" +
" Array<Type> sort(field: Field, ascending: boolean);\n" +
" //Find items with matching fields in an array\n" +
" Array<Type> matching(field: Field, value: Type);\n" +
"\n" +
" // Find items with field in an array that contains a specific value\n" +
" Array<Type> contains(field: Field, value: Type);\n" +
"\n" +
" // Find items with exact fields in an array\n" +
" Array<Type> equals(field: Field, value: Type);\n" +
"\n" +
" //Find items with the field between two values in an array\n" +
" Array<Type> between(field: Field, from: Type, to: Type);\n" +
"\n" +
" //Sort an array based on a specific field in ascending or descending order\n" +
" Array<Type> sort(field: Field, ascending: bool);\n" +
"}";

export const class_separator = "\n\n";
Expand Down

0 comments on commit c60db72

Please sign in to comment.