Skip to content
Snippets Groups Projects
Commit a4ed5e49 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Prototype of @cfg tag implemented as a class.

parent 6479097a
No related branches found
No related tags found
No related merge requests found
module JsDuck::Builtins
# Implementation of @cfg tag.
class Cfg
def initialize
@pattern = "cfg"
end
def parse(p)
p.add_tag(:cfg)
p.maybe_type
p.maybe_name_with_default
maybe_required(p)
end
# matches: "(required)"
def maybe_required(p)
p.skip_horiz_white
if p.look(/\(required\)/i)
p.match(/\(required\)/i)
p.current_tag[:optional] = false
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment