Skip to content

Commit

Permalink
Merge pull request #42 from ange-yaghi/release/v0.0.5a
Browse files Browse the repository at this point in the history
Release/v0.0.5a
  • Loading branch information
ange-yaghi authored Aug 31, 2019
2 parents b865dbd + 5585a17 commit 737fdb7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

Piranha is currently used as an SDL (scene description language) for the [MantaRay](https://github.com/ange-yaghi/manta-ray) ray-tracer.

To get started, check out the introductory handbook: [Piranha Handbook](https://github.com/ange-yaghi/piranha/blob/master/docs/handbook/handbook.md)
For syntax highlighting in Visual Studio Code check out the [Piranha Visual Studio Code Extension](https://github.com/ange-yaghi/piranha-vscode-extension).

To get started, check out the introductory handbook: [Piranha Handbook](docs/handbook/handbook.md)

Example Piranha compiler implementation: [Hello World Piranha Compiler](https://github.com/ange-yaghi/piranha-hello-world-compiler)

Expand Down
2 changes: 2 additions & 0 deletions docs/handbook/handbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Piranha is a configurable programming language that allows for easy object-orien

Most examples given in this manual use a completely hypothetical Piranha language and thus cannot be run. Running examples are given in the [Hello World Compiler Tutorial](#3.2).

For syntax highlighting, check out this project: [Piranha Visual Studio Code Extension](https://github.com/ange-yaghi/piranha-vscode-extension)

# <a name="2"></a>2 Syntax Overview

## <a name="2.1"></a>2.1 Literals
Expand Down
6 changes: 6 additions & 0 deletions include/node_program.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "node_container.h"
#include "pkey_value_lookup.h"
#include "ir_compilation_unit.h"

#include <vector>

Expand Down Expand Up @@ -35,7 +36,12 @@ namespace piranha {
std::string getRuntimeError() const { return m_errorMessage; }
void throwRuntimeError(const std::string &msg, Node *node);

void setRootUnit(IrCompilationUnit *unit) { m_rootUnit = unit; }
IrCompilationUnit *getRootUnit() const { return m_rootUnit; }

protected:
IrCompilationUnit *m_rootUnit;

NodeContainer m_topLevelContainer;
PKeyValueLookup<IrContextTree, NodeContainer *> m_containers;

Expand Down
2 changes: 1 addition & 1 deletion include/version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef PIRANHA_VERSION_H
#define PIRANHA_VERSION_H

#define PIRANHA_VERSION "v0.0.4a"
#define PIRANHA_VERSION "v0.0.5a"

#endif /* PIRANHA_VERSION_H */
3 changes: 2 additions & 1 deletion src/ir_compilation_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ piranha::IrCompilationUnit::~IrCompilationUnit() {
void piranha::IrCompilationUnit::build(NodeProgram *program) {
IrContextTree *context = new IrContextTree(nullptr);

program->setRootUnit(this);
program->addContainer(context, program->getTopLevelContainer());

int nodeCount = getNodeCount();
Expand Down Expand Up @@ -335,7 +336,7 @@ void piranha::IrCompilationUnit::addImportStatement(IrImportStatement *statement
}
}

piranha::IrImportStatement * piranha::IrCompilationUnit::getImportStatement(int index) const {
piranha::IrImportStatement *piranha::IrCompilationUnit::getImportStatement(int index) const {
return m_importStatements[index];
}

Expand Down

0 comments on commit 737fdb7

Please sign in to comment.