Compare commits

..

No commits in common. "859ed7402ab43a3f26f05a6b735f68788038b1bf" and "c81922fc97162d2672a260c7ae145f052396af4e" have entirely different histories.

2 changed files with 6 additions and 5 deletions

View File

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

View File

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