New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make preprocessor scope-aware #3810

Merged
merged 1 commit into from Sep 17, 2015

Conversation

Projects
None yet
2 participants
@JakubValtar
Contributor

JakubValtar commented Sep 17, 2015

Fixes #3799

  • scope is taken into account when determining the sketch mode and
    looking for size()
  • error checker received some love and now understands JAVA mode

Modes:

  • JAVA sketch contains "public class [sketchName] extends PApplet" in
    the global scope
  • ACTIVE sketch contains a method declaration in the global scope
  • STATIC sketch is everything else

size() parsing:

  • JAVA sketches: no parsing
  • ACTIVE mode: if there is setup() in global scope, we look there for
    the first occurrence, no parsing otherwise
  • STATIC sketches: first occurrence of size() in global scope
Make preprocessor scope-aware
- scope is taken into account when determining the sketch mode and
looking for size()
- error checker received some love and now understands JAVA mode

Modes:
- JAVA sketch contains "public class <sketchName> extends PApplet" in
the global scope
- ACTIVE sketch contains a method declaration in the global scope
- STATIC sketch is everything else

size() parsing:
- JAVA sketches: no parsing
- ACTIVE mode: if there is setup() in global scope, we look there for
the first occurrence, no parsing otherwise
- STATIC sketches: first occurrence of size() in global scope

benfry added a commit that referenced this pull request Sep 17, 2015

@benfry benfry merged commit e8dda21 into processing:master Sep 17, 2015

@JakubValtar JakubValtar deleted the JakubValtar:preprocessor-scopes branch Sep 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment