mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 21:21:33 +00:00
add a standard library, and introduce formed imports (import std "myfile.pork")
This commit is contained in:
@ -183,7 +183,11 @@ class Parser(source: PeekableSource<Token>, val attribution: NodeAttribution) {
|
||||
|
||||
private fun readImportDeclaration(): ImportDeclaration = within {
|
||||
expect(TokenType.Import)
|
||||
ImportDeclaration(readStringLiteral())
|
||||
var form: Symbol? = null
|
||||
if (peek(TokenType.Symbol)) {
|
||||
form = readSymbolRaw()
|
||||
}
|
||||
ImportDeclaration(form, readStringLiteral())
|
||||
}
|
||||
|
||||
private fun readFunctionDeclaration(): FunctionDefinition = within {
|
||||
|
Reference in New Issue
Block a user