-
Notifications
You must be signed in to change notification settings - Fork 10
Use faststreams comptime support #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
4232973
60f8a3c
138446e
68d31dc
5a45a8c
99109b2
e1d533f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,4 @@ package-lock.json | |
| nimble.develop | ||
| nimble.paths | ||
| vendor | ||
| tests/test_all | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -245,33 +245,16 @@ proc toUgly(result: var string, p: TomlValueRef) = | |
| proc `$`*(p: TomlValueRef): string = | ||
| toUgly(result, p) | ||
|
|
||
| type | ||
| VMInputStream* = ref object of InputStream | ||
| pos*: int | ||
| data*: string | ||
|
|
||
| proc read*(s: VMInputStream): char = | ||
| result = s.data[s.pos] | ||
| inc s.pos | ||
|
|
||
| proc readable*(s: VMInputStream): bool = | ||
| s.pos < s.data.len | ||
| proc peekChar*(s: InputStream): char {.deprecated: "use s.peek().char".} = | ||
|
||
| s.peek().char | ||
|
|
||
| proc peekChar*(s: VMInputStream): char = | ||
| s.data[s.pos] | ||
|
|
||
| template toVMString*(x: openArray[byte]): string = | ||
| template toVMString*(x: openArray[byte]): string {.deprecated.} = | ||
| var z = newString(x.len) | ||
| for i, c in x: z[i] = char(c) | ||
| z | ||
|
|
||
| template toVMString*(x: string): string = | ||
| template toVMString*(x: string): string {.deprecated.} = | ||
| x | ||
|
|
||
| template memInputStream*(input: untyped): auto = | ||
| var stream: InputStream | ||
| when nimvm: | ||
| stream = VMInputStream(pos: 0, data: toVMString(input)) | ||
| else: | ||
| stream = unsafeMemoryInput(input) | ||
| stream | ||
| template memInputStream*(input: untyped): auto {.deprecated: "use unsafeMemoryInput".} = | ||
| unsafeMemoryInput(input) | ||
Uh oh!
There was an error while loading. Please reload this page.