Skip to content

Commit

Permalink
Move Memo inside a package
Browse files Browse the repository at this point in the history
  • Loading branch information
RowDaBoat committed Feb 19, 2024
1 parent dd86c98 commit ef24fbc
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 13 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build with Gradle

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Build with Gradle
run: ./gradlew build

2 changes: 1 addition & 1 deletion src/main/kotlin/io/vexel/kobold/lexer/Lexer.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.vexel.kobold.lexer

import MatcherMemo
import io.vexel.kobold.matchers.MatcherMemo
import io.vexel.kobold.Token
import io.vexel.kobold.lexer.dsl.IgnoredToken
import io.vexel.kobold.lexer.dsl.NothingToken
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/io/vexel/kobold/lexer/LexerDSL.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.vexel.kobold.lexer

import MatcherMemo
import io.vexel.kobold.matchers.MatcherMemo
import io.vexel.kobold.lexer.dsl.*
import io.vexel.kobold.lexer.rules.LexerRule

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.vexel.kobold.lexer.dsl

import MatcherMemo
import io.vexel.kobold.matchers.MatcherMemo
import io.vexel.kobold.matchers.Concatenation
import io.vexel.kobold.matchers.Matcher
import io.vexel.kobold.matchers.NonTerminal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.vexel.kobold.lexer.dsl

import MatcherMemo
import io.vexel.kobold.matchers.MatcherMemo
import io.vexel.kobold.matchers.*

interface ZeroOrMoreOperatorDSL {
Expand Down
5 changes: 2 additions & 3 deletions src/main/kotlin/io/vexel/kobold/matchers/MatcherMemo.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package io.vexel.kobold.matchers

import io.vexel.kobold.Accepted
import io.vexel.kobold.Result
import io.vexel.kobold.matchers.NonTerminal
import io.vexel.kobold.matchers.State
import io.vexel.kobold.matchers.Tokens

class MatcherMemo {
private val states = hashMapOf<Parameters, State>()
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/io/vexel/kobold/matchers/NonTerminal.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.vexel.kobold.matchers

import MatcherMemo
import io.vexel.kobold.*

class NonTerminal(private val memo: MatcherMemo, private val producer: ((List<Symbol>) -> Symbol)? = null) : Matcher {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/io/vexel/kobold/parser/ParserDSL.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.vexel.kobold.parser

import MatcherMemo
import io.vexel.kobold.matchers.MatcherMemo
import io.vexel.kobold.matchers.Empty
import io.vexel.kobold.parser.dsl.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.vexel.kobold.parser.dsl

import MatcherMemo
import io.vexel.kobold.matchers.MatcherMemo
import io.vexel.kobold.Symbol
import io.vexel.kobold.matchers.Matcher
import io.vexel.kobold.matchers.NonTerminal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.vexel.kobold.parser.dsl

import MatcherMemo
import io.vexel.kobold.matchers.MatcherMemo
import io.vexel.kobold.Token
import io.vexel.kobold.matchers.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.vexel.kobold.parser.dsl

import MatcherMemo
import io.vexel.kobold.matchers.MatcherMemo
import io.vexel.kobold.Token
import io.vexel.kobold.matchers.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.vexel.kobold.test.matchers

import MatcherMemo
import io.vexel.kobold.matchers.MatcherMemo
import io.vexel.kobold.Accepted
import io.vexel.kobold.Rejected
import io.vexel.kobold.Token
Expand Down

0 comments on commit ef24fbc

Please sign in to comment.