munificent / craftinginterpreters

Repository for the book "Crafting Interpreters"
http://www.craftinginterpreters.com/
Other
8.79k stars 1.03k forks source link

typo???!!! #910

Closed OrionRandD closed 3 years ago

OrionRandD commented 3 years ago

"At the same time, I don’t want to drag you through reams of language lawyering..." Is it reams or realms?

Also, I have installed everything and have this in my folder: built with: make get make And then???!!!

asset/ build/ java/ site/ tool/ clox LICENSE README.md book/ c/ note/ test/ util/ jlox Makefile

But have no idea on where and how to start using it :( How do I open the files? With Vim, Emacs, in the browser? Which is the lox language extension? my_hello_world.lox???!!!

degustaf commented 3 years ago

Not a typo.

As for running it. You can get a repl by running either clox, or jlox. The file extension is lox. Either vim, or emacs should be able to open the files.

OrionRandD commented 3 years ago

Thx :)

On Mon, Mar 1, 2021 at 7:43 PM Derek Gustafson notifications@github.com wrote:

Not a typo. https://www.dictionary.com/browse/ream

As for running it. You can get a repl by running either clox, or jlox. The file extension is lox. Either vim, or emacs should be able to open the files.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/munificent/craftinginterpreters/issues/910#issuecomment-788360742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKLPRKLALRAYVEVVM2B2WLDTBQKCDANCNFSM4YNLWMNA .

cm1776 commented 3 years ago

Hi @OrionRandD,

If you are satisfied with the response of @degustaf, I would suggest that you close your issue.

Cheers

OrionRandD commented 3 years ago

@cm1776 Yes and no.

./jlox see.lox

[line 12] Error: Unexpected character. [line 12] Error: Unexpected character. [line 17] Error: Unexpected character. [line 17] Error: Unexpected character. [line 1] Error at 'com': Expect ';' after expression. [line 3] Error at 'java': Expect ';' after expression. [line 4] Error at 'java': Expect ';' after expression. [line 5] Error at 'java': Expect ';' after expression. [line 6] Error at 'java': Expect ';' after expression. [line 7] Error at 'java': Expect ';' after expression. [line 8] Error at 'java': Expect ';' after expression. [line 9] Error at 'java': Expect ';' after expression. [line 11] Error at 'class': Expect ';' after expression. [line 17] Error at '0': Expect ')' after arguments. [line 21] Error at '}': Expect expression.

The file content is:

package com.craftinginterpreters.lox;

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List;

public class Lox { public static void main(String[] args) throws IOException { if (args.length > 1) { System.out.println("Usage: jlox [script]"); System.exit(64); } else if (args.length == 1) { runFile(args[0]); } else { runPrompt(); } } }

munificent commented 3 years ago

That file content is Java code, not Lox code.