xcomponent 0.6.2__tar.gz → 0.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. {xcomponent-0.6.2 → xcomponent-0.6.4}/CHANGELOG.md +8 -0
  2. {xcomponent-0.6.2 → xcomponent-0.6.4}/Cargo.lock +1 -1
  3. {xcomponent-0.6.2 → xcomponent-0.6.4}/Cargo.toml +1 -1
  4. {xcomponent-0.6.2 → xcomponent-0.6.4}/PKG-INFO +1 -1
  5. {xcomponent-0.6.2 → xcomponent-0.6.4}/pyproject.toml +1 -1
  6. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/expression/ast/eval.rs +2 -0
  7. xcomponent-0.6.4/src/rust/expression/grammar.pest +73 -0
  8. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/expression/parser.rs +1 -1
  9. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_binary_op.py +49 -2
  10. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_if_expr.py +6 -0
  11. {xcomponent-0.6.2 → xcomponent-0.6.4}/uv.lock +1 -1
  12. xcomponent-0.6.2/src/rust/expression/grammar.pest +0 -75
  13. {xcomponent-0.6.2 → xcomponent-0.6.4}/.github/workflows/build-sdist.yml +0 -0
  14. {xcomponent-0.6.2 → xcomponent-0.6.4}/.github/workflows/build-wheels.yml +0 -0
  15. {xcomponent-0.6.2 → xcomponent-0.6.4}/.github/workflows/publish-doc.yml +0 -0
  16. {xcomponent-0.6.2 → xcomponent-0.6.4}/.github/workflows/publish-pypi.yml +0 -0
  17. {xcomponent-0.6.2 → xcomponent-0.6.4}/.github/workflows/release.yml +0 -0
  18. {xcomponent-0.6.2 → xcomponent-0.6.4}/.github/workflows/tests-artifacts.yml +0 -0
  19. {xcomponent-0.6.2 → xcomponent-0.6.4}/.github/workflows/tests.yml +0 -0
  20. {xcomponent-0.6.2 → xcomponent-0.6.4}/.gitignore +0 -0
  21. {xcomponent-0.6.2 → xcomponent-0.6.4}/.python-version +0 -0
  22. {xcomponent-0.6.2 → xcomponent-0.6.4}/Justfile +0 -0
  23. {xcomponent-0.6.2 → xcomponent-0.6.4}/LICENSE +0 -0
  24. {xcomponent-0.6.2 → xcomponent-0.6.4}/README.md +0 -0
  25. {xcomponent-0.6.2 → xcomponent-0.6.4}/docs/Makefile +0 -0
  26. {xcomponent-0.6.2 → xcomponent-0.6.4}/docs/source/conf.py +0 -0
  27. {xcomponent-0.6.2 → xcomponent-0.6.4}/docs/source/develop/.gitkeep +0 -0
  28. {xcomponent-0.6.2 → xcomponent-0.6.4}/docs/source/index.md +0 -0
  29. {xcomponent-0.6.2 → xcomponent-0.6.4}/docs/source/user/changelog.md +0 -0
  30. {xcomponent-0.6.2 → xcomponent-0.6.4}/docs/source/user/getting_started.md +0 -0
  31. {xcomponent-0.6.2 → xcomponent-0.6.4}/scripts/get_version.py +0 -0
  32. {xcomponent-0.6.2 → xcomponent-0.6.4}/scripts/write_changelog.py +0 -0
  33. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/python/xcomponent/__init__.py +0 -0
  34. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/python/xcomponent/py.typed +0 -0
  35. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/python/xcomponent/service/__init__.py +0 -0
  36. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/python/xcomponent/service/catalog.py +0 -0
  37. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/python/xcomponent/xcore.pyi +0 -0
  38. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/catalog/catalog.rs +0 -0
  39. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/catalog/mod.rs +0 -0
  40. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/context.rs +0 -0
  41. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/expression/ast/mod.rs +0 -0
  42. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/expression/ast/model.rs +0 -0
  43. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/expression/ast/parse.rs +0 -0
  44. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/expression/mod.rs +0 -0
  45. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/expression/tokens.rs +0 -0
  46. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/lib.rs +0 -0
  47. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/markup/grammar.pest +0 -0
  48. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/markup/mod.rs +0 -0
  49. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/markup/parser.rs +0 -0
  50. {xcomponent-0.6.2 → xcomponent-0.6.4}/src/rust/markup/tokens.rs +0 -0
  51. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/__init__.py +0 -0
  52. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/__init__.py +0 -0
  53. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/conftest.py +0 -0
  54. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_binary_eq.py +0 -0
  55. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_binary_op_bool.py +0 -0
  56. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_default_values.py +0 -0
  57. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_field_access.py +0 -0
  58. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_for_expr.py +0 -0
  59. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_func.py +0 -0
  60. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_let.py +0 -0
  61. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_nested.py +0 -0
  62. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_render_comment.py +0 -0
  63. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_str_method.py +0 -0
  64. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_types.py +0 -0
  65. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/expression/test_unary.py +0 -0
  66. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_core.py +0 -0
  67. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_named_component.py +0 -0
  68. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_render_attributes.py +0 -0
  69. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_render_context.py +0 -0
  70. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_render_globals.py +0 -0
  71. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_render_globals_obj.py +0 -0
  72. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_render_globals_obj2.py +0 -0
  73. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_render_nested_dict.py +0 -0
  74. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_render_nested_node.py +0 -0
  75. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_render_node.py +0 -0
  76. {xcomponent-0.6.2 → xcomponent-0.6.4}/tests/unittests/test_render_script.py +0 -0
@@ -1,3 +1,11 @@
1
+ ## 0.6.4 - 2025-09-01
2
+
3
+ * Fix expression that starts with a string
4
+
5
+ ## 0.6.3 - 2025-08-30
6
+
7
+ * Implement not operator for str and int
8
+
1
9
  ## 0.6.2 - 2025-08-15
2
10
 
3
11
  * Fix nested var in if stmt
@@ -595,7 +595,7 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
595
595
 
596
596
  [[package]]
597
597
  name = "xcore"
598
- version = "0.6.2"
598
+ version = "0.6.4"
599
599
  dependencies = [
600
600
  "env_logger",
601
601
  "html-escape",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "xcore"
3
- version = "0.6.2"
3
+ version = "0.6.4"
4
4
  authors = ["Guillaume Gauvrit <guillaume@gauvr.it>"]
5
5
  edition = "2021"
6
6
  description = "JSX-like for python using maturin/pyo3 and pest."
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xcomponent
3
- Version: 0.6.2
3
+ Version: 0.6.4
4
4
  Classifier: License :: OSI Approved :: MIT License
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.11
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "xcomponent"
3
- version = "0.6.2"
3
+ version = "0.6.4"
4
4
  description = "A component base template engige - inspired by JSX"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Guillaume Gauvrit", email = "guillaume@gauvr.it" }]
@@ -190,6 +190,8 @@ pub fn eval_ast<'py>(
190
190
  let value = eval_ast(py, expr, catalog, context)?;
191
191
  match (op, value) {
192
192
  (UnaryOperator::Not, Literal::Bool(b)) => Ok(Literal::Bool(!b)),
193
+ (UnaryOperator::Not, Literal::Int(i)) => Ok(Literal::Bool(i == 0)),
194
+ (UnaryOperator::Not, Literal::Str(s)) => Ok(Literal::Bool(s.len() == 0)),
193
195
  (UnaryOperator::Not, other) => Err(PyErr::new::<pyo3::exceptions::PyTypeError, _>(
194
196
  format!("Cannot apply 'not' to {:?}", other),
195
197
  )),
@@ -0,0 +1,73 @@
1
+ expression = { for_expression | if_expression | let_expression | binary_expression | comment_expression }
2
+
3
+ binary_expression = { comment_expression* ~ whitespace* ~ term ~ (whitespace* ~ operator ~ whitespace* ~ term)* }
4
+
5
+ term = _{ for_expression | if_expression | let_expression | unary_expression | postfix }
6
+
7
+ unary_expression = { "not" ~ whitespace+ ~ binary_expression }
8
+
9
+ postfix = _{ primary ~ (postfix_op)* }
10
+ postfix_op = _{ field | index | call }
11
+
12
+ field = { "." ~ ident }
13
+ index = { "[" ~ expression ~ "]" }
14
+ call = { "(" ~ whitespace* ~ call_args? ~ whitespace* ~ ")" }
15
+
16
+ call_args = _{ call_arg ~ (whitespace* ~ "," ~ whitespace* ~ call_arg)* }
17
+ call_arg = _{ kw_arg | pos_arg }
18
+ pos_arg = { expression }
19
+ kw_arg = { ident ~ whitespace* ~ "=" ~ whitespace* ~ expression }
20
+
21
+ primary = _{ "(" ~ expression ~ ")" | component | string | integer | boolean | ident }
22
+
23
+ operator = { "+" | "-" | "*" | "/" | "and" | "or" | "==" | "!=" | ">=" | "<=" | ">" | "<" }
24
+
25
+ boolean = { "true" | "false" }
26
+ integer = @{ (ASCII_DIGIT | "_")+ }
27
+ string = @{
28
+ ("\"" ~ (escape_sequence | !("\"" | "\\") ~ ANY)* ~ "\"")
29
+ | ("'" ~ (escape_sequence | !("'" | "\\") ~ ANY)* ~ "'")
30
+ }
31
+
32
+ keyword = { "for" | "in" | "if" | "else" | "not" | "and" | "or" | "let" }
33
+ keyword_spaced = { keyword ~ (whitespace+ | ".") }
34
+
35
+ ident = { !keyword_spaced ~ ident_raw }
36
+ ident_raw = _{ (ASCII_ALPHA | "_" | "#") ~ (ASCII_ALPHANUMERIC | "_" | "#")* }
37
+
38
+ whitespace = _{ " " | "\t" | "\n" | "\r" | comment_expression }
39
+ escape_sequence = { "\\" ~ ("\"" | "'" | "\\" | "n" | "t" | "r") }
40
+
41
+ if_expression = { "if " ~ whitespace* ~ binary_expression ~ whitespace* ~ block ~ (whitespace* ~ "else" ~ whitespace* ~ block)? }
42
+ for_expression = { "for" ~ whitespace+ ~ ident ~ whitespace+ ~ "in" ~ whitespace+ ~ expression ~ whitespace* ~ block }
43
+ let_expression = { "let" ~ whitespace+ ~ ident ~ whitespace* ~ "=" ~ whitespace* ~ expression }
44
+
45
+ block = { whitespace* ~ "{" ~ whitespace* ~ expression ~ whitespace* ~ "}" ~ whitespace* }
46
+
47
+ comment_expression = _{ "/*" ~ comment ~ "*/" }
48
+ comment = { (!"*/" ~ ANY)* }
49
+
50
+ component = { markup_element | markup_fragment }
51
+
52
+ markup_node = _{ markup_element | markup_fragment | markup_comment | markup_text | markup_expression }
53
+ markup_element = _{ markup_self_closing_element | markup_normal_element }
54
+
55
+ markup_normal_element = { markup_open_tag ~ markup_node* ~ markup_close_tag }
56
+ markup_self_closing_element = _{ "<" ~ markup_ident ~ (whitespace* ~ markup_attribute)* ~ whitespace* ~ "/>" }
57
+ markup_open_tag = _{ "<" ~ markup_ident ~ (whitespace* ~ markup_attribute)* ~ whitespace* ~ ">" }
58
+ markup_close_tag = @{ "</" ~ markup_ident ~ ">" }
59
+
60
+ markup_fragment = _{ markup_open_fragment ~ markup_node* ~ markup_close_fragment }
61
+ markup_open_fragment = _{ "<>" }
62
+ markup_close_fragment = _{ "</>" }
63
+
64
+ markup_attribute = _{ markup_attr_name ~ ("=" ~ markup_attr_value)? }
65
+ markup_comment = _{ "<!--" ~ (!"-->" ~ ANY)* ~ "-->" }
66
+ markup_expression = _{ "{" ~ whitespace* ~ expression ~ whitespace* ~ "}" }
67
+
68
+ markup_ident = @{ ASCII_ALPHANUMERIC ~ (ASCII_ALPHANUMERIC | "_")* }
69
+ markup_attr_name = @{ (ASCII_ALPHA | "_") ~ (ASCII_ALPHANUMERIC | "_" | "-" | ":" | ".")* }
70
+ markup_attr_value = @{ markup_string_literal_quote | markup_string_literal_doublequote | markup_expression }
71
+ markup_string_literal_doublequote = _{ "\"" ~ (!"\"" ~ ANY)* ~ "\"" }
72
+ markup_string_literal_quote = _{ "'" ~ (!"'" ~ ANY)* ~ "'" }
73
+ markup_text = @{ (!("<" | "{") ~ ANY)+ }
@@ -144,7 +144,7 @@ fn parse_expression_token(pair: Pair<Rule>) -> Result<ExpressionToken, String> {
144
144
  Ok(ExpressionToken::Boolean(value))
145
145
  }
146
146
  Rule::string => {
147
- let value = pair.as_str().trim_matches('"');
147
+ let value = pair.as_str().trim_matches(|c| c == '"' || c == '\'');
148
148
  debug!("Pushing string {}", value);
149
149
  Ok(ExpressionToken::String(value.to_string()))
150
150
  }
@@ -1,7 +1,7 @@
1
- from typing import Any
1
+ from typing import Any, Literal
2
2
  import pytest
3
3
 
4
- from xcomponent import Catalog
4
+ from xcomponent import Catalog, XNode
5
5
  from xcomponent.service.catalog import Component
6
6
 
7
7
  catalog = Catalog()
@@ -12,6 +12,33 @@ def AddOp(a: int | bool | str, b: int | bool | str) -> str:
12
12
  return """<>{a + b}</>"""
13
13
 
14
14
 
15
+ @catalog.component
16
+ def Button(
17
+ children: XNode,
18
+ type: Literal["submit", "button", "reset"] = "submit",
19
+ id: str | None = None,
20
+ name: str = "action",
21
+ value: str = "submit",
22
+ hx_target: str | None = None,
23
+ ) -> str:
24
+ return """
25
+ <button
26
+ type={type}
27
+ name={name}
28
+ value={value}
29
+ id={id}
30
+ hx-target={hx_target}
31
+ >
32
+ {children}
33
+ </button>
34
+ """
35
+
36
+
37
+ @catalog.component
38
+ def ExprAttr(id: str) -> str:
39
+ return """<Button id={id} name={id + "-btn"} hx-target={'#' + id}>X</Button>"""
40
+
41
+
15
42
  @catalog.component
16
43
  def SubOp(a: int | bool | str, b: int | bool) -> str:
17
44
  return """<>{a - b}</>"""
@@ -68,6 +95,26 @@ def test_add(component: str, expected: str):
68
95
  assert component == expected
69
96
 
70
97
 
98
+
99
+ @pytest.mark.parametrize(
100
+ "component,expected",
101
+ [
102
+ pytest.param(AddOp(4, 2), "6", id="add int"),
103
+ pytest.param(AddOp(13, 5), "18", id="add int-2"),
104
+ pytest.param(AddOp(True, 2), "3", id="add bool and int"),
105
+ pytest.param(AddOp(True, False), "1", id="add true-false"),
106
+ pytest.param(AddOp(False, False), "0", id="add false-false"),
107
+ pytest.param(AddOp(True, True), "2", id="add true-true"),
108
+ pytest.param(AddOp("1", "2"), "12", id="concat str"),
109
+
110
+ ],
111
+ )
112
+ def test_add_attr(component: str, expected: str):
113
+ resp = ExprAttr("close")
114
+ assert 'hx-target="#close"' in resp
115
+ assert 'name="close-btn"' in resp
116
+
117
+
71
118
  @pytest.mark.parametrize(
72
119
  "component,expected",
73
120
  [
@@ -71,6 +71,12 @@ def Hint(text: str | None = None) -> str:
71
71
  pytest.param(IfNotStmt(True, "Yes"), "<p></p>"),
72
72
  pytest.param(IfNotElseStmt(True, "No", "Yes"), "<p>Yes</p>"),
73
73
  pytest.param(IfNotElseStmt(False, "No", "Yes"), "<p>No</p>"),
74
+ pytest.param(IfNotElseStmt(0, "No", "Yes"), "<p>No</p>"),
75
+ pytest.param(IfNotElseStmt(1, "No", "Yes"), "<p>Yes</p>"),
76
+ pytest.param(IfNotElseStmt(42, "No", "Yes"), "<p>Yes</p>"),
77
+ pytest.param(IfNotElseStmt("", "No", "Yes"), "<p>No</p>"),
78
+ pytest.param(IfNotElseStmt("0", "No", "Yes"), "<p>Yes</p>"),
79
+ pytest.param(IfNotElseStmt("that's it", "No", "Yes"), "<p>Yes</p>"),
74
80
  pytest.param(IfListStmt(["a"], "b"), "<p>a</p>"),
75
81
  pytest.param(IfListStmt([], "b"), "<p>b</p>"),
76
82
  pytest.param(IfSelfClosedComponent(True), "<p>Ha ha!</p>"),
@@ -598,7 +598,7 @@ wheels = [
598
598
 
599
599
  [[package]]
600
600
  name = "xcomponent"
601
- version = "0.6.2"
601
+ version = "0.6.4"
602
602
  source = { editable = "." }
603
603
 
604
604
  [package.optional-dependencies]
@@ -1,75 +0,0 @@
1
- expression = { for_expression | if_expression | let_expression | binary_expression | comment_expression }
2
-
3
- binary_expression = { comment_expression* ~ whitespace* ~ term ~ (whitespace* ~ operator ~ whitespace* ~ term)* }
4
-
5
- term = _{ for_expression | if_expression | let_expression | unary_expression | postfix }
6
-
7
- unary_expression = { "not" ~ whitespace+ ~ binary_expression }
8
-
9
- postfix = _{ primary ~ (postfix_op)* }
10
- postfix_op = _{ field | index | call }
11
-
12
- field = { "." ~ ident }
13
- index = { "[" ~ expression ~ "]" }
14
- call = {
15
- "(" ~ whitespace* ~ call_args? ~ whitespace* ~ ")"
16
- }
17
-
18
- call_args = _{ call_arg ~ (whitespace* ~ "," ~ whitespace* ~ call_arg)* }
19
- call_arg = _{ kw_arg | pos_arg }
20
- pos_arg = { expression }
21
- kw_arg = { ident ~ whitespace* ~ "=" ~ whitespace* ~ expression }
22
-
23
- primary = _{ "(" ~ expression ~ ")" | component | string | integer | boolean | ident }
24
-
25
- operator = { "+" | "-" | "*" | "/" | "and" | "or" | "==" | "!=" | ">=" | "<=" | ">" | "<" }
26
- boolean = { "true" | "false" }
27
- integer = @{ (ASCII_DIGIT | "_")+ }
28
- string = @{ "\"" ~ (escape_sequence | !("\"" | "\\") ~ ANY)* ~ "\"" }
29
-
30
- keyword = { "for" | "in" | "if" | "else" | "not" | "and" | "or" | "let" }
31
-
32
- keyword_spaced = { keyword ~ (whitespace+ | ".") }
33
- ident = { !keyword_spaced ~ ident_raw }
34
- ident_raw = _{ (ASCII_ALPHA | "_") ~ (ASCII_ALPHANUMERIC | "_")* }
35
-
36
- whitespace = _{ " " | "\t" | "\n" | "\r" | comment_expression }
37
- escape_sequence = { "\\" ~ ( "\"" | "\\" | "n" | "t" | "r" ) }
38
-
39
- if_expression = {
40
- "if " ~ whitespace* ~ binary_expression ~ whitespace* ~ block ~ (whitespace* ~ "else" ~ whitespace* ~ block )?
41
- }
42
-
43
- for_expression = { "for" ~ whitespace+ ~ ident ~ whitespace+ ~ "in" ~ whitespace+ ~ expression ~ whitespace* ~ block }
44
-
45
- let_expression = { "let" ~ whitespace+ ~ ident ~ whitespace* ~ "=" ~ whitespace* ~ expression }
46
-
47
- block = { whitespace* ~"{" ~ whitespace* ~ expression ~ whitespace* ~ "}" ~ whitespace* }
48
- comment_expression = _{ "/*" ~ comment ~ "*/" }
49
- comment = { (!"*/" ~ ANY)* }
50
-
51
- component = { markup_element | markup_fragment }
52
- markup_node = _{ markup_element | markup_fragment | markup_comment | markup_text | markup_expression }
53
- markup_element = _{ markup_self_closing_element | markup_normal_element }
54
-
55
- markup_normal_element = {
56
- markup_open_tag ~ markup_node* ~ markup_close_tag
57
- }
58
-
59
- markup_self_closing_element = _{ "<" ~ markup_ident ~ (whitespace* ~ markup_attribute)* ~ whitespace* ~ "/>" }
60
- markup_open_tag = _{ "<" ~ markup_ident ~ (whitespace* ~ markup_attribute)* ~ whitespace* ~ ">" }
61
- markup_close_tag = @{ "</" ~ markup_ident ~ ">" }
62
-
63
- markup_fragment = _{ markup_open_fragment ~ markup_node* ~ markup_close_fragment }
64
- markup_open_fragment = _{ "<>" }
65
- markup_close_fragment = _{ "</>" }
66
- markup_attribute = _{ markup_attr_name ~ ("=" ~ markup_attr_value)? }
67
- markup_comment = _{ "<!--" ~ (!"-->" ~ ANY)* ~ "-->" }
68
- markup_expression = _{ "{" ~ whitespace* ~ expression ~ whitespace* ~ "}" }
69
-
70
- markup_ident = @{ ASCII_ALPHANUMERIC ~ (ASCII_ALPHANUMERIC | "_" )* }
71
- markup_attr_name = @{ (ASCII_ALPHA | "_" ) ~ (ASCII_ALPHANUMERIC | "_" | "-" | ":" | "." )* }
72
- markup_attr_value = @{ markup_string_literal_quote | markup_string_literal_doublequote | markup_expression }
73
- markup_string_literal_doublequote = _{ "\"" ~ (!"\"" ~ ANY)* ~ "\"" }
74
- markup_string_literal_quote = _{ "'" ~ (!"'" ~ ANY)* ~ "'" }
75
- markup_text = @{ (!("<" | "{") ~ ANY)+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes