Class: Parser::Builders::Default

Inherits:
Object
  • Object
show all
Defined in:
opal/lib/opal/parser/patch.rb,
opal/lib/opal/parser/patch.rb

Direct Known Subclasses

Opal::AST::Builder

Instance Method Summary collapse

Instance Method Details

#check_lvar_name(name, loc) ⇒ Object



43
44
45
46
47
48
49
# File 'opal/lib/opal/parser/patch.rb', line 43

def check_lvar_name(name, loc)
  if name =~ `/^[\p{Ll}|_][\p{L}\p{Nl}\p{Nd}_]*$/u`
    # OK
  else
    diagnostic :error, :lvar_name, { name: name }, loc
  end
end

#string_value(token) ⇒ Object



82
83
84
# File 'opal/lib/opal/parser/patch.rb', line 82

def string_value(token)
  value(token)
end