Skip to content

Commit

Permalink
add code from kdl
Browse files Browse the repository at this point in the history
  • Loading branch information
cliserkad committed Jan 14, 2024
1 parent 85f88b1 commit 09e9393
Show file tree
Hide file tree
Showing 163 changed files with 7,647 additions and 87 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# link to patreon

patreon: cliserkad
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug Report
about: Encountering errors? Let us know
title: x is broken
labels: bug
assignees: cliserkad

---

**Description**
A clear and concise description of what the bug is.

**Reproduction**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expectation**
A clear and concise description of what you expected to happen.

**Environment Info**
- OS: [e.g. Windows 10]
- IDEA: [e.g. IntelliJ]
- Commit: [commit hash of broken version]
- Architecture: [e.g. x86]

**Additional Context**
Add any other context about the problem here. If applicable, add screenshots to help explain your problem.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature Request
about: Suggest a new feature or improvement
title: Should have y
labels: enhancement
assignees: cliserkad

---

**Related problem / error / bug**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Solution**
A clear and concise description of what you want to happen.

**Alternatives**
A clear and concise description of any alternative solutions or features you've considered. If you have a hacky work around or fix, it could help develop the actual solution.

**Additional Context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
assignees:
- "cliserkad"
commit-message:
prefix: "update pom.xml"
include: "scope"
27 changes: 27 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will build a package using Maven and then publish it to GitHub packages
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path

name: Publish to GitHub Packages

on:
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up Java 21
uses: actions/setup-java@v4
with:
# this distribution is cached by github actions
distribution: 'temurin'
# jdk version to use, specified in pom.xml
java-version: '21'
# use the github actions cached jdk if available.
check-latest: false
- name: mvn deploy
run: mvn -B deploy --no-transfer-progress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 13 additions & 10 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ name: Test with Maven
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
# linux is cool. Maybe I'll add more targets later? shouldn't ever matter
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Java 21
uses: actions/setup-java@v4
with:
fetch-depth: 0
- name: Set up Java 19
uses: actions/setup-java@v1
with:
java-version: 19
# this distribution is cached by github actions
distribution: 'temurin'
# jdk version to use, specified in pom.xml
java-version: '21'
# use the github actions cached jdk if available.
check-latest: false
- name: mvn test
run: mvn clean test --file bootstrap/pom.xml --no-transfer-progress
# maven almost always fails to generate sources correctly without cleaning
# transfer progress is disabled to avoid spamming the log with progress bars
run: mvn clean test --file pom.xml --no-transfer-progress
17 changes: 6 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# compiled classes
*.class

# Maven output
**/gen
**/target

# IntelliJ files
**/.idea
*.iml
Expand All @@ -11,14 +15,5 @@
*.project
*.classpath

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

# Ignore Maven build directory
**/target/

# Ignore generated files
**/gen/
# ANTLR4 token files
*.tokens
72 changes: 31 additions & 41 deletions bootstrap/pom.xml
Original file line number Diff line number Diff line change
@@ -1,56 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>dev.fiz</groupId>
<artifactId>parent</artifactId>
<version>0.8.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>fiz-bootstrap</name>
<groupId>dev.fiz</groupId>
<artifactId>bootstrap</artifactId>
<version>0.0.0</version>
<packaging>jar</packaging>
<name>fiz Java Bootstrap</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<scm>
<connection>scm:git:${project.scm.url}</connection>
<developerConnection>scm:git:${project.scm.url}</developerConnection>
<url>https://github.com/cliserkad/fiz.git</url>
<tag>HEAD</tag>
</scm>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.41.1</version>
<configuration>
<release>19</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<failIfNoTests>true</failIfNoTests>
<java>
<eclipse>
<file>${project.parent.basedir}/java-format.xml</file> <!-- optional -->
</eclipse>
<!-- USE TABS!!! -->
<indent>
<tabs>true</tabs>
<spacesPerTab>4</spacesPerTab>
</indent>
</java>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>16.0.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</project>
46 changes: 46 additions & 0 deletions bootstrap/src/dev/fiz/bootstrap/Actor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package dev.fiz.bootstrap;

import dev.fiz.bootstrap.names.CommonText;
import dev.fiz.bootstrap.names.ReturnValue;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

public class Actor extends MethodVisitor implements Opcodes, CommonText {

public final CompilationUnit unit;

public Actor(final MethodVisitor methodVisitor, final CompilationUnit unit) {
super(Opcodes.ASM8, methodVisitor);
this.unit = unit;
}

public void writeReturn(ReturnValue rv) {
if(rv == null)
visitInsn(RETURN);
else if(rv.isBaseType() && !rv.toInternalName().isArray()) {
switch(rv.toBaseType()) {
case BOOLEAN:
case BYTE:
case CHAR:
case SHORT:
case INT:
visitInsn(IRETURN);
break;
case FLOAT:
visitInsn(FRETURN);
break;
case LONG:
visitInsn(LRETURN);
break;
case DOUBLE:
visitInsn(DRETURN);
break;
case STRING:
visitInsn(ARETURN);
break;
}
} else
visitInsn(ARETURN);
}

}
Loading

0 comments on commit 09e9393

Please sign in to comment.