Skip to content

Instantly share code, notes, and snippets.

View nikki93's full-sized avatar

Nikhilesh S nikki93

View GitHub Profile
# Floats
block:
let f = 1.0
echo f.abs
# `let`, `var`, `const`, ...
block:
block: # let
diff --git a/cclox.cc b/cclox.cc
index 0e9d3c5..f736492 100644
--- a/cclox.cc
+++ b/cclox.cc
@@ -59,7 +59,7 @@ struct Value {
}
- auto copy() -> Value {
+ [[nodiscard]] auto copy() const -> Value {
# coc.nvim config only
let g:coc_global_extensions = ['coc-clangd', 'coc-tsserver', 'coc-json', 'coc-html', 'coc-css', 'coc-go', 'coc-rust-analyzer']
function! s:CheckBackSpace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>CheckBackSpace() ? "\<TAB>" :
\ coc#refresh()
#include "precomp.h"
#include "edit.h"
#include "ui.h"
// Frame
auto Edit::frame() -> void {
input();
#include "precomp.h"
#include "archive.h"
#include "edit.h"
#include "events.h"
#include "graphics.h"
#include "kernel.h"
#include "physics.h"
#include "platform.h"
#include "timing.h"
// Save / load
template<typename F = bool>
auto save(Kernel &ker, F &&filter = true) -> void {
// Create document
using namespace json;
Document root;
root.SetObject();
auto &alloc = root.GetAllocator();
#include "precomp.h"
#include "events.h"
#include "graphics.h"
#include "kernel.h"
#include "physics.h"
#include "platform.h"
#include "timing.h"
#include "ui.h"
#include "precomp.h"
#include "events.h"
#include "graphics.h"
#include "kernel.h"
#include "physics.h"
#include "platform.h"
#include "timing.h"
#include "ui.h"
#include "precomp.h"
#include "events.h"
#include "graphics.h"
#include "kernel.h"
#include "physics.h"
#include "platform.h"
#include "timing.h"
#include "ui.h"
#include "precomp.h"
#include "events.h"
#include "graphics.h"
#include "kernel.h"
#include "physics.h"
#include "platform.h"
#include "timing.h"
#include "ui.h"