File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,10 +251,28 @@ use local_helper;
251251
252252func main () {
253253 let result = std .math .sqrt (16 );
254+
254255 print (" Square root of 16: " + to_string (result));
255256}
256257```
257258
259+ ### Async/Await
260+
261+ ProXPL supports native asynchronous programming:
262+
263+ ``` javascript
264+ async func fetchUser (id ) {
265+ // Simulate non-blocking operation
266+ return {" id" : id, " name" : " User" + to_string (id)};
267+ }
268+
269+ async func main () {
270+ print (" Fetching user..." );
271+ let user = await fetchUser (42 );
272+ print (" Got user: " + user[" name" ]);
273+ }
274+ ```
275+
258276### Standard Library Examples
259277
260278``` javascript
Original file line number Diff line number Diff line change 66
77#include "../../include/ir.h"
88#include "../../include/ast.h"
9+ #include "../../include/object.h"
910#include <stdlib.h>
1011#include <string.h>
1112#include <stdio.h>
Original file line number Diff line number Diff line change 1616// Forward declarations of parsing functions
1717static Stmt * declaration (Parser * p );
1818static Stmt * statement (Parser * p );
19- static Stmt * funcDecl (Parser * p , const char * kind );
19+ static Stmt * funcDecl (Parser * p , const char * kind , bool isAsync );
2020static Stmt * classDecl (Parser * p );
2121static Stmt * varDecl (Parser * p );
2222static Stmt * useDecl (Parser * p );
You can’t perform that action at this time.
0 commit comments