-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish code folding support (add spin control-flow parsing)
- now retrieve edit tab width - add spin control-flow tracking logic
- Loading branch information
Showing
12 changed files
with
471 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
' flow control structures that need to be folded | ||
|
||
PUB main(valueParm) | ||
|
||
' -------------------------------------------------- | ||
'' IF testing | ||
' keywords: IF IFNOT, ELSE, ELSEIF, ELSEIFNOT | ||
if true | ||
' do something | ||
elseif false | ||
ifnot true | ||
' do something | ||
elseifnot false | ||
' do other | ||
else | ||
' yet more | ||
else | ||
' do other | ||
|
||
ifnot true | ||
' do something | ||
elseifnot false | ||
' do other | ||
else | ||
' yet more | ||
|
||
' -------------------------------------------------- | ||
'' CASE testing | ||
' keywords: CASE, CASE_FAST | ||
case valueParm | ||
1: ' code | ||
|
||
2: ' code | ||
other: | ||
' code | ||
|
||
' -------------------------------------------------- | ||
'' REPEAT testing | ||
' keywords: REPEAT, WHILE, UNTIL | ||
repeat 10 | ||
' code | ||
|
||
repeat | ||
' code | ||
until false | ||
|
||
repeat | ||
'code | ||
while true | ||
|
||
' -------------------------------------------------- | ||
|
||
PRI dec(value) | flag, place, digit 'private method prints decimals, three local variables | ||
flag~ 'reset digit-printed flag | ||
place := 1_000_000_000 'start at the one-billion's place and work downward | ||
|
||
REPEAT | ||
IF flag ||= (digit := value / place // 10) || place == 1 'print a digit? | ||
IF LOOKDOWN(place : 1_000_000_000, 1_000_000, 1_000) 'also print a comma? | ||
WHILE place /= 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
' flow control structures that need to be folded | ||
|
||
PUB main(valueParm) | ||
|
||
' -------------------------------------------------- | ||
'' IF testing | ||
' keywords: IF IFNOT, ELSE, ELSEIF, ELSEIFNOT | ||
if true | ||
' do something | ||
elseif false | ||
ifnot true | ||
' do something | ||
elseifnot false | ||
' do other | ||
else | ||
' yet more | ||
else | ||
' do other | ||
|
||
ifnot true | ||
' do something | ||
elseifnot false | ||
' do other | ||
else | ||
' yet more | ||
|
||
' -------------------------------------------------- | ||
'' CASE testing | ||
' keywords: CASE, CASE_FAST | ||
case valueParm | ||
1: ' code | ||
|
||
2: ' code | ||
other: | ||
' code | ||
|
||
case_fast valueParm | ||
1: ' code | ||
|
||
2: ' code | ||
other: | ||
' code | ||
|
||
' -------------------------------------------------- | ||
'' REPEAT testing | ||
' keywords: REPEAT, WHILE, UNTIL | ||
repeat 10 | ||
' code | ||
|
||
repeat 20 with valueParm | ||
' code | ||
|
||
repeat | ||
' code | ||
until false | ||
|
||
repeat | ||
'code | ||
while true | ||
|
||
' -------------------------------------------------- | ||
|
||
PRI dec(value) | flag, place, digit 'private method prints decimals, three local variables | ||
flag~ 'reset digit-printed flag | ||
place := 1_000_000_000 'start at the one-billion's place and work downward | ||
|
||
REPEAT | ||
IF flag ||= (digit := value / place // 10) || place == 1 'print a digit? | ||
SEND("0" + digit) 'yes | ||
IF LOOKDOWN(place : 1_000_000_000, 1_000_000, 1_000) 'also print a comma? | ||
SEND(",") 'yes | ||
WHILE place /= 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.