Gaps in the grammar of Tritop

How explicit should it be when indicating spaces, is it or is it not allowed? For example, these rules:

rule lambda
  'lambda' ( '(' params ')' )? block
end

rule params
  # ...
end

rule block
  '{' # ... '}'
end

enough to match

lambda {
}

Basically, you need to specify wherever optional spaces may appear?

+3
source share
1 answer

Yes Yes. In these rules, you need to skip spaces, but, for example, when analyzing strings that may contain spaces, you would like to keep them; what you should indicate.

, treetop , " " , , . , , .

+2

All Articles