Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nilium/codf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: nilium/codf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: codx
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 10 commits
  • 6 files changed
  • 1 contributor

Commits on Jun 28, 2019

  1. Add Name function to get a section/statement name

    This is a convenience function for pulling the value of the token that
    denotes a statement or section.
    nilium committed Jun 28, 2019
    Configuration menu
    Copy the full SHA
    04b860c View commit details
    Browse the repository at this point in the history
  2. Add Filter, Last, and First functions under codx

    codx is a new subpackage of codf that contains utility functions. Like
    everything else about codf, the API is currently unstable but unlikely
    to change drastically.
    
    This uses a Filterer to select children of a ParentNode and return
    them. For example, to get all foo statements in a document root, you'd
    use `Filter(doc, FilterStatements, FilterNamed("foo"))`. This is
    a convenience for grabbing relevant elements of an AST in an order
    that's convenient for iterating thorugh, rather than walking the whole
    document all at once.
    nilium committed Jun 28, 2019
    Configuration menu
    Copy the full SHA
    f93571e View commit details
    Browse the repository at this point in the history
  3. Add Start/End AST functions for nodes

    These are to get the start and end location of nodes without typing
    x.Token().Start each time. They're just convenience functions.
    nilium committed Jun 28, 2019
    Configuration menu
    Copy the full SHA
    fcff535 View commit details
    Browse the repository at this point in the history
  4. Add codx utilities

    These are utility functions I end up copy/pasting between projects, so
    I might as well merge them into codx for convenience.
    
    - args.go contains simple statement and section argument parsing
      functions. These will likely change a good deal over time as my ideas
      aobut how to handle that solidify.
    
    - mapping.go contains MapFunc and NodeMapper, which are used to wrap an
      existing Walker with a mapping function.
    
    - include.go contains the IncludeMapper, which implements general
      purpose `include FILE;` directives. A simple filesystem-based
      IncludeFunc is provided, but there's no requirement that an
      IncludeFunc is disk-only.
    
    - expand.go provides variable-expansion mappings.
    nilium committed Jun 28, 2019
    Configuration menu
    Copy the full SHA
    94beb83 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2019

  1. codx: Refactor argument parsing

    - Replace hardcoded cases in ParseArg with use of ExprValue (and Value
      for other cases). This functions similar to flag.Value, except
      there's no need for it to support fmt.Stringer.
    
    - Fix *url.URL type case. Regardless of whether a token fit a URL,
      a *url.URL output would return an error due to it falling out of its
      conditional to the error return.
    nilium committed Jul 15, 2019
    Configuration menu
    Copy the full SHA
    2dc98f6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    11ce8e0 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2019

  1. codx: Add double-star argument support

    This is mainly for use with protobuf-ish things and code where
    a concrete zero value has to be distinct from no value (nil).
    nilium committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    39c2b4d View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2019

  1. Add the option to get the token, location, or node in ParseArg

    This allows you to just pull a token out for further inspection if
    ParseArg and an ExprValue isn't really appropriate.
    nilium committed Jul 18, 2019
    Configuration menu
    Copy the full SHA
    87a4774 View commit details
    Browse the repository at this point in the history
  2. Add AllOf and OneOf ExprValue implementations

    These can be used to create first-matching or all-matching sets of
    arguments. AllOf is often more useful for pulling both the location or
    token of a node out at the same time as its value so that you can
    produce an error message. OneOf is useful with **T values where it's
    useful to use the first non-nil value.
    nilium committed Jul 18, 2019
    Configuration menu
    Copy the full SHA
    752d44e View commit details
    Browse the repository at this point in the history
  3. Add missing returns for new type cases

    Without these, we get expected-but-got errors that're missing
    information.
    nilium committed Jul 18, 2019
    Configuration menu
    Copy the full SHA
    2b944d1 View commit details
    Browse the repository at this point in the history
Loading