From 2513a37b7ed2296e26a803aa1510d4408d15c976 Mon Sep 17 00:00:00 2001 From: shylinux Date: Thu, 30 Mar 2023 07:38:37 +0800 Subject: [PATCH] opt yac --- src/demo.shy | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/demo.shy b/src/demo.shy index ce85a025..aab1614e 100644 --- a/src/demo.shy +++ b/src/demo.shy @@ -1,20 +1,24 @@ # demo script -for i = 1; i < 10; i++ { pwd } -return -let a = 1+2*3+1-0 - -func show { - if a > 2 { - pwd - } - if a > 2 { pwd } - return - pwd -} -show -pwd - -show +let a = system(ls bin) return -pwd + +let a = 1 +if a > 0 { pwd } +if a = 2; a > 0 { pwd } +for a = 2; a < 5; a++ { pwd } +for a = 2; a < 5 { + pwd + let a = a + 1 +} +let a = 2 +for a < 5 { + pwd + let a = a + 1 +} +let a = 2 +for ;a < 5; { + pwd + let a = a + 1 +} +