<commit_before>Analog Example
--------------

Spelling note: this is spelt analog, rather than analogue because that's the
spelling in the API. I normally prefer UK spellings for things for obvious
reasons, but in this case consistency makes sense.

The purpose of this example is to provide a practical test for creating and
testing the following API and language elements:

   * Support for profile defined variables - such as A0
   * Support for profile defined objects - such as Serial
   * Support for proifle defined functions - such as analogRead, analogWrite

Furthermore it (unintentionally) caused the need to turn "print" from being a
separate syntactic value to being a function. This is necessary to support
things like Serial.print. This is a little frustrating because I'd hoped to
deal with this later, but it's such an important change, it needs to happen
sooner rather than later.

Current issues:

* print is not a function, but a syntactic structure. This causes
  Serial.print to be invalid syntax.

* We can define variables like A0 in the profile context, but it is
  currently generating a *string* "A0" in the generated code. This
  is unintentional and undesirable.

* It would be nice to not generate extraneous brackets around expressions
  if we could avoid it.

Positive points:

* If we change print to _print, code is generated. In the output code,
  if we manually change _print to print, the build succeeds.

* If we change in the generated code the strings incorrectly generated,
  that is "A0" to Ao - then the build succeeds.

This suggests that the code changes required for analysis are minimal,
which is something.

<commit_msg>Updated readme for analog example - include sample generated code<commit_after>Analog Example
--------------

Spelling note: this is spelt analog, rather than analogue because that's the
spelling in the API. I normally prefer UK spellings for things for obvious
reasons, but in this case consistency makes sense.

The purpose of this example is to provide a practical test for creating and
testing the following API and language elements:

   * Support for profile defined variables - such as A0
   * Support for profile defined objects - such as Serial
   * Support for proifle defined functions - such as analogRead, analogWrite

Furthermore it (unintentionally) caused the need to turn "print" from being a
separate syntactic value to being a function. This is necessary to support
things like Serial.print. This is a little frustrating because I'd hoped to
deal with this later, but it's such an important change, it needs to happen
sooner rather than later.


### Current Source

    analogInPin = A0
    analogOutPin = 9
    sensorValue = 0
    outputValue = 0
    Serial.begin(9600)

    while True:
        sensorValue = analogRead(analogInPin)
        outputValue = map(sensorValue, 0, 1023, 0, 255)
        analogWrite(analogOutPin, outputValue)
        Serial.print("sensor:- ")
        Serial.print(sensorValue)
        Serial.print("output:- ")
        Serial.print(outputValue)
        Serial.println("--------")
        delay(2)

### Generated C++

    #include "iterators.cpp"

    void setup() {
        int analogInPin;
        int analogOutPin;
        int outputValue;
        int sensorValue;

        analogInPin = A0;
        analogOutPin = 9;
        sensorValue = 0;
        outputValue = 0;
        (Serial).begin(9600);
        while (true) {
            sensorValue = analogRead(analogInPin);
            outputValue = map(sensorValue, 0, 1023, 0, 255);
            analogWrite(analogOutPin, outputValue);
            (Serial).print("sensor:- ");
            (Serial).print(sensorValue);
            (Serial).print("output:- ");
            (Serial).print(outputValue);
            (Serial).println("--------");
            delay(2);
        };
    }

    void loop() {
    }
{'fraction_non_alphanumeric': 0.07336605528287264, 'fraction_numerical': 0.010591578403513303, 'mean_word_length': 2.975359342915811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4118551', 'n_tokens_mistral': 1038, 'n_tokens_neox': 974, 'n_words': 470}