-
Notifications
You must be signed in to change notification settings - Fork 740
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
Add a lexer for untokenised BBC BASIC files #1280
Commits on Jul 26, 2019
-
Add a lexer for untokenised BBC BASIC files
Includes full support for ARM BBC BASIC. Some features of BBC BASIC for Windows and BBC BASIC for SDL2.0 are not included.
Configuration menu - View commit details
-
Copy full SHA for 23a6c68 - Browse repository at this point
Copy the full SHA 23a6c68View commit details
Commits on Jul 30, 2019
-
Configuration menu - View commit details
-
Copy full SHA for f559c65 - Browse repository at this point
Copy the full SHA f559c65View commit details -
Configuration menu - View commit details
-
Copy full SHA for c3eefd0 - Browse repository at this point
Copy the full SHA c3eefd0View commit details -
Configuration menu - View commit details
-
Copy full SHA for b8b3aeb - Browse repository at this point
Copy the full SHA b8b3aebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 96c5780 - Browse repository at this point
Copy the full SHA 96c5780View commit details
Commits on Jul 31, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 1629f21 - Browse repository at this point
Copy the full SHA 1629f21View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8662327 - Browse repository at this point
Copy the full SHA 8662327View commit details -
Configuration menu - View commit details
-
Copy full SHA for bae4a5f - Browse repository at this point
Copy the full SHA bae4a5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for eb0390b - Browse repository at this point
Copy the full SHA eb0390bView commit details -
[bbcbasic] imperative ERROR keyword needs to be captured at higher pr…
…iority than built-in function ERR
Configuration menu - View commit details
-
Copy full SHA for db27bd2 - Browse repository at this point
Copy the full SHA db27bd2View commit details -
[bbcbasic] attempt to reduce indcidences of * operator matching CLI c…
…ommand introducer This is done by introducing an extra state where CLI commands are not valid, and classifying the control flow keywords according to whether they transition in or out of this state. Not 100% safe yet, since detecting any expression in :root state should mean that * can only be an operator.
Configuration menu - View commit details
-
Copy full SHA for 918e1ec - Browse repository at this point
Copy the full SHA 918e1ecView commit details
Commits on Aug 1, 2019
-
[bbcbasic] simplify expression states
By using a negative lookahead for when DIM and POINT are statements, rather that a positive lookahead when DIM() and POINT() are used as built-in functions, we can merge state :builtin_function into :expression. As a bonus, since built-in functions are now tested at lower priority than control flow statements, `ERROR` no longer needs its own rule.
Configuration menu - View commit details
-
Copy full SHA for 46171d4 - Browse repository at this point
Copy the full SHA 46171d4View commit details -
[bbcbasic] fix
*
operators being misidentified as inline commandsThis is achieved to inserting `goto :no_further_imperatives` every time we identify a component of an expression, or reach a state where we expect an expression next. Because these will not be balanced by the number of times we return to :root, we can no longer use a state stack. This means that instead of being able to do `mixin :expression` from state `:assembly2`, we need to write out all the same rules again, but without the `goto`s.
Configuration menu - View commit details
-
Copy full SHA for a8861a1 - Browse repository at this point
Copy the full SHA a8861a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for b030693 - Browse repository at this point
Copy the full SHA b030693View commit details -
[bbcbasic] stricter checking of control flow statements
Some of those keywords previously listed are not valid as an imperative statement.
Configuration menu - View commit details
-
Copy full SHA for 40f57d3 - Browse repository at this point
Copy the full SHA 40f57d3View commit details -
[bbcbasic] further simplification
I don't think it realle helps to distinguish control flow statements from other statements, especially since they are tokenised the same. Some keywords (like `TINT`) have ended up in control3 even though they have nothing to do with conrol flow, and others (like `OF`) can appear within either sort of statement (`COLOUR OF x` and `CASE x OF`).
Configuration menu - View commit details
-
Copy full SHA for 33d500f - Browse repository at this point
Copy the full SHA 33d500fView commit details -
[bbcbasic] improvements to handling of
PROC
* `PROC` is permitted in an `ON` statement * An imperative keyword is permitted immediately after `DEFPROCthing` without a separating colon Added a few more examples to the visual spec
Configuration menu - View commit details
-
Copy full SHA for 50f3d0f - Browse repository at this point
Copy the full SHA 50f3d0fView commit details -
[bbcbasic] treat
FN
as a built-in functionIt isn't really a built-in function (since it needs a function name to qualify it, which is lexed as a variable), but it can appear within an expression.
Configuration menu - View commit details
-
Copy full SHA for 3d84b20 - Browse repository at this point
Copy the full SHA 3d84b20View commit details -
[bbcbasic] use a different approach for detecting CLI commands
Using a pair of states just wan't working - there are just too many exceptions to the rules to handle cleanly. So instead, here we take the approach of only permitting `*` to be lexed as a command introducer if it is at the start of a line, or follows `:` or one of a restrictive set of other keywords. Unfortunately, it appears that the lookbehind regexp syntax `(?<=)` doesn't work here, so we have to lex the string including the lead up to the `*` as a multi-token rule. This is fine in all cases except when the first line of the file is a `*` command, but hopefully this will be rare enough that nobody cares.
Configuration menu - View commit details
-
Copy full SHA for cce0cf4 - Browse repository at this point
Copy the full SHA cce0cf4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 62819fd - Browse repository at this point
Copy the full SHA 62819fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for d70c214 - Browse repository at this point
Copy the full SHA d70c214View commit details