Skip to content

Commit

Permalink
Merge branch 'dev' into 1675-web-add-group-creation-and-registration
Browse files Browse the repository at this point in the history
  • Loading branch information
Zitrone44 committed Aug 28, 2024
2 parents 15a4bbd + c6c479d commit 5167b15
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build Docker images
run: docker-compose build
run: docker compose build
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ mulFactor : expo // higher presedence!
| mulFactor ' '* expo
;

expo : expo ' '* EXP ' '* SUB? factor
expo : expo ' '* EXP ' '* SUB? factor
| expo unicode_expo
| factor
;

factor : LEFT? OPENING_ROUND_BRACKET ' '* expr ' '* RIGHT? CLOSING_ROUND_BRACKET
| OPENING_CURLY_BRACKET ' '* expr ' '* CLOSING_CURLY_BRACKET
| EMPTY_CURLY_BRACKETS
| (NUMBER|VAR)
;

Expand Down Expand Up @@ -63,6 +64,7 @@ OPENING_ROUND_BRACKET: '(';
CLOSING_ROUND_BRACKET: ')';
OPENING_CURLY_BRACKET: '{';
CLOSING_CURLY_BRACKET: '}';
EMPTY_CURLY_BRACKETS: '{}';
OPENING_SQUARE_BRACKET: '[';
CLOSING_SQUARE_BRACKET: ']';
LEFT: '\\left';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class AstBuilder(val eq: MathParser.EqContext) {
factor.expr() !== null -> buildExpr(factor.expr())
factor.NUMBER() !== null -> Num(germanFormat.parse(factor.NUMBER().text.replace("{,}", ",")))
factor.VAR() !== null -> Var(factor.VAR().text)
factor.EMPTY_CURLY_BRACKETS() !== null -> Num(1)
else -> throw IllegalArgumentException("not a legal factor: ${factor.text}")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,16 @@ internal class MathParserHelperTest {
)
}

@Test
fun parseEmptyExp() {
assertEquals(
Ast(
Operation(Operator.ADD, Operation(Operator.EXP, Num(2), Num(1)), Operation(Operator.EXP, Num(2), Num(1)))
),
MathParserHelper.parse("2^{}+2^{}")
)
}

@Test
fun parseLatexRad() {
assertEquals(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,14 @@ internal class SemanticAstComparatorTest {
)
)
}

@Test
fun emptyExponentTest() {
assertTrue(
semanticAstComparator.compare(
MathParserHelper.parse("a^{}"),
MathParserHelper.parse("a")
)
)
}
}
12 changes: 6 additions & 6 deletions scripts/ci/docker-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ function dockerPush() {
tag=$1
echo "tag is: "$tag

docker tag feedbacksystem_runner thmmniii/fbs-runner:$tag
docker tag feedbacksystem_core thmmniii/fbs-core:$tag
docker tag feedbacksystem_runtime-bash thmmniii/fbs-runtime-bash:$tag
docker tag feedbacksystem_sql-checker thmmniii/fbs-sql-checker:$tag
docker tag feedbacksystem_dashboard thmmniii/fbs-eat:$tag
docker tag feedbacksystem-runner thmmniii/fbs-runner:$tag
docker tag feedbacksystem-core thmmniii/fbs-core:$tag
docker tag feedbacksystem-runtime-bash thmmniii/fbs-runtime-bash:$tag
docker tag feedbacksystem-sql-checker thmmniii/fbs-sql-checker:$tag
docker tag feedbacksystem-dashboard thmmniii/fbs-eat:$tag

docker push thmmniii/fbs-core:$tag
docker push thmmniii/fbs-runner:$tag
Expand All @@ -36,7 +36,7 @@ tag=$(generateDockerTag)

echo "START DOCKER BUILD"

docker-compose build
docker compose build

echo "START DOCKER DEPLOY"

Expand Down

0 comments on commit 5167b15

Please sign in to comment.