any help with this error on oled display

im new to arduino and trying to help my son with this project

error: exit status 1 a function-definition is not allowed here before '{' token

arduino uno
makerfocus I2C OLED
Maxbotix HRXL range finder

/*
OLED Ultrasonic.ino
Displays results on 128 x 32 OLED display
Uses Adafruit_Sensor.h
Uses Adafruit SSD1306 OLED Library
Uses Adafruit AM2320 Library
Uses Adafruit GFX Graphics Library
*/

// Include Wire Library for I2C
#include <Wire.h>
#include <Adafruit_Sensor.h>
// Include Adafruit Graphics & OLED libraries
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// Reset pin not used but needed for library
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

void setup() {
// Start Wire library for I2C
Wire.begin();

// initialize OLED with I2C addr 0x3C
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

const int pwPin1 = 2;
long sensor, mm, inches;

// Print a message to the OLED.
void read_sensor (){
sensor = pulseIn(pwPin1, HIGH);
mm = sensor;
inches = (mm/25.4-112);
}

void print_range() {
// Clear the buffer.
display.clearDisplay();

display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("TANK 1");
//display.setTextColor(WHITE); // 'inverted' text
display.setTextSize(2);
display.setTextColor(WHITE);
display.print("S1");
display.print("=");
display.print(mm);
display.print(" ");
display.print(inches);
display.print(" ");
display.setTextSize(1);
display.println("inches");
display.display();
delay(500);
}

void loop() { print_range();
display.display();
delay(500);
}

Read the how to use this forum-please read sticky to see how to properly post code and some advice on how to ask an effective question. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code.

Where is the curly bracket (}) to close the setup() function?

Using the IDE autoformat (ctrl-t or Tools, Auto Format) tool makes mistakes like that easier to see.

void read_sensor ()
{
   sensor = pulseIn(pwPin1, HIGH);
   mm = sensor;
   inches = (mm / 25.4 - 112);
}

This function has undefined variables.

void turn_right()
{
   digitalWrite(ENpinRight, HIGH);
   digitalWrite(ENpinLeft, LOW);

   digitalWrite(LedLeftA, HIGH);
   digitalWrite(LedLeftB, HIGH);

   digitalWrite(pin1Y, LOW);
   digitalWrite(pin2Y, HIGH);
   digitalWrite(pin3Y, HIGH);
   digitalWrite(pin4Y, LOW);

   digitalWrite(LedLeftA, LOW);
   digitalWrite(LedLeftB, LOW);
}

This function has a lot of undefined variables.