One-dimensional anyons in relativistic field theory