Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Moses Mendoza updated an issue Puppet / PUP-7033 Data Type Reuse in Patterns Should be Feasible Change By: Moses Mendoza Team: Agent Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Moses Mendoza commented on PUP-7033 Re: Data Type Reuse in Patterns Should be Feasible Henrik Lindberg do you have an epic this issue might go into? Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Henrik Lindberg commented on PUP-7033 Re: Data Type Reuse in Patterns Should be Feasible This is actually a string scanner type (like in a lexer). I can imagine that the type describes a sequence of scans (as done by the Ruby StringScanner). The types added as parameters must be string matching types. If a type describes variants (Variant, Patterns) it is taken as an OR. A type that matches an anchored regexp can be used, but it will match from current pos for ^ and the end of input/line for $ and \Z. As an example: Scan[ '(', Pattern['a', 'b', 'c'], ')' ] would match strings like "(a)", "(b)", and "(c)". Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7033 Data Type Reuse in Patterns Should be Feasible Change By: Henrik Lindberg Component/s: Type System Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7033 Data Type Reuse in Patterns Should be Feasible Change By: Henrik Lindberg Labels: triaged Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Henrik Lindberg commented on PUP-7033 Re: Data Type Reuse in Patterns Should be Feasible Hm, what you seem to be after is more like interpolation into a "composite" regexp. Problem is then that you do not have variables to interpolate, only types. Maybe we can come up with something along those lines. henrik Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Thomas Hallgren commented on PUP-7033 Re: Data Type Reuse in Patterns Should be Feasible I fail to see how an And would solve this problem. The first regexp is anchored. Saying that it should match together with another regexp will not create a match for something that is bracketed. Building regexps like this will require: 1. A string that matches the regexp without anchors. 2. The anchored 'base' regexp which amounts to string concatenation at beginning and end of #1 3. The anchored 'bracketed' regexp which a similar concatenation of #1 (it does not involve #2) I don't think we will ever try to parse a regexp and make intelligent decisions on how to dissect and reassemble it so in order to address pattern reuse as presented here, we need to discuss how to make string concatenation possible in type expressions. One alternative could be: type BasePattern = String['base pattern without anchors goes here'] type Base = Pattern[String['^'].instance + BasePattern.instance + String['$'].instance] There's no instance method on a type at present, but there could be. It would distinguish the type from the instance that the type describes in cases where this is applicable (which it might be for String and Number, Struct, and Tuple types). The distinction between type and instance is important. We already use binary operators on types and we may want to use '+' as a way to concatenating the types themselves. Add Comment
Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Trevor Vaughan commented on PUP-7033 Re: Data Type Reuse in Patterns Should be Feasible Henrik Lindberg An AND would probably work. String + String is easy. Regex combinations could be done as long as they are not anchored or if the first and last elements are the only ones that are anchored. String + Regex + String should also be easy as long as it's a bookend. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Henrik Lindberg commented on PUP-7033 Re: Data Type Reuse in Patterns Should be Feasible Trevor Vaughan - so, the Pattern is an OR between a set of patterns. For this case, it looks like maybe a general And[T,...] type would work. Just a concat of regexps is difficult though, since it requires rewriting a pattern that is already anchored (as in your case). Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7033) Data Type Reuse in Patterns Should be Feasible
Title: Message Title Trevor Vaughan created an issue Puppet / PUP-7033 Data Type Reuse in Patterns Should be Feasible Issue Type: Improvement Affects Versions: PUP 4.8.1 Assignee: Unassigned Components: Language Created: 2016/12/19 6:59 AM Priority: Normal Reporter: Trevor Vaughan I'm honestly not sure how you would go about this, but currently you must repeat your Data Type aliases constantly to cover all cases. Example: Base IPv6 Address: https://github.com/simp/pupmod-simp-simplib/blob/master/types/ip/v6/base.pp Bracketed IPv6 Address: https://github.com/simp/pupmod-simp-simplib/blob/master/types/ip/v6/bracketed.pp It would be really nice if the Bracketed case could be something like the following instead: type Simplib::IP::V6::Bracketed = Composite[String['['], Simplib::IP::V6::Base,