Skip to content

Commit

Permalink
Moved actual template parser to a separate parser package
Browse files Browse the repository at this point in the history
  • Loading branch information
hugithordarson committed Nov 20, 2024
1 parent 55f0062 commit 4c9ec17
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Objects;

import ng.appserver.templating.NGDeclaration.NGBindingValue;
import ng.appserver.templating.parser.NGDeclaration.NGBindingValue;

public class NGAssociationFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

import ng.appserver.NGApplication.NGElementNotFoundException;
import ng.appserver.resources.NGResource;
import ng.appserver.templating.NGDeclarationFormatException;
import ng.appserver.templating.NGHTMLFormatException;
import ng.appserver.templating.NGTemplateParserProxy;
import ng.appserver.templating.parser.NGDeclarationFormatException;
import ng.appserver.templating.parser.NGHTMLFormatException;

/**
* Stores information about the structure of the component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
import ng.appserver.elements.NGDynamicGroup;
import ng.appserver.elements.NGHTMLBareString;
import ng.appserver.elements.NGHTMLCommentString;
import ng.appserver.templating.NGDeclaration.NGBindingValue;
import ng.appserver.templating.parser.NGDeclarationFormatException;
import ng.appserver.templating.parser.NGHTMLFormatException;
import ng.appserver.templating.parser.NGTemplateParser;
import ng.appserver.templating.parser.PBasicNode;
import ng.appserver.templating.parser.PCommentNode;
import ng.appserver.templating.parser.PGroupNode;
import ng.appserver.templating.parser.PHTMLNode;
import ng.appserver.templating.parser.PNode;
import ng.appserver.templating.parser.NGDeclaration.NGBindingValue;
import x.junk.NGElementNotFoundElement;
import x.junk.NGErrorMessageElement;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.Map;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

public class NGDeclarationFormatException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.StringTokenizer;

import ng.appserver.templating.NGDeclaration.NGBindingValue;
import ng.appserver.templating.parser.NGDeclaration.NGBindingValue;

public class NGDeclarationParser {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

public class NGHTMLFormatException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.NoSuchElementException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.StringTokenizer;

import ng.appserver.templating.NGDeclaration.NGBindingValue;
import ng.appserver.templating.parser.NGDeclaration.NGBindingValue;

/**
* The primary entry point for component parsing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.List;
import java.util.Map;
import java.util.Objects;

import ng.appserver.templating.NGDeclaration.NGBindingValue;
import ng.appserver.templating.parser.NGDeclaration.NGBindingValue;

public record PBasicNode( NGDynamicHTMLTag tag ) implements PNode {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.List;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

public sealed interface PNode permits PBasicNode, PGroupNode, PHTMLNode, PCommentNode {}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

import ng.appserver.templating.parser.NGDeclarationParser;

public class TestNGDeclarationParser {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ng.appserver.templating.parser;

public class TestNGDynamicHTMLTag {

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package ng.appserver.templating;
package ng.appserver.templating.parser;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;

import org.junit.jupiter.api.Test;

import ng.appserver.templating.parser.NGHTMLFormatException;
import ng.appserver.templating.parser.NGTemplateParser;

public class TestNGTemplateParser {

// @Test
Expand Down

0 comments on commit 4c9ec17

Please sign in to comment.