about summary refs log tree commit diff stats
path: root/baremetal/shell/gap-buffer.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-01-09 10:15:33 -0800
committerKartik Agaram <vc@akkartik.com>2021-01-09 10:15:33 -0800
commit8be561f59977a375af2af7cf300273d3548da2e0 (patch)
tree183219c54824f2672d5489629eb8b476ac3abcc4 /baremetal/shell/gap-buffer.mu
parentadf7fba7fea6940f4330d8d8e25d0f0bbca9d737 (diff)
downloadmu-8be561f59977a375af2af7cf300273d3548da2e0.tar.gz
7485
Diffstat (limited to 'baremetal/shell/gap-buffer.mu')
0 files changed, 0 insertions, 0 deletions
ject/tdisallowif.nim?h=devel&id=1d14cb1ad8d4d98ea19daa2d5ab6ded59d58553a'>1d14cb1ad ^
3560827a2 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29


                                                           
                


                                        

                                                                            














                                                       
                


                      
         
discard """
  line: 24
  errormsg: "usage of 'disallowIf' is a user-defined error"
  disabled: true
"""

template optZero{x+x}(x: int): int = x*3
template andthen{`*`(x,3)}(x: int): int = x*4
template optSubstr1{x = substr(x, 0, b)}(x: string, b: int) = setlen(x, b+1)

template disallowIf{
  if cond: action
  else: action2
}(cond: bool, action, action2: stmt) {.error.} = action

var y = 12
echo y+y

var s: array[0..2, string]
s[0] = "hello"
s[0] = substr(s[0], 0, 2)

echo s[0]

if s[0] != "hi":
  echo "do it"
  echo "more branches"
else:
  discard