From 17b6bf12b40365a6031455f04e149d74f93d289d Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sun, 3 May 2020 22:00:45 +0100 Subject: [PATCH] The very basics work! --- appinfo.json | 10 +- calcers.vims | 518 +++++++++++++++++++++++++++++++++++ resources/images/appicon.png | Bin 230 -> 7650 bytes src/.pebblisp.c.swp | Bin 0 -> 16384 bytes src/.pebblisp.h.swp | Bin 0 -> 12288 bytes src/calc.c | 79 +----- src/calc.h | 2 + src/pebblisp.c | 4 +- src/pebblisp.h | 6 +- 9 files changed, 539 insertions(+), 80 deletions(-) create mode 100644 calcers.vims create mode 100644 src/.pebblisp.c.swp create mode 100644 src/.pebblisp.h.swp diff --git a/appinfo.json b/appinfo.json index ba6d12f..dcfa861 100644 --- a/appinfo.json +++ b/appinfo.json @@ -3,9 +3,9 @@ "capabilities": [ "" ], - "companyName": "Michael E.", - "enableMultiJS": true, - "longName": "Calculator", + "companyName": "Save V.", + "enableMultiJS": false, + "longName": "PebbLisp", "projectType": "native", "resources": { "media": [ @@ -19,13 +19,13 @@ ] }, "sdkVersion": "3", - "shortName": "Calculator", + "shortName": "PebbLisp", "targetPlatforms": [ "aplite", "basalt" ], "uuid": "3a239ae0-adc5-4d40-b871-6fbcd8c37e7c", - "versionLabel": "1.1", + "versionLabel": "0.1", "watchapp": { "watchface": false } diff --git a/calcers.vims b/calcers.vims new file mode 100644 index 0000000..40c1d01 --- /dev/null +++ b/calcers.vims @@ -0,0 +1,518 @@ +let SessionLoad = 1 +if &cp | set nocp | endif +vnoremap  "+y +nnoremap  "+yy +nnoremap   +nnoremap  ^ +let s:cpo_save=&cpo +set cpo&vim +nnoremap  +nnoremap   +nnoremap   +nnoremap  m`v$hp``y$ +nnoremap ! :! +nnoremap "p "0p +nnoremap // m`I//``:s-////-- +nnoremap :W :w +nnoremap U ~ +nnoremap \n :tabedit~/.notes +nnoremap \v :tabedit~/.vimrc +nnoremap \r :source ~/.vimrc +nnoremap \ga :!git add % +nnoremap \gu :!git add -u +nnoremap \gp :!git push +nnoremap \gl :!git log +nnoremap \gh :!git --help +nnoremap \gc :!git commit -m "" +nnoremap \gB :!git blame % +nnoremap \gD :!git diff +nnoremap \gd :!git diff % +nnoremap \p :w :!make run +nnoremap \c :!cat % | xclip -selection clipboard +vnoremap \PP :ha > ~/.vim.ps :!xdg-open ~/.vim.ps +nnoremap \PP :ha > ~/.vim.ps :!xdg-open ~/.vim.ps +nnoremap \b :ls :b +nnoremap ciw cw +nnoremap cw ciw +nnoremap dh d^ +nnoremap dl d$ +vmap gx NetrwBrowseXVis +nmap gx NetrwBrowseX +nnoremap gb dawbP +nnoremap gs "xdiwdwep"xp +nnoremap yh y^ +nnoremap yl y$ +nnoremap ~ U +vnoremap NetrwBrowseXVis :call netrw#BrowseXVis() +nnoremap NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '')),netrw#CheckIfRemote()) +inoremap  +inoremap jk l +inoremap jj l +inoremap kj l +cnoreabbr vimc tabedit ~/.vimrc +cabbr %% expand('%:p:h') +iabbr reutner return +iabbr reteun return +iabbr ruetn return +let &cpo=s:cpo_save +unlet s:cpo_save +set autoindent +set background=dark +set backspace=indent,eol,start +set dictionary=/usr/share/dict/words +set expandtab +set fileencodings=ucs-bom,utf-8,default,latin1 +set foldlevelstart=5 +set helplang=en +set ignorecase +set printoptions=paper:a4 +set ruler +set runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after +set shiftwidth=4 +set smartcase +set smartindent +set smarttab +set splitbelow +set splitright +set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc +set tags=./tags;/ +set thesaurus=~/.vim/thesaurus/thesaurus-vim-en +set window=44 +let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0 +let v:this_session=expand(":p") +silent only +cd ~/work/PebbleCalc +if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' + let s:wipebuf = bufnr('%') +endif +set shortmess=aoO +badd +34 src/pebblisp.h +badd +3 src/pebblisp.c +badd +0 ~/work/PebbleCalc/src/calc.c +argglobal +silent! argdel * +$argadd src/pebblisp.h +edit ~/work/PebbleCalc/src/calc.c +set splitbelow splitright +wincmd _ | wincmd | +vsplit +1wincmd h +wincmd w +wincmd _ | wincmd | +split +1wincmd k +wincmd w +wincmd t +set winminheight=1 winheight=1 winminwidth=1 winwidth=1 +exe 'vert 1resize ' . ((&columns * 76 + 76) / 153) +exe '2resize ' . ((&lines * 21 + 22) / 45) +exe 'vert 2resize ' . ((&columns * 76 + 76) / 153) +exe '3resize ' . ((&lines * 21 + 22) / 45) +exe 'vert 3resize ' . ((&columns * 76 + 76) / 153) +argglobal +setlocal keymap= +setlocal noarabic +setlocal autoindent +setlocal backupcopy= +setlocal balloonexpr= +setlocal nobinary +setlocal nobreakindent +setlocal breakindentopt= +setlocal bufhidden= +setlocal buflisted +setlocal buftype= +setlocal nocindent +setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e +setlocal cinoptions= +setlocal cinwords=if,else,while,do,for,switch +setlocal colorcolumn= +setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- +setlocal commentstring=/*%s*/ +setlocal complete=.,w,b,u,t,i +setlocal concealcursor= +setlocal conceallevel=0 +setlocal completefunc= +setlocal nocopyindent +setlocal cryptmethod= +setlocal nocursorbind +setlocal nocursorcolumn +setlocal nocursorline +setlocal define= +setlocal dictionary= +setlocal nodiff +setlocal equalprg= +setlocal errorformat= +setlocal expandtab +if &filetype != 'c' +setlocal filetype=c +endif +setlocal fixendofline +setlocal foldcolumn=0 +setlocal foldenable +setlocal foldexpr=0 +setlocal foldignore=# +setlocal foldlevel=5 +setlocal foldmarker={{{,}}} +set foldmethod=syntax +setlocal foldmethod=syntax +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal foldtext=foldtext() +setlocal formatexpr= +setlocal formatoptions=tcq +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* +setlocal formatprg= +setlocal grepprg= +setlocal iminsert=0 +setlocal imsearch=-1 +setlocal include= +setlocal includeexpr= +setlocal indentexpr= +setlocal indentkeys=0{,0},:,0#,!^F,o,O,e +setlocal noinfercase +setlocal iskeyword=@,48-57,_,192-255 +setlocal keywordprg= +setlocal nolinebreak +setlocal nolisp +setlocal lispwords= +setlocal nolist +setlocal makeencoding= +setlocal makeprg= +setlocal matchpairs=(:),{:},[:] +setlocal modeline +setlocal modifiable +setlocal nrformats=bin,octal,hex +set number +setlocal number +setlocal numberwidth=4 +setlocal omnifunc= +setlocal path= +setlocal nopreserveindent +setlocal nopreviewwindow +setlocal quoteescape=\\ +setlocal noreadonly +set relativenumber +setlocal relativenumber +setlocal norightleft +setlocal rightleftcmd=search +setlocal noscrollbind +setlocal shiftwidth=4 +setlocal noshortname +setlocal signcolumn=auto +setlocal smartindent +setlocal softtabstop=0 +setlocal nospell +setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ +setlocal spellfile= +setlocal spelllang=en +setlocal statusline= +setlocal suffixesadd= +setlocal swapfile +setlocal synmaxcol=3000 +if &syntax != 'c' +setlocal syntax=c +endif +setlocal tabstop=8 +setlocal tagcase= +setlocal tags= +setlocal termkey= +setlocal termsize= +setlocal textwidth=0 +setlocal thesaurus= +setlocal noundofile +setlocal undolevels=-123456 +setlocal nowinfixheight +setlocal nowinfixwidth +setlocal wrap +setlocal wrapmargin=0 +21 +normal! zo +61 +normal! zo +61 +normal! zo +let s:l = 6 - ((5 * winheight(0) + 21) / 43) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +6 +normal! 021| +wincmd w +argglobal +if bufexists('src/pebblisp.c') | buffer src/pebblisp.c | else | edit src/pebblisp.c | endif +setlocal keymap= +setlocal noarabic +setlocal autoindent +setlocal backupcopy= +setlocal balloonexpr= +setlocal nobinary +setlocal nobreakindent +setlocal breakindentopt= +setlocal bufhidden= +setlocal buflisted +setlocal buftype= +setlocal nocindent +setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e +setlocal cinoptions= +setlocal cinwords=if,else,while,do,for,switch +setlocal colorcolumn= +setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- +setlocal commentstring=/*%s*/ +setlocal complete=.,w,b,u,t,i +setlocal concealcursor= +setlocal conceallevel=0 +setlocal completefunc= +setlocal nocopyindent +setlocal cryptmethod= +setlocal nocursorbind +setlocal nocursorcolumn +setlocal nocursorline +setlocal define= +setlocal dictionary= +setlocal nodiff +setlocal equalprg= +setlocal errorformat= +setlocal expandtab +if &filetype != 'c' +setlocal filetype=c +endif +setlocal fixendofline +setlocal foldcolumn=0 +setlocal foldenable +setlocal foldexpr=0 +setlocal foldignore=# +setlocal foldlevel=5 +setlocal foldmarker={{{,}}} +set foldmethod=syntax +setlocal foldmethod=syntax +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal foldtext=foldtext() +setlocal formatexpr= +setlocal formatoptions=tcq +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* +setlocal formatprg= +setlocal grepprg= +setlocal iminsert=0 +setlocal imsearch=-1 +setlocal include= +setlocal includeexpr= +setlocal indentexpr= +setlocal indentkeys=0{,0},:,0#,!^F,o,O,e +setlocal noinfercase +setlocal iskeyword=@,48-57,_,192-255 +setlocal keywordprg= +setlocal nolinebreak +setlocal nolisp +setlocal lispwords= +setlocal nolist +setlocal makeencoding= +setlocal makeprg= +setlocal matchpairs=(:),{:},[:] +setlocal modeline +setlocal modifiable +setlocal nrformats=bin,octal,hex +set number +setlocal number +setlocal numberwidth=4 +setlocal omnifunc= +setlocal path= +setlocal nopreserveindent +setlocal nopreviewwindow +setlocal quoteescape=\\ +setlocal noreadonly +set relativenumber +setlocal relativenumber +setlocal norightleft +setlocal rightleftcmd=search +setlocal noscrollbind +setlocal shiftwidth=8 +setlocal noshortname +setlocal signcolumn=auto +setlocal smartindent +setlocal softtabstop=0 +setlocal nospell +setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ +setlocal spellfile= +setlocal spelllang=en +setlocal statusline= +setlocal suffixesadd= +setlocal swapfile +setlocal synmaxcol=3000 +if &syntax != 'c' +setlocal syntax=c +endif +setlocal tabstop=8 +setlocal tagcase= +setlocal tags= +setlocal termkey= +setlocal termsize= +setlocal textwidth=0 +setlocal thesaurus= +setlocal noundofile +setlocal undolevels=-123456 +setlocal nowinfixheight +setlocal nowinfixwidth +setlocal wrap +setlocal wrapmargin=0 +4 +normal! zo +10 +normal! zo +11 +normal! zo +let s:l = 29 - ((20 * winheight(0) + 10) / 21) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +29 +normal! 017| +wincmd w +argglobal +if bufexists('src/pebblisp.h') | buffer src/pebblisp.h | else | edit src/pebblisp.h | endif +setlocal keymap= +setlocal noarabic +setlocal autoindent +setlocal backupcopy= +setlocal balloonexpr= +setlocal nobinary +setlocal nobreakindent +setlocal breakindentopt= +setlocal bufhidden= +setlocal buflisted +setlocal buftype= +setlocal nocindent +setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e +setlocal cinoptions= +setlocal cinwords=if,else,while,do,for,switch +setlocal colorcolumn= +setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- +setlocal commentstring=/*%s*/ +setlocal complete=.,w,b,u,t,i +setlocal concealcursor= +setlocal conceallevel=0 +setlocal completefunc= +setlocal nocopyindent +setlocal cryptmethod= +setlocal nocursorbind +setlocal nocursorcolumn +setlocal nocursorline +setlocal define= +setlocal dictionary= +setlocal nodiff +setlocal equalprg= +setlocal errorformat= +setlocal expandtab +if &filetype != 'cpp' +setlocal filetype=cpp +endif +setlocal fixendofline +setlocal foldcolumn=0 +setlocal foldenable +setlocal foldexpr=0 +setlocal foldignore=# +setlocal foldlevel=5 +setlocal foldmarker={{{,}}} +set foldmethod=syntax +setlocal foldmethod=syntax +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal foldtext=foldtext() +setlocal formatexpr= +setlocal formatoptions=tcq +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* +setlocal formatprg= +setlocal grepprg= +setlocal iminsert=0 +setlocal imsearch=-1 +setlocal include= +setlocal includeexpr= +setlocal indentexpr= +setlocal indentkeys=0{,0},:,0#,!^F,o,O,e +setlocal noinfercase +setlocal iskeyword=@,48-57,_,192-255 +setlocal keywordprg= +setlocal nolinebreak +setlocal nolisp +setlocal lispwords= +setlocal nolist +setlocal makeencoding= +setlocal makeprg= +setlocal matchpairs=(:),{:},[:] +setlocal modeline +setlocal modifiable +setlocal nrformats=bin,octal,hex +set number +setlocal number +setlocal numberwidth=4 +setlocal omnifunc= +setlocal path= +setlocal nopreserveindent +setlocal nopreviewwindow +setlocal quoteescape=\\ +setlocal noreadonly +set relativenumber +setlocal relativenumber +setlocal norightleft +setlocal rightleftcmd=search +setlocal noscrollbind +setlocal shiftwidth=8 +setlocal noshortname +setlocal signcolumn=auto +setlocal smartindent +setlocal softtabstop=0 +setlocal nospell +setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ +setlocal spellfile= +setlocal spelllang=en +setlocal statusline= +setlocal suffixesadd= +setlocal swapfile +setlocal synmaxcol=3000 +if &syntax != 'cpp' +setlocal syntax=cpp +endif +setlocal tabstop=8 +setlocal tagcase= +setlocal tags= +setlocal termkey= +setlocal termsize= +setlocal textwidth=0 +setlocal thesaurus= +setlocal noundofile +setlocal undolevels=-123456 +setlocal nowinfixheight +setlocal nowinfixwidth +setlocal wrap +setlocal wrapmargin=0 +15 +normal! zo +18 +normal! zo +let s:l = 19 - ((4 * winheight(0) + 10) / 21) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +19 +normal! 014| +wincmd w +exe 'vert 1resize ' . ((&columns * 76 + 76) / 153) +exe '2resize ' . ((&lines * 21 + 22) / 45) +exe 'vert 2resize ' . ((&columns * 76 + 76) / 153) +exe '3resize ' . ((&lines * 21 + 22) / 45) +exe 'vert 3resize ' . ((&columns * 76 + 76) / 153) +tabnext 1 +if exists('s:wipebuf') + silent exe 'bwipe ' . s:wipebuf +endif +unlet! s:wipebuf +set winheight=1 winwidth=20 shortmess=filnxtToO +set winminheight=1 winminwidth=1 +let s:sx = expand(":p:r")."x.vim" +if file_readable(s:sx) + exe "source " . fnameescape(s:sx) +endif +let &so = s:so_save | let &siso = s:siso_save +doautoall SessionLoadPost +unlet SessionLoad +" vim: set ft=vim : diff --git a/resources/images/appicon.png b/resources/images/appicon.png index 3948a495f73128d15208260991d78b9d02998307..65e044b9ae8deba597dd9d46f000282ecc319e57 100644 GIT binary patch literal 7650 zcmZ9RRZtv2mqrJ7cXvn#Zb8G~?lwpW?m7%MNN~5o-GXLthu{!gLV{a>;O-%1ONayN{X`D|8|Q16guKRs>Bis002}PP+bs2+uWPp z4eV-T?_^C6@pZGNxAw8O0RViKPfQHKOy3Behu^LfP>Q)xR}pjvC!S3pX6Gns5x&?a zTF6Ep%ab`w8qo{>eW|Vd`>;nBFgWmb&k|E44C&RxYl-+dDdDDe#5+Lvp*wK&i9g`A zyTjk?JpDWTV^3M#Z#tjf8_>qzu6}tTcQ2FDzQ=fnFKE`>RzCxK17H1<=8h1CyFaD9 zgbF^5y1ba)rO2pXcwq(9zQ5b+M}0PU-gOe_L!+VT7V{V+=L=NdbtCXUVxE=v{ktQT z*z=A|2C30cyclOa2+UtK^jU`e)x^bRK1shNpJeV`fNMN1IB_LSmhM+K1M-Pvp$8-wGAoz_>aQKSmg#vE$-gT%lx0F+yF+pyuZfH}{F)=A=S0 zAvUKvYQ1WfuL}k{4UBfNSQ4fgoCk|{h-L(|CsJ`ONxcM3H=;qscB-?KajN*52nR!= zIt&OWT?h0(g&mQ?kf??l-8E*xl@~T$IJS0qAxkJ!3{;u)VLQ2ze`PZYWxgAqb>8(U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Z=RYd*h z&{`R#1+TQHiL)hON z^t;9RqF-g8D4<mwy%>hx_42a5vlu--a*3G<*im zhPAK;{>+~KKDZaIhk2NTKKL*D_kV-z_kRW7f`c#yC%`N0*&l^_;TAXqKJ0^w;X>F8 zAAvLBnKkGSUxNcM4I{7_J_;wolkDSv2S0?{;d(d(Etm%n%FqwJ@K5&ee}D(!`*0() zUd(Ka9dg$Uz3ua3-7q z&#|X}5*~)1!V&PG3_GC!r@*uL!UJ#z+zeO4W-uf`RIvL2UaALgo#sC(&qs^sRTx zbw~b2KPppZv*FBV3vJexDU9QX94o5*5j}0SFcDFn(}}lRH92*l#`KU~xLN^vB2;SV zsUbSSl1o*IJacS|ct%&{AT-naD{M;XEZLKcb?Dmw)0>$iU zBbK$xC3Whh{9{axDg0_(_FAFVVzs$>uNl~)p}|3!bjp4;BF(O&XRF-~y8{+NF20^X;- z*iD=q0uI~RQ+gg*orE?@n?`0WEA_&#TiIe|)OAE$q(MC3LYeZ0u7MV5yGoqBff!Tc zAo10G8~vI=77eh@5fQ!Panvo^;x#%WO}U2(hUnNSZ;dWZjpx3m!j(J7k+FKX0ZNd%GXqoIj?-rYO)8?Duld6P#hxGVyf!dN` z1#|W(S{g5ioqnnfs3d!gh?Ppe&C^=DUjMs$D;Dsj=%&LMj$1ZqaRlx(tE;zfY;H(jBf0?PLb$rFAsOS$0-KR9`<`SRgyA2p~ iE5F`^@gR4EPb4a9_4abrI19g}%COsC0mu;csPKQ_Dkla2 literal 0 HcmV?d00001 diff --git a/src/.pebblisp.h.swp b/src/.pebblisp.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..14ae09512d9965521e4fcf6bdc7419fc8cc22e4e GIT binary patch literal 12288 zcmeI2&2Jk;7{;eah_;YY0pbK=NQCOFoNhjZh_C=T>86<4>&SK@N=VFlcie2UA7*#$ z5~7d;7cL0?hh7m#NPtj52srnGI8gooKuGDW9FRafGrMcA<0OZQOQl)qm))It=b3k& zdB;hVw5C@}6*_-$n&3K5$S>+=8y{|;C1;){q{CV*hw+Y+uRz32S*$nJb596;FBVj< z`@y!lECwwaj;V%$sfsQ;>|ESDK|pp%2c!e{=0G=UPtA{!x!Dtwp4?9zx+kylCLNFtNC%_?(gEp! zbU->F9gq%42c!ei0qMYf=zw7n^2S4ie0mzmcm|vYf1e}dPw+eV4g3VY2cLr*;A5~4Jg^2zU=BP7o&@K>82D$5kUQWuxCOoj zH^BQ~4b;G8@F2MP2qC**792c`wSc$43edq7@EVu}DAsaBzl@Z^1s;0PEl>@E1J03%&$j0Pf*eKwi=T>40=VIv^d84*Z`EOfb)~+k{M5 ztZjRY)^bh1wUwvM(6LPxPSSvdT_;)!e7D-#DtcC3v>%Eh1f9%`s9{;TZN zZQBp78-Z1zdxbb+_^YbYBm&maj&FMr3rHF>qJ~{SapkGfLnVou6K15LhKd;-4prI- zY}bzL9xEhe=NT@ZvuR;?KWbDY^&dGHE}y*RTRXU6#;goP9K&r{MxMHc8TiKwnMQ!& zrWIs|r%R_4Lj07Bju(3lYv9;gXur$+HtpBa+T8l&daQ@>aS)1Y$8Gt}sFLM(@t@Ds z>$)v=Ocp#JD8(Ut1y$)k_8$^|a!R}FnUhII>1Pc}pC*?`pPRo{DZbupRIfD4n!Y~h zPknamFdDS-EllzhN?p(PJ-REN(-CQ{iN*%%m+~U+ABrSQoCn?;i#M(=YfY_ItJdOS z;#FVGi#Jsj-OII7rPL^`YD2A+;$p2j)KV^17A_Tsnii{iJ#G+6^{bVIYI!K4-l&!I z%bA#^6@4-DS}xTanOA+KvY^%S{qxD-3KfeToK0?)!@O(JX1vDir)|XEfvw5Oia$0n zkQe^tMWo=;rRxLMQ NB@=er TOKEN_END ? 0 : selected_token; updateText(); @@ -48,70 +42,13 @@ static void enter(){ updateText(); } -// // Backspace. Clears whole number if full is true -// static void clear(bool full){ -// char *num = operator_entered ? num2 : num1; //Create a pointer to the currently edited number -// if(full) -// *num = 0; -// else -// num[strlen(num)-1] = 0; -// text_layer_set_text(s_input_text_layer, num); -// } - //Calculate result, display it and reset static void calculate(){ - // Object obj = parseEval(mytext, &env); - // snprintf(mytext, MAX_LENGTH, "R:%d", obj.number); - // selected_token = 0; - strcpy(mytext, "heythere"); + Object obj = parseEval(mytext, &env); + snprintf(mytext, MAX_LENGTH, "R:%d", obj.number); + selected_token = 0; + //strcpy(mytext, HAHA); updateText(); - if(1) - return; - - /* - bool overflow = false; //Overflow flag - // Convert operands to numbers - fixed lhs = str_to_fixed(num1, &overflow); - fixed rhs = str_to_fixed(num2, &overflow); - fixed result = 0; - //Calculate the result - switch(operator){ - case 0: - result = fixed_add(lhs, rhs, &overflow); - break; - case 1: - result = fixed_subt(lhs, rhs, &overflow); - break; - case 2: - result = fixed_mult(lhs, rhs, &overflow); - break; - case 3: - result = fixed_div(lhs, rhs); - break; - case 4: - result = fixed_pow(lhs, fixed_to_int(rhs), &overflow); //Exponent must be an int - break; - default: - result = 0; - } - - APP_LOG(APP_LOG_LEVEL_DEBUG, "num1: %d num2: %d result: %d", lhs, rhs, result); - - //Reset operands, operator_entered and entering_decimal - *num1 = 0; - *num2 = 0; - operator_entered = false; - - if(overflow){ - text_layer_set_text(s_input_text_layer, "Overflow Error"); //Display message on overflow - } - else{ - fixed_repr(result, result_text, MAX_LENGTH); //Convert result to string - text_layer_set_text(s_input_text_layer, result_text); //Display result - strcpy(num1, result_text); //Copy result into num1 - num1_is_ans = true; - } - */ } // Button press handler diff --git a/src/calc.h b/src/calc.h index e89c215..6b4c1cc 100644 --- a/src/calc.h +++ b/src/calc.h @@ -9,6 +9,8 @@ Window *s_window; TextLayer *s_input_text_layer; +const char *HAHA = "STONKS"; + char mytext[SMAX_LENGTH] = ""; char temptext[SMAX_LENGTH] = ""; diff --git a/src/pebblisp.c b/src/pebblisp.c index 20898e4..1bdda30 100644 --- a/src/pebblisp.c +++ b/src/pebblisp.c @@ -233,9 +233,10 @@ Object parseEval(const char *input, struct Environment *env) { struct Slice *tokens = tokenize(input); struct Slice *debug = tokens; +#ifdef STANDALONE if(debug) { while(debug->text) { - char tok[10]; + char tok[MAX_TOK_LEN]; copySlice(tok, debug); // printf("'%s', ", tok); debug++; @@ -245,6 +246,7 @@ Object parseEval(const char *input, struct Environment *env) // printf("parse error\n"); } // printf("parseEval() parse()\n"); +#endif Object parsed = parse(tokens).obj; return eval(&parsed, env); } diff --git a/src/pebblisp.h b/src/pebblisp.h index 4c25cd1..da97a6c 100644 --- a/src/pebblisp.h +++ b/src/pebblisp.h @@ -3,9 +3,9 @@ // #define STANDALONE -#define MAX_TOK_LEN 6 -#define MAX_TOK_CNT 128 -#define MAX_ENV_ELM 50 +#define MAX_TOK_LEN 3 +#define MAX_TOK_CNT 7 // 128 +#define MAX_ENV_ELM 3 // 50 // static const char* tokenFail = "Missing ')'\n";