Skip to content

Commit d5341c9

Browse files
committed
support "string" route names for lapis route detection in moon-tags
1 parent 65c7b15 commit d5341c9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/moon-tags

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ export_list = Ct P"{" * P {
5656

5757
eof_exports = P { export_list * S(" \t\r\n")^0 * P(-1) + P(1) * V(1) }
5858

59+
-- convert a parsed string to the value the string represents
60+
StringVal = C(String) / (str) -> loadstring("return " .. str)()
61+
5962
class_line = Line "class", P"class" * whitespace^1 * Cg(literals.Name, "tag") * until_end
6063
class_property = Line "property", self_prefix^-1 * Cg(literals.Name, "tag") * P":" * whitespace^0 * Cg(String, "value")^0 * until_end
6164
class_method = Line("method", P("@")^-1 * Cg(literals.Name, "tag") * P":" * method) * until_end
6265
function_def = Line("function", Cg(literals.Name, "tag") * whitespace^0 * P"=" * func) * until_end
63-
lapis_route = Line "lapis-route", P"[" * Cg(literals.Name, "tag") * P":" * whitespace^0 * Cg(String, "route") * whitespace^0 * P("]:") * until_end
66+
lapis_route = Line "lapis-route", P"[" * Cg(literals.Name + StringVal, "tag") * P":" * whitespace^0 * Cg(String, "route") * whitespace^0 * P("]:") * until_end
6467

6568
line_types = class_line + class_method + class_property + function_def
6669

0 commit comments

Comments
 (0)