Compare commits

...

2 Commits

Author SHA1 Message Date
859ed7402a it's alive 2025-11-01 23:11:52 -07:00
e413fc1ff6 old syntax 2025-11-01 22:55:29 -07:00
2 changed files with 5 additions and 6 deletions

View File

@ -12,7 +12,7 @@ Go to http://localhost:3000 to try out the playground.
tail log.txt lines=50
name = "Shrimp"
greet = fn person: echo "Hello" person
greet = do person: echo "Hello" person
result = tail log.txt lines=10
@ -33,7 +33,7 @@ Go to http://localhost:3000 to try out the playground.
## Architecture
**parser/** - Lezer grammar and tokenizers that parse Shrimp code into syntax trees
**editor/** - CodeMirror integration with syntax highlighting and language support
**editor/** - CodeMirror integration with syntax highlighting and language support
**compiler/** - Transforms syntax trees into ReefVM bytecode for execution
The flow: Shrimp source → parser (CST) → compiler (bytecode) → ReefVM (execution)

View File

@ -1,5 +1,4 @@
import { expect, describe, test, beforeEach } from 'bun:test'
import { type Value } from 'reefvm'
const buffer: string[] = []
@ -8,8 +7,8 @@ const ribbitGlobals = {
await cb()
return buffer.join("\n")
},
tag: (tagName: string, atDefaults = {}) => {
return (atNamed = {}, ...args: any[]) => tag(tagName, Object.assign({}, atDefaults, atNamed), ...args)
tag: async (tagFn: Function, atDefaults = {}) => {
return (atNamed = {}, ...args: any[]) => tagFn(Object.assign({}, atDefaults, atNamed), ...args)
},
head: (atNamed: {}, ...args: any[]) => tag('head', atNamed, ...args),
title: (atNamed: {}, ...args: any[]) => tag('title', atNamed, ...args),
@ -81,7 +80,7 @@ end
test('custom tags', () => {
expect(`
list = tag 'ul' class=list
list = tag ul class=list
ribbit:
list:
li border-bottom='1px solid black' one